Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: docker aio - clean fail2ban and gotrue disabled flags/code
  • Loading branch information
bmpandrade committed Mar 14, 2024
commit 33f3be131dda444a00e3d6b3f0ddceec310a5293
20 changes: 15 additions & 5 deletions docker/all-in-one/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ function disable_fail2ban {
sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/fail2ban.conf
}

function disable_gotrue {
sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/gotrue.conf
sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/gotrue.conf
}

function replace_kong_envoy {
sed -i "s/autostart=.*/autostart=true/" /etc/supervisor/services/envoy.conf
sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/kong.conf
sed -i "s/kong/envoy/" /etc/supervisor/services/group.conf
}

function setup_postgres {
tar -xzvf "$INIT_PAYLOAD_PATH" -C / ./etc/postgresql.schema.sql
mv /etc/postgresql.schema.sql /docker-entrypoint-initdb.d/migrations/99-schema.sql
Expand Down Expand Up @@ -274,19 +285,18 @@ if [ "${AUTOSHUTDOWN_ENABLED:-}" == "true" ]; then
enable_autoshutdown
fi


if [ "${ENVOY_ENABLED:-}" == "true" ]; then
sed -i "s/autostart=.*/autostart=true/" /etc/supervisor/services/envoy.conf
sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/kong.conf
sed -i "s/kong/envoy/" /etc/supervisor/services/group.conf
replace_kong_envoy
fi

if [ "${FAIL2BAN_DISABLED:-}" == "true" ]; then
disable_fail2ban
fi


if [ "${GOTRUE_DISABLED:-}" == "true" ]; then
sed -i "s/autostart=.*/autostart=false/" /etc/supervisor/services/gotrue.conf
sed -i "s/autorestart=.*/autorestart=false/" /etc/supervisor/services/gotrue.conf
disable_gotrue
fi

if [ "${PLATFORM_DEPLOYMENT:-}" == "true" ]; then
Expand Down
12 changes: 8 additions & 4 deletions docker/all-in-one/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ fi
# postgrest up
curl -sSfI "http://localhost:$PGRST_ADMIN_SERVER_PORT/ready"

# gotrue up
curl -sSf "http://localhost:$GOTRUE_API_PORT/health"
if [ "${GOTRUE_DISABLED:-}" != "true" ]; then
# gotrue up
curl -sSf "http://localhost:$GOTRUE_API_PORT/health"
fi

if [ "${ENVOY_ENABLED:-}" == "true" ]; then
# envoy up
Expand All @@ -36,8 +38,10 @@ fi
# pgbouncer up
printf \\0 > "/dev/tcp/localhost/$PGBOUNCER_PORT"

# fail2ban up
fail2ban-client status
if [ "${FAIL2BAN_DISABLED:-}" != "true" ]; then
# fail2ban up
fail2ban-client status
fi

# prometheus exporter up
curl -sSfI "http://localhost:$PGEXPORTER_PORT/metrics"
Expand Down