aboutsummaryrefslogtreecommitdiff
path: root/args.py
diff options
context:
space:
mode:
Diffstat (limited to 'args.py')
-rw-r--r--args.py52
1 files changed, 41 insertions, 11 deletions
diff --git a/args.py b/args.py
index b4d70d5..a3f400d 100644
--- a/args.py
+++ b/args.py
@@ -4,26 +4,56 @@ import argparse
def get_args():
parser = argparse.ArgumentParser()
- parser.add_argument("--endpoint", default="https://hatecomputers.club")
- parser.add_argument("--api-key-file", default="apikey.secret")
+ parser.add_argument(
+ "--endpoint", default="https://hatecomputers.club", help="API endpoint"
+ )
+ parser.add_argument(
+ "--api-key-file",
+ default="apikey.secret",
+ help="path to file containing the API key",
+ )
parser.add_argument(
"--log-level",
default="INFO",
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
)
- parser.add_argument("--certbot", action="store_true", default=False)
- parser.add_argument("--acme-url", required=False)
- parser.add_argument("--acme-storage", default="acme.json")
+ parser.add_argument(
+ "--public-suffixes",
+ default="hatecomputers.club",
+ help="comma separated list of public suffixes",
+ )
+ parser.add_argument(
+ "--dns-propogate-time",
+ default=20,
+ type=int,
+ help="time to sleep to allow DNS to propogate",
+ )
+ parser.add_argument(
+ "--certbot", action="store_true", default=False, help="enable certbot mode"
+ )
+ parser.add_argument(
+ "--certbot-domain", required=False, help="splat/domain to validate with certbot"
+ )
+ parser.add_argument(
+ "--certbot-validation", required=False, help="validation token for certbot"
+ )
- parser.add_argument("--sync", action="store_true", default=False)
- parser.add_argument("--records-file", default="records.json")
+ parser.add_argument(
+ "--create",
+ action="store_true",
+ default=False,
+ help="upload records file to API to sync",
+ )
+ parser.add_argument("--records-file", default="records.json", help="records file")
args = parser.parse_args()
- if (args.certbot) and (not args.acme_url):
- parser.error("--acme-url is required when --certbot is used")
- if (args.certbot) and (args.sync):
- parser.error("--sync cannot be used in combination with --certbot")
+ if (args.certbot) and (not args.certbot_domain):
+ parser.error("--certbot-domain is required when --certbot is used")
+ if (args.certbot) and (not args.certbot_validation):
+ parser.error("--certbot-validation is required when --certbot is used")
+ if args.certbot:
+ args.public_suffixes = args.public_suffixes.split(",")
return args