Skip to content

Commit

Permalink
fix(lets-encrypt): run command non interactively if flag passed
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Feb 11, 2020
1 parent c8fa035 commit 7ccc275
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bench/commands/setup.py
Expand Up @@ -122,7 +122,7 @@ def set_ssh_port(port, force=False):
@click.command('lets-encrypt')
@click.argument('site')
@click.option('--custom-domain')
@click.option('-n', '--non-interactive', default=False, is_flag=True, help="Run certbot non-interactively. Shouldn't be used on 1'st attempt")
@click.option('-n', '--non-interactive', default=False, is_flag=True, help="Run command non-interactively. This flag restarts nginx and runs certbot non interactively. Shouldn't be used on 1'st attempt")
def setup_letsencrypt(site, custom_domain, non_interactive):
"Setup lets-encrypt for site"
from bench.config.lets_encrypt import setup_letsencrypt
Expand Down
7 changes: 4 additions & 3 deletions bench/config/lets_encrypt.py
Expand Up @@ -29,9 +29,10 @@ def setup_letsencrypt(site, custom_domain, bench_path, interactive):
print("No custom domain named {0} set for site".format(custom_domain))
return

click.confirm('Running this will stop the nginx service temporarily causing your sites to go offline\n'
'Do you want to continue?',
abort=True)
if interactive:
click.confirm('Running this will stop the nginx service temporarily causing your sites to go offline\n'
'Do you want to continue?',
abort=True)

if not get_config(bench_path).get("dns_multitenant"):
print("You cannot setup SSL without DNS Multitenancy")
Expand Down

0 comments on commit 7ccc275

Please sign in to comment.