Skip to content

Commit

Permalink
haproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaofeng1227 committed Dec 22, 2023
1 parent 1f81166 commit 2acbe13
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/haproxy/.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ W9_POWER_PASSWORD=uQ8E1wVTzG8SOk3!
#### -- Not allowed to edit below environments when recreate app based on existing data -- ####
W9_ID=haproxy
W9_LOGIN_USER=admin
W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD
W9_LOGIN_PASSWORD=admin
W9_ADMIN_PATH="/stats"
# This URL is for Load balancing frontend
W9_URL=appname.example.com
Expand Down
2 changes: 2 additions & 0 deletions apps/haproxy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ services:
- ${W9_HTTP_PORT_SET}:1080
volumes:
- ./src/haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
environment:
W9_POWER_PASSWORD: $W9_POWER_PASSWORD
restart: unless-stopped
user: root
env_file: .env
Expand Down
2 changes: 1 addition & 1 deletion apps/haproxy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

# up the native entrypoint.sh and cmd
exec "$@"
echo "$(sed "s/admin:.*/admin:$W9_LOGIN_PASSWORD/g" /usr/local/etc/haproxy/haproxy.cfg)" > /usr/local/etc/haproxy/haproxy.cfg
echo "$(sed "s/admin:.*/admin:$W9_POWER_PASSWORD/g" /usr/local/etc/haproxy/haproxy.cfg)" > /usr/local/etc/haproxy/haproxy.cfg
/usr/local/bin/docker-entrypoint.sh haproxy -f /usr/local/etc/haproxy/haproxy.cfg
2 changes: 1 addition & 1 deletion apps/haproxy/src/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ listen admin_stats
stats refresh 10s
stats uri /stats
stats realm Haproxy
stats auth admin:$W9_POWER_PASSWORD
stats auth admin:admin
stats hide-version
stats admin if TRUE

0 comments on commit 2acbe13

Please sign in to comment.