Skip to content

Commit

Permalink
chore: rollback the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed Jun 18, 2024
1 parent 99a554e commit e445a80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
8 changes: 4 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
set -e

# raise error if AUTH_TOKEN is not set
# if [ -z "$AUTH_TOKEN" ]; then
# echo "ERROR: AUTH_TOKEN is not set"
# exit 1
# fi
if [ -z "$AUTH_TOKEN" ]; then
echo "ERROR: AUTH_TOKEN is not set"
exit 1
fi

# replace ${AUTH_TOKEN} with the value of AUTH_TOKEN
sed "s/\${AUTH_TOKEN}/$AUTH_TOKEN/g" /usr/local/etc/haproxy/haproxy.cfg.template > /usr/local/etc/haproxy/haproxy.cfg
Expand Down
12 changes: 3 additions & 9 deletions haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ global
pidfile /run/haproxy.pid
maxconn 4000

# Turn on stats unix socket
server-state-file /var/lib/haproxy/server-state

defaults
mode http
log global
Expand All @@ -25,9 +22,6 @@ defaults
timeout check 10s
maxconn 3000

# Allow seamless reloads
load-server-state-from-file global

# Use provided example error pages
errorfile 400 /usr/local/etc/haproxy/errors/400.http
errorfile 403 /usr/local/etc/haproxy/errors/403.http
Expand All @@ -38,10 +32,10 @@ defaults
errorfile 504 /usr/local/etc/haproxy/errors/504.http

frontend docker_frontend
bind [::]:2375 v4v6
bind :2375

# http-request deny if !{ path_beg -i /${AUTH_TOKEN} }
# http-request set-uri %[url,regsub(^/${AUTH_TOKEN},,)]
http-request deny if !{ path_beg -i /${AUTH_TOKEN} }
http-request set-uri %[url,regsub(^/${AUTH_TOKEN},,)]

http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/_ping } METH_GET { env(PING_READ) -m bool }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/_ping } METH_HEAD { env(PING_READ) -m bool }
Expand Down

0 comments on commit e445a80

Please sign in to comment.