forked from steinsag/hosteurope-letsencrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
neu.py
executable file
·28 lines (23 loc) · 866 Bytes
/
neu.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
# coding=utf-8
from shared import prepare_domain_list, get_config, prepare_certbot_dirs, process_cert_request
config = get_config('einstellungen.json')
challenge = config.get('preferred-challenge', 'http')
# certbot Kommando zusammenbauen
cmd = 'certbot certonly --manual --agree-tos --manual-public-ip-logging-ok'
cmd += ' -m ' + config['email']
cmd += ' --preferred-challenge=' + challenge
if 'http' == challenge:
cmd += ' --manual-auth-hook "python3 validate.py"'
if config['staging']:
cmd += ' --staging'
cmd += prepare_certbot_dirs()
cmd += prepare_domain_list()
# Sicherheitsabfrage
print(cmd)
answer = input('Für diese Domains ein neues Zertifikat erstellen? (j/n): ')
if answer != 'j':
print('Abbruch, es wurde kein Zertifikat erstellt.')
exit(0)
# neues Zertifikat erstellen
process_cert_request(cmd, challenge)