Skip to content

Commit 589b80e

Browse files
committed
Support disabling f2b
1 parent 2dc24f9 commit 589b80e

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ services:
189189
- ONLY_SUBDOMAINS=false #optional
190190
- EXTRA_DOMAINS= #optional
191191
- STAGING=false #optional
192+
- DISABLE_F2B= #optional
192193
volumes:
193194
- /path/to/swag/config:/config
194195
ports:
@@ -216,6 +217,7 @@ docker run -d \
216217
-e ONLY_SUBDOMAINS=false `#optional` \
217218
-e EXTRA_DOMAINS= `#optional` \
218219
-e STAGING=false `#optional` \
220+
-e DISABLE_F2B= `#optional` \
219221
-p 443:443 \
220222
-p 80:80 `#optional` \
221223
-v /path/to/swag/config:/config \
@@ -244,6 +246,7 @@ Containers are configured using parameters passed at runtime (such as those abov
244246
| `-e ONLY_SUBDOMAINS=false` | If you wish to get certs only for certain subdomains, but not the main domain (main domain may be hosted on another machine and cannot be validated), set this to `true` |
245247
| `-e EXTRA_DOMAINS=` | Additional fully qualified domain names (comma separated, no spaces) ie. `example.net,subdomain.example.net,*.example.org` |
246248
| `-e STAGING=false` | Set to `true` to retrieve certs in staging mode. Rate limits will be much higher, but the resulting cert will not pass the browser's security test. Only to be used for testing purposes. |
249+
| `-e DISABLE_F2B=` | Set to `true` to disable the Fail2ban service in the container, if you're already running it elsewhere or using a different IPS. |
247250
| `-v /config` | Persistent config files |
248251
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |
249252
| `--cap-add=NET_ADMIN` | Required for fail2Ban to be able to modify iptables rules. |

readme-vars.yml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ opt_param_env_vars:
3737
- {env_var: "ONLY_SUBDOMAINS", env_value: "false", desc: "If you wish to get certs only for certain subdomains, but not the main domain (main domain may be hosted on another machine and cannot be validated), set this to `true`"}
3838
- {env_var: "EXTRA_DOMAINS", env_value: "", desc: "Additional fully qualified domain names (comma separated, no spaces) ie. `example.net,subdomain.example.net,*.example.org`"}
3939
- {env_var: "STAGING", env_value: "false", desc: "Set to `true` to retrieve certs in staging mode. Rate limits will be much higher, but the resulting cert will not pass the browser's security test. Only to be used for testing purposes."}
40+
- {env_var: "DISABLE_F2B", env_value: "", desc: "Set to `true` to disable the Fail2ban service in the container, if you're already running it elsewhere or using a different IPS."}
4041
opt_param_usage_include_ports: true
4142
opt_param_ports:
4243
- {external_port: "80", internal_port: "80", port_desc: "HTTP port (required for HTTP validation and HTTP -> HTTPS redirect)"}

root/etc/s6-overlay/s6-rc.d/init-fail2ban-config/run

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

4-
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
4+
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]] && [[ "${DISABLE_F2B,,}" != "true" ]]; then
55
if ! iptables -L &> /dev/null; then
66
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/iptables
77
ln -sf /usr/sbin/xtables-legacy-multi /usr/sbin/iptables-save

root/etc/s6-overlay/s6-rc.d/svc-fail2ban/run

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/with-contenv bash
22
# shellcheck shell=bash
33

4-
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then
4+
if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]] && [[ "${DISABLE_F2B,,}" != "true" ]]; then
55
exec \
66
fail2ban-client -x -f start
77
else

0 commit comments

Comments
 (0)