|
|
|
@ -47,6 +47,15 @@ def format_for_nginx(fullchain, output):
|
|
|
|
|
for cert in certs[:-1] if len(certs)>2 and os.getenv('LETSENCRYPT_SHORTCHAIN', default="False") else certs:
|
|
|
|
|
pem.write(cert)
|
|
|
|
|
|
|
|
|
|
def add_DANE_pin(chain, output):
|
|
|
|
|
with open(output, 'w') as pem:
|
|
|
|
|
with open(chain, 'r') as chain:
|
|
|
|
|
for line in chain:
|
|
|
|
|
pem.write(line)
|
|
|
|
|
with open('/etc/ssl/certs/ca-cert-ISRG_Root_X1.pem', 'r') as isrgx1:
|
|
|
|
|
for line in isrgx1:
|
|
|
|
|
pem.write(line)
|
|
|
|
|
|
|
|
|
|
# Wait for nginx to start
|
|
|
|
|
time.sleep(5)
|
|
|
|
|
|
|
|
|
@ -54,6 +63,8 @@ time.sleep(5)
|
|
|
|
|
while True:
|
|
|
|
|
subprocess.call(command)
|
|
|
|
|
format_for_nginx('/certs/letsencrypt/live/mailu/fullchain.pem', '/certs/letsencrypt/live/mailu/nginx-chain.pem')
|
|
|
|
|
add_DANE_pin('/certs/letsencrypt/live/mailu/chain.pem', '/certs/letsencrypt/live/mailu/nginx-chain-DANE.pem')
|
|
|
|
|
subprocess.call(command2)
|
|
|
|
|
format_for_nginx('/certs/letsencrypt/live/mailu-ecdsa/fullchain.pem', '/certs/letsencrypt/live/mailu-ecdsa/nginx-chain.pem')
|
|
|
|
|
add_DANE_pin('/certs/letsencrypt/live/mailu-ecdsa/chain.pem', '/certs/letsencrypt/live/mailu-ecdsa/nginx-chain-DANE.pem')
|
|
|
|
|
time.sleep(86400)
|
|
|
|
|