Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitiry Vinogradov <sim.fishing@gmail.com>2025-01-11 15:41:48 +0300
committerGitHub <noreply@github.com>2025-01-11 15:41:48 +0300
commita4c38ec8ae0495ce7a1bee00728a1e108b3a9b68 (patch)
treea29c4e05611b78f04e7b257fc1d60d5add433755
parent0c477716718c5f8052f95ad3c2f51ddf661e7f4e (diff)
fail2ban service in docker container (#2632)
docker container Co-authored-by: Dmitrij Vinogradov <dmitrij.vinogradov@gmail.com>
-rw-r--r--DockerEntrypoint.sh2
-rw-r--r--Dockerfile1
-rw-r--r--docker-compose.yml1
3 files changed, 3 insertions, 1 deletions
diff --git a/DockerEntrypoint.sh b/DockerEntrypoint.sh
index 9ebcd1d6..dfd85ba7 100644
--- a/DockerEntrypoint.sh
+++ b/DockerEntrypoint.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Start fail2ban
-fail2ban-client -x start
+[ $X_UI_ENABLE_FAIL2BAN == "true" ] && fail2ban-client -x start
# Run x-ui
exec /app/x-ui
diff --git a/Dockerfile b/Dockerfile
index ac09b531..2d223181 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -48,6 +48,7 @@ RUN chmod +x \
/app/x-ui \
/usr/bin/x-ui
+ENV X_UI_ENABLE_FAIL2BAN="true"
VOLUME [ "/etc/x-ui" ]
CMD [ "./x-ui" ]
ENTRYPOINT [ "/app/DockerEntrypoint.sh" ]
diff --git a/docker-compose.yml b/docker-compose.yml
index b0a89399..00a82901 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -11,6 +11,7 @@ services:
- $PWD/cert/:/root/cert/
environment:
XRAY_VMESS_AEAD_FORCED: "false"
+ X_UI_ENABLE_FAIL2BAN: "true"
tty: true
network_mode: host
restart: unless-stopped