2
0
mirror of https://github.com/frappe/bench.git synced 2025-02-07 13:18:24 +00:00

Merge pull request #923 from gavindsouza/lets-encrypt-non-interactive

fix(lets-encrypt): run command non interactively if flag passed
This commit is contained in:
gavin 2020-02-17 00:46:50 +05:30 committed by GitHub
commit d58fc11b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -122,7 +122,7 @@ def set_ssh_port(port, force=False):
@click.command('lets-encrypt') @click.command('lets-encrypt')
@click.argument('site') @click.argument('site')
@click.option('--custom-domain') @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): def setup_letsencrypt(site, custom_domain, non_interactive):
"Setup lets-encrypt for site" "Setup lets-encrypt for site"
from bench.config.lets_encrypt import setup_letsencrypt from bench.config.lets_encrypt import setup_letsencrypt

View File

@ -29,6 +29,7 @@ def setup_letsencrypt(site, custom_domain, bench_path, interactive):
print("No custom domain named {0} set for site".format(custom_domain)) print("No custom domain named {0} set for site".format(custom_domain))
return return
if interactive:
click.confirm('Running this will stop the nginx service temporarily causing your sites to go offline\n' click.confirm('Running this will stop the nginx service temporarily causing your sites to go offline\n'
'Do you want to continue?', 'Do you want to continue?',
abort=True) abort=True)