Fix Runtime Errors
This commit is contained in:
parent
c3caa3af90
commit
cd2a3c6b9c
4 changed files with 10 additions and 9 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
| EASYHAPROXY_DISCOVER | How the services will be discovered to create `haproxy.cfg`: `static`, `docker`, `swarm` or `kubernetes` | **required** |
|
| EASYHAPROXY_DISCOVER | How the services will be discovered to create `haproxy.cfg`: `static`, `docker`, `swarm` or `kubernetes` | **required** |
|
||||||
| EASYHAPROXY_LABEL_PREFIX | (Optional) The key will search for matching resources. | `easyhaproxy` |
|
| EASYHAPROXY_LABEL_PREFIX | (Optional) The key will search for matching resources. | `easyhaproxy` |
|
||||||
| EASYHAPROXY_LETSENCRYPT_EMAIL | (Optional) The email will be used to request the certificate to Letsencrypt | *empty* |
|
| EASYHAPROXY_LETSENCRYPT_EMAIL | (Optional) The email will be used to request the certificate to Letsencrypt | *empty* |
|
||||||
| EASYHAPROXY_LETSENCRYPT_SERVER | (Optional) Can be true or 'schema://domain.tld'. If set, will try to connect to the Letsencrypt test server | false |
|
| EASYHAPROXY_LETSENCRYPT_SERVER | (Optional) Can be `staging` or 'schema://domain.tld'. If set, will try to connect to the Letsencrypt test server | *empty* |
|
||||||
| EASYHAPROXY_SSL_MODE | (Optional) `strict` supports only the most recent TLS version; `default` good SSL integration with recent browsers; `loose` supports all old SSL protocols for old browsers (not recommended). | `default`|
|
| EASYHAPROXY_SSL_MODE | (Optional) `strict` supports only the most recent TLS version; `default` good SSL integration with recent browsers; `loose` supports all old SSL protocols for old browsers (not recommended). | `default`|
|
||||||
| EASYHAPROXY_REFRESH_CONF | (Optional) Check configuration every N seconds. | 10 |
|
| EASYHAPROXY_REFRESH_CONF | (Optional) Check configuration every N seconds. | 10 |
|
||||||
| EASYHAPROXY_LOG_LEVEL | (Optional) The log level for EasyHAproxy messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
| EASYHAPROXY_LOG_LEVEL | (Optional) The log level for EasyHAproxy messages. Available: TRACE,DEBUG,INFO,WARN,ERROR,FATAL | DEBUG |
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,4 @@ version: 0.1.4
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
# It is recommended to use it with quotes.
|
# It is recommended to use it with quotes.
|
||||||
appVersion: "4.3.0"
|
appVersion: "4.2.0"
|
||||||
|
|
|
||||||
|
|
@ -180,13 +180,12 @@ class Certbot:
|
||||||
self.test_server = self.set_test_server(test_server)
|
self.test_server = self.set_test_server(test_server)
|
||||||
|
|
||||||
def set_test_server(self, test_server):
|
def set_test_server(self, test_server):
|
||||||
if not test_server:
|
if test_server.lower() == "staging":
|
||||||
return ""
|
|
||||||
|
|
||||||
if test_server.lower() in ["true", "1", "yes"]:
|
|
||||||
return "--staging"
|
return "--staging"
|
||||||
else:
|
elif test_server.lower().startswith("http"):
|
||||||
return "--server " + test_server
|
return "--server " + test_server
|
||||||
|
else:
|
||||||
|
return ""
|
||||||
|
|
||||||
def check_certificates(self, hosts):
|
def check_certificates(self, hosts):
|
||||||
if self.email == "" or len(hosts) == 0:
|
if self.email == "" or len(hosts) == 0:
|
||||||
|
|
@ -247,6 +246,8 @@ class Certbot:
|
||||||
|
|
||||||
def find_live_certificates(self):
|
def find_live_certificates(self):
|
||||||
letsencrypt_certs = "/etc/letsencrypt/live/"
|
letsencrypt_certs = "/etc/letsencrypt/live/"
|
||||||
|
if not os.path.exists(letsencrypt_certs):
|
||||||
|
return
|
||||||
for item in os.listdir(letsencrypt_certs):
|
for item in os.listdir(letsencrypt_certs):
|
||||||
path = os.path.join(letsencrypt_certs, item)
|
path = os.path.join(letsencrypt_certs, item)
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ def start():
|
||||||
haproxy.haproxy("start")
|
haproxy.haproxy("start")
|
||||||
haproxy.sleep()
|
haproxy.sleep()
|
||||||
|
|
||||||
certbot = Certbot(Consts.certs_letsencrypt, os.getenv("EASYHAPROXY_LETSENCRYPT_EMAIL"), os.getenv("EASYHAPROXY_LETSENCRYPT_SERVER", "false").lower())
|
certbot = Certbot(Consts.certs_letsencrypt, os.getenv("EASYHAPROXY_LETSENCRYPT_EMAIL"), os.getenv("EASYHAPROXY_LETSENCRYPT_SERVER", "").lower())
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
if old_haproxy is not None:
|
if old_haproxy is not None:
|
||||||
|
|
@ -70,4 +70,4 @@ def main():
|
||||||
start()
|
start()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue