Added liste support
This commit is contained in:
parent
02f9f2d3f7
commit
a705746d29
1 changed files with 15 additions and 2 deletions
17
OTcerts.py
17
OTcerts.py
|
@ -192,11 +192,15 @@ if __name__ == '__main__':
|
||||||
ot_conn=connect_db(dict(config['ot_db']))
|
ot_conn=connect_db(dict(config['ot_db']))
|
||||||
dns_conn=connect_db(dict(config['dns_db']))
|
dns_conn=connect_db(dict(config['dns_db']))
|
||||||
|
|
||||||
|
if dryrun:
|
||||||
|
print("DRYRUN, nessuna operazione verra' eseguita realmente")
|
||||||
|
|
||||||
|
|
||||||
# Caso speciale per le webmail
|
# Caso speciale per le webmail
|
||||||
if args.webmail:
|
if args.webmail:
|
||||||
logging.info('Asking certificates for webmail')
|
logging.info('Asking certificates for webmail')
|
||||||
vhost_name = config['webmail']['vhost'].strip()
|
vhost_name = config['webmail']['vhost'].strip()
|
||||||
webmails_list = ["webmail.{}".format(d.strip()) for d in config['webmail']['domains'].split(',')]
|
webmails_list = ["webmail.{}".format(d.strip()) for d in config['webmail']['domains'].split(',') if len(d.strip())>0]
|
||||||
if acme_request(config, vhost_name, acme_test='HTTP-01', dryrun=dryrun, domains_list=webmails_list):
|
if acme_request(config, vhost_name, acme_test='HTTP-01', dryrun=dryrun, domains_list=webmails_list):
|
||||||
link_cert(config, vhost_name, vhost_name, dryrun=dryrun)
|
link_cert(config, vhost_name, vhost_name, dryrun=dryrun)
|
||||||
else:
|
else:
|
||||||
|
@ -224,6 +228,15 @@ if __name__ == '__main__':
|
||||||
for subdomain in domain_feat['subdomains']:
|
for subdomain in domain_feat['subdomains']:
|
||||||
if acme_request(config, subdomain, acme_test='HTTP-01', dryrun=dryrun):
|
if acme_request(config, subdomain, acme_test='HTTP-01', dryrun=dryrun):
|
||||||
link_cert(config, subdomain, subdomain, dryrun=dryrun)
|
link_cert(config, subdomain, subdomain, dryrun=dryrun)
|
||||||
|
|
||||||
ot_conn.close()
|
ot_conn.close()
|
||||||
dns_conn.close()
|
dns_conn.close()
|
||||||
|
|
||||||
|
# Genero il certificato per l'interfaccia di mailman
|
||||||
|
if args.liste:
|
||||||
|
logging.info('Asking certificates for liste.indivia.net')
|
||||||
|
vhost_name = config['mailman']['vhost'].strip()
|
||||||
|
liste_list = ["liste.{}".format(d.strip()) for d in config['mailman']['domains'].split(',') if len(d.strip())>0]
|
||||||
|
if acme_request(config, vhost_name, acme_test='HTTP-01', dryrun=dryrun, domains_list=liste_list):
|
||||||
|
link_cert(config, vhost_name, vhost_name, dryrun=dryrun)
|
||||||
|
else:
|
||||||
|
logger.error('Error asking certificate for {}'.format(vhost_name))
|
||||||
|
|
Loading…
Reference in a new issue