diff --git a/docker/docker_start.sh b/docker/docker_start.sh index 097c758..5e29e16 100644 --- a/docker/docker_start.sh +++ b/docker/docker_start.sh @@ -1,4 +1,5 @@ #!/bin/bash + #set -x CROWDSEC_BOUNCER_CONFIG="/etc/crowdsec/bouncers/crowdsec-openresty-bouncer.conf" @@ -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;"