Skip to content

Commit

Permalink
Merge pull request #50 from StevusPrimus/fix/env-variable-rendering
Browse files Browse the repository at this point in the history
fix for rendering enviroment variables for docker compose
  • Loading branch information
he2ss authored Oct 3, 2024
2 parents 3bf2085 + d5368ef commit 61c9c27
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docker/docker_start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash

#set -x
CROWDSEC_BOUNCER_CONFIG="/etc/crowdsec/bouncers/crowdsec-openresty-bouncer.conf"

Expand Down Expand Up @@ -53,10 +54,30 @@ fi
if [ "$CAPTCHA_EXPIRATION" != "" ]; then
sed -i "s,CAPTCHA_EXPIRATION.*,CAPTCHA_EXPIRATION=$CAPTCHA_EXPIRATION," "$CROWDSEC_BOUNCER_CONFIG"
fi

if [ "$CAPTCHA_PROVIDER" != "" ]; then
sed -i "s,CAPTCHA_PROVIDER.*,CAPTCHA_PROVIDER=$CAPTCHA_PROVIDER," "$CROWDSEC_BOUNCER_CONFIG"
fi
if [ "$APPSEC_URL" != "" ]; then
sed -i "s,APPSEC_URL.*,APPSEC_URL=$APPSEC_URL," "$CROWDSEC_BOUNCER_CONFIG"
fi
if [ "$APPSEC_FAILURE_ACTION" != "" ]; then
sed -i "s,APPSEC_FAILURE_ACTION.*,APPSEC_FAILURE_ACTION=$APPSEC_FAILURE_ACTION," "$CROWDSEC_BOUNCER_CONFIG"
fi
if [ "$APPSEC_CONNECT_TIMEOUT" != "" ]; then
sed -i "s,APPSEC_CONNECT_TIMEOUT.*,APPSEC_CONNECT_TIMEOUT=$APPSEC_CONNECT_TIMEOUT," "$CROWDSEC_BOUNCER_CONFIG"
fi
if [ "$APPSEC_SEND_TIMEOUT" != "" ]; then
sed -i "s,APPSEC_SEND_TIMEOUT.*,APPSEC_SEND_TIMEOUT=$APPSEC_SEND_TIMEOUT," "$CROWDSEC_BOUNCER_CONFIG"
fi
if [ "$APPSEC_PROCESS_TIMEOUT" != "" ]; then
sed -i "s,APPSEC_PROCESS_TIMEOUT.*,APPSEC_PROCESS_TIMEOUT=$APPSEC_PROCESS_TIMEOUT," "$CROWDSEC_BOUNCER_CONFIG"
fi
if [ "$ALWAYS_SEND_TO_APPSEC" != "" ]; then
sed -i "s,ALWAYS_SEND_TO_APPSEC.*,ALWAYS_SEND_TO_APPSEC=$ALWAYS_SEND_TO_APPSEC," "$CROWDSEC_BOUNCER_CONFIG"
fi
if [ "$SSL_VERIFY" != "" ]; then
sed -i "s,SSL_VERIFY.*,SSL_VERIFY=$SSL_VERIFY," "$CROWDSEC_BOUNCER_CONFIG"
fi

if [ "${IS_LUALIB_IMAGE,,}" != "true" ]; then
exec /usr/local/openresty/bin/openresty -g "daemon off;"
Expand Down

0 comments on commit 61c9c27

Please sign in to comment.