fix: Error with only hns site trying to get icann email

This commit is contained in:
Nathan Woodburn 2024-02-26 13:09:46 +11:00
parent b4d813715c
commit 48ac02b8d0
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -267,10 +267,12 @@ def write_nginx_conf(site):
for alt in site['alt_domains']:
if is_icann(alt):
icann_domains.append(alt)
email = f'admin@{icann_domains[0]}'
icann_domains = " -d ".join(icann_domains)
icann_domains = f'-d {icann_domains}'
os.system(f'certbot --nginx {icann_domains} --non-interactive --agree-tos --email {email} --redirect')
if len(icann_domains) > 0:
email = f'admin@{icann_domains[0]}'
icann_domains = " -d ".join(icann_domains)
icann_domains = f'-d {icann_domains}'
os.system(f'certbot --nginx {icann_domains} --non-interactive --agree-tos --email {email} --redirect')
return True