format; better dehydrated options

This commit is contained in:
bain 2024-11-04 22:21:57 +01:00
parent e5e11af36d
commit 5494ceba1d
Signed by: bain
GPG key ID: 31F0F25E3BED0B9B

View file

@ -94,7 +94,7 @@ def cli():
"--certs-only", "--certs-only",
type=bool, type=bool,
is_flag=True, 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) @click.option("--skip-master-check", type=bool, is_flag=True)
def up(certs_only: bool, skip_master_check: bool): 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( 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: if ec != 0:
log = Path(tempfile.mktemp()) log = Path(tempfile.mktemp())
@ -166,7 +171,9 @@ def up(certs_only: bool, skip_master_check: bool):
if (first_part := target.split("/")[0]) and ( if (first_part := target.split("/")[0]) and (
remote := first_part.split(":")[0] 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: else:
ec, stdout = sysaction.run_shell(("nginx", "-s", "reload")) ec, stdout = sysaction.run_shell(("nginx", "-s", "reload"))