From b0b6203ef40387920402e8c9b238bc122d841251 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Fri, 25 Mar 2022 21:14:47 +0000 Subject: [PATCH] Allow disabling f2b service --- README.md | 1 + root/etc/cont-init.d/98-crowdsec | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 6c2af22..f9dc482 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ Set the following environment variables on your SWAG container. | `CROWDSEC_SITE_KEY` | **Optional** | reCAPTCHA v2 Site Key | | `CROWDSEC_SECRET_KEY` | **Optional** | reCAPTCHA v2 Secret Key | | `CROWDSEC_VERSION` | **Optional** | Specify a version of the bouncer to install instead of using the latest release, for example `v1.0.0`. Must be a valid [release tag](https://github.com/crowdsecurity/cs-nginx-bouncer/tags). **Does not support versions older than v1.0.0**. +| `CROWDSEC_F2B_DISABLE` | **Optional** | Set to `true` to disable swag's built-in fail2ban service if you don't need it | | | | | The variables need to remain in place while you are using the mod. If you remove **required** variables the bouncer will be disabled the next time you recreate the container, if you remove **optional** variables the associated features will be disabled the next time you recreate the container. diff --git a/root/etc/cont-init.d/98-crowdsec b/root/etc/cont-init.d/98-crowdsec index 8d2b43c..9ef169b 100644 --- a/root/etc/cont-init.d/98-crowdsec +++ b/root/etc/cont-init.d/98-crowdsec @@ -79,4 +79,10 @@ rm -rf \ /tmp/crowdsec \ /tmp/crowdsec.tar.gz +# Disable f2b if requested +if [[ $CROWDSEC_F2B_DISABLE == "true" ]]; then + echo "**** Disabling fail2ban Service ****" + touch /etc/services.d/fail2ban/down +fi + echo "**** Successfully configured CrowdSec nginx Bouncer ${CROWDSEC_VERSION} ****"