summaryrefslogtreecommitdiff
path: root/renew-all
diff options
context:
space:
mode:
Diffstat (limited to 'renew-all')
-rwxr-xr-xrenew-all9
1 files changed, 7 insertions, 2 deletions
diff --git a/renew-all b/renew-all
index 8d1455a..9774c28 100755
--- a/renew-all
+++ b/renew-all
@@ -3,10 +3,15 @@
#
# SPDX-License-Identifier: AGPL-3.0-only
+import argparse
import logging
import subprocess
import tomllib
+parser = argparse.ArgumentParser()
+parser.add_argument("--env", required=True, choices=["prod", "nonprod"])
+args = parser.parse_args()
+
def main() -> None:
with open("/etc/opt/acme/config.toml", "rb") as config_file:
@@ -31,11 +36,11 @@ def main() -> None:
"--dns",
domain["provider"],
"--server",
- config["acme_server_prod"],
+ config[f"acme_server_{args.env}"],
"--dns.disable-cp",
]
+ subdomain_requests
- + ["renew", "--renew-hook", domain["renew_script"]]
+ + ["renew", "--renew-hook", domain[f"renew_script_{args.env}"]]
)
environment = {
"DESEC_POLLING_INTERVAL": str(config["timeout_seconds"]),