1
0
Fork 0

Revert "allow HAPROXY_PASSWORD to be a path to a Docker secret - resolve if so"

This reverts commit e8becef76d.
This commit is contained in:
Dan Tenenbaum 2021-10-20 11:35:40 -07:00
parent e8becef76d
commit 21f723cb47

View file

@ -10,13 +10,9 @@ result = {
} }
if os.getenv("HAPROXY_PASSWORD"): if os.getenv("HAPROXY_PASSWORD"):
password = os.getenv("HAPROXY_PASSWORD")
if password.startswith("/run/secrets/"): # support docker secrets
with open(password) as passfh:
password = passfh.read().strip()
result["stats"] = { result["stats"] = {
"username": os.getenv("HAPROXY_USERNAME") if os.getenv("HAPROXY_USERNAME") else "admin", "username": os.getenv("HAPROXY_USERNAME") if os.getenv("HAPROXY_USERNAME") else "admin",
"password": password, "password": os.getenv("HAPROXY_PASSWORD"),
"port": os.getenv("HAPROXY_STATS_PORT") if os.getenv("HAPROXY_STATS_PORT") else "1936", "port": os.getenv("HAPROXY_STATS_PORT") if os.getenv("HAPROXY_STATS_PORT") else "1936",
} }