From 28342cdc211744b582f7c1e3a95edb6445ccb031 Mon Sep 17 00:00:00 2001 From: Joao M Date: Thu, 25 Aug 2022 02:03:47 +0000 Subject: [PATCH] Lets encrypt --- src/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 17e1130..69bd1c3 100644 --- a/src/main.py +++ b/src/main.py @@ -19,6 +19,7 @@ def start(): processor_obj.save_config(haproxy_config) processor_obj.save_certs(certs_haproxy) + letsencrypt_certs_found = processor_obj.get_letsencrypt_hosts() Functions.log('EASYHAPROXY', 'info', 'Found hosts: %s' % ", ".join(processor_obj.get_hosts())) # Needs to after save_config old_haproxy = None @@ -39,13 +40,14 @@ def start(): Functions.log('EASYHAPROXY', 'info', 'New configuration found. Reloading...') processor_obj.save_config(haproxy_config) processor_obj.save_certs(certs_haproxy) + letsencrypt_certs_found = processor_obj.get_letsencrypt_hosts() Functions.log('EASYHAPROXY', 'info', 'Found hosts: %s' % ", ".join(processor_obj.get_hosts())) # Needs to after save_config old_haproxy = haproxy haproxy = DaemonizeHAProxy() haproxy.haproxy("reload") old_haproxy.terminate() - certbot.check_certificates(processor_obj.get_letsencrypt_hosts()) + certbot.check_certificates(letsencrypt_certs_found) except Exception as e: Functions.log('EASYHAPROXY', 'error', "Err: %s" % (e)) Functions.log('EASYHAPROXY', 'info', 'Heartbeat')