From e31ec1de96d3fc76eebb647477c54085a2ec5685 Mon Sep 17 00:00:00 2001 From: bain Date: Mon, 4 Nov 2024 22:21:57 +0100 Subject: [PATCH] format; better dehydrated options --- ncc/main.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ncc/main.py b/ncc/main.py index 2ab4524..a6c1cae 100644 --- a/ncc/main.py +++ b/ncc/main.py @@ -94,7 +94,7 @@ def cli(): "--certs-only", type=bool, is_flag=True, - help="Only fetches and deploys new certificates", + help="Try to fetch certificates and deploy", ) @click.option("--skip-master-check", type=bool, is_flag=True) def up(certs_only: bool, skip_master_check: bool): @@ -124,7 +124,12 @@ def up(certs_only: bool, skip_master_check: bool): ) ec, stdout = sysaction.run_shell( - (str(dehydrated_dir / "dehydrated.sh"), "-c"), window_height=5 + ( + str(dehydrated_dir / "dehydrated.sh"), + "-c", + *(["-g"] if certs_only else []), + ), + window_height=5, ) if ec != 0: log = Path(tempfile.mktemp()) @@ -166,7 +171,9 @@ def up(certs_only: bool, skip_master_check: bool): if (first_part := target.split("/")[0]) and ( remote := first_part.split(":")[0] ): - ec, stdout = sysaction.run_shell(("ssh", "-T", remote, "nginx -s reload")) + ec, stdout = sysaction.run_shell( + ("ssh", "-T", remote, "nginx -s reload") + ) else: ec, stdout = sysaction.run_shell(("nginx", "-s", "reload"))