Skip to content

Commit

Permalink
LET'S ENCRYPT - RENEW CRONTAB :: Fixed : Reload modified tls profiles…
Browse files Browse the repository at this point in the history
… according to renewed certificates
  • Loading branch information
KGuillemot committed Aug 4, 2021
1 parent 14985a9 commit d97f4ba
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crontab/vlt-gui/acme-renew.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
logger = logging.getLogger('cluster')

from gui.models.ssl_certificate import SSLCertificate
from gui.models.mod_ssl import ModSSL
from gui.models.system_settings import Cluster
from M2Crypto import X509
from redis import Redis
Expand Down Expand Up @@ -65,6 +66,7 @@
else:
logger.info("Let's encrypt certificates renewed : {}".format(success))

updated_modssl = set()
for cert in SSLCertificate.objects(issuer="LET'S ENCRYPT", status__ne="R"):

if is_master:
Expand Down Expand Up @@ -121,6 +123,15 @@
print("Updating certificate {}".format(cert.name))
cert.write_certificate()

for ssl_profile in ModSSL.objects.filter(certificate=cert):
updated_modssl.update(ssl_profile)


for modssl in updated_modssl:
print("Reloading ssl profile '{}' certificates".format(modssl))
modssl.writeConf()


""" Let's reload Apache's processes """
subprocess.Popen(['/usr/local/bin/sudo', '-u', 'vlt-sys', '/usr/local/bin/sudo', 'service', 'vulture', 'reload'])

0 comments on commit d97f4ba

Please sign in to comment.