From 2e45690fed285c64f9cee231d6e5230a22a03917 Mon Sep 17 00:00:00 2001 From: Dan Tenenbaum Date: Wed, 20 Oct 2021 10:51:37 -0700 Subject: [PATCH 1/3] correct the path to haproxy - should be /usr/sbin/haproxy --- assets/scripts/haproxy-reload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts/haproxy-reload.sh b/assets/scripts/haproxy-reload.sh index ecee161..094fd3e 100755 --- a/assets/scripts/haproxy-reload.sh +++ b/assets/scripts/haproxy-reload.sh @@ -49,5 +49,5 @@ fi if [[ "$RELOAD" == "true" ]]; then echo "Reloading..." - /usr/local/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -x /var/run/haproxy.sock -sf $(cat /run/haproxy.pid) & + /usr/sbin/haproxy -W -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -x /var/run/haproxy.sock -sf $(cat /run/haproxy.pid) & fi From e8becef76d4871be24e1e477ea1f8eabca38a102 Mon Sep 17 00:00:00 2001 From: Dan Tenenbaum Date: Wed, 20 Oct 2021 11:33:23 -0700 Subject: [PATCH 2/3] allow HAPROXY_PASSWORD to be a path to a Docker secret - resolve if so --- assets/scripts/swarm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/scripts/swarm.py b/assets/scripts/swarm.py index c7741ec..e505336 100644 --- a/assets/scripts/swarm.py +++ b/assets/scripts/swarm.py @@ -10,9 +10,13 @@ result = { } 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"] = { "username": os.getenv("HAPROXY_USERNAME") if os.getenv("HAPROXY_USERNAME") else "admin", - "password": os.getenv("HAPROXY_PASSWORD"), + "password": password, "port": os.getenv("HAPROXY_STATS_PORT") if os.getenv("HAPROXY_STATS_PORT") else "1936", } From 21f723cb47e8f5b7789cdd28a0d72e14df0ed380 Mon Sep 17 00:00:00 2001 From: Dan Tenenbaum Date: Wed, 20 Oct 2021 11:35:40 -0700 Subject: [PATCH 3/3] Revert "allow HAPROXY_PASSWORD to be a path to a Docker secret - resolve if so" This reverts commit e8becef76d4871be24e1e477ea1f8eabca38a102. --- assets/scripts/swarm.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/assets/scripts/swarm.py b/assets/scripts/swarm.py index e505336..c7741ec 100644 --- a/assets/scripts/swarm.py +++ b/assets/scripts/swarm.py @@ -10,13 +10,9 @@ result = { } 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"] = { "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", }