mirror of
https://git.nolog.cz/NoLog.cz/nginx-configurator.git
synced 2025-01-31 03:43:35 +01:00
add option to skip certificate fetching
This commit is contained in:
parent
67bf25a0a0
commit
a5714a258e
1 changed files with 21 additions and 14 deletions
35
ncc/main.py
35
ncc/main.py
|
@ -97,7 +97,13 @@ def cli():
|
||||||
help="Try to fetch certificates and deploy",
|
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):
|
@click.option(
|
||||||
|
"--skip-certs",
|
||||||
|
type=bool,
|
||||||
|
is_flag=True,
|
||||||
|
help="Do not fetch certificates",
|
||||||
|
)
|
||||||
|
def up(certs_only: bool, skip_master_check: bool, skip_certs: bool):
|
||||||
"""Deploy the configuration to the cluster
|
"""Deploy the configuration to the cluster
|
||||||
|
|
||||||
Does the following:
|
Does the following:
|
||||||
|
@ -123,20 +129,21 @@ def up(certs_only: bool, skip_master_check: bool):
|
||||||
Path(CONFIG["dehydrated_dir"]) / "domains.txt",
|
Path(CONFIG["dehydrated_dir"]) / "domains.txt",
|
||||||
)
|
)
|
||||||
|
|
||||||
ec, stdout = sysaction.run_shell(
|
if not skip_certs:
|
||||||
(
|
ec, stdout = sysaction.run_shell(
|
||||||
str(dehydrated_dir / "dehydrated.sh"),
|
(
|
||||||
"-c",
|
str(dehydrated_dir / "dehydrated.sh"),
|
||||||
*(["-g"] if certs_only else []),
|
"-c",
|
||||||
),
|
*(["-g"] if certs_only else []),
|
||||||
window_height=5,
|
),
|
||||||
)
|
window_height=5,
|
||||||
if ec != 0:
|
|
||||||
log = Path(tempfile.mktemp())
|
|
||||||
log.write_text(stdout)
|
|
||||||
raise NccException(
|
|
||||||
f"dehydrated returned {ec} (log: {click.format_filename(log)})"
|
|
||||||
)
|
)
|
||||||
|
if ec != 0:
|
||||||
|
log = Path(tempfile.mktemp())
|
||||||
|
log.write_text(stdout)
|
||||||
|
raise NccException(
|
||||||
|
f"dehydrated returned {ec} (log: {click.format_filename(log)})"
|
||||||
|
)
|
||||||
|
|
||||||
if not certs_only:
|
if not certs_only:
|
||||||
ec, stdout = sysaction.run_shell(
|
ec, stdout = sysaction.run_shell(
|
||||||
|
|
Loading…
Reference in a new issue