From d89986c13bdf1dcca3560f82f4f23040ad0a00fe Mon Sep 17 00:00:00 2001 From: TheSpad Date: Thu, 27 Jul 2023 10:22:36 +0100 Subject: [PATCH] Add mod debug support --- root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run index eff2bf6..3a75187 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run +++ b/root/etc/s6-overlay/s6-rc.d/init-mod-swag-crowdsec/run @@ -5,6 +5,12 @@ CONFIG_PATH="/config/crowdsec/" LIB_PATH="/usr/local/lua/crowdsec/" DATA_PATH="/var/lib/crowdsec/lua/" +if [[ ${DOCKER_MODS_DEBUG,,} = "true" ]]; then + CURL_NOISE_LEVEL="-v" +else + CURL_NOISE_LEVEL="--silent" +fi + echo "**** Configuring CrowdSec nginx Bouncer ****" # If API keys are missing, disable mod and exit @@ -23,10 +29,10 @@ echo "\ # Download nginx bouncer if [[ -z ${CROWDSEC_VERSION+x} ]]; then \ - CROWDSEC_VERSION=$(curl -sX GET "https://api.github.com/repos/crowdsecurity/cs-nginx-bouncer/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); + CROWDSEC_VERSION=$(curl -s "https://api.github.com/repos/crowdsecurity/cs-nginx-bouncer/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]'); fi -curl -so \ +curl "${CURL_NOISE_LEVEL}" -Lo \ /tmp/crowdsec.tar.gz -L \ "https://github.com/crowdsecurity/cs-nginx-bouncer/releases/download/${CROWDSEC_VERSION}/crowdsec-nginx-bouncer.tgz"