瀏覽代碼

fail2ban service in docker container (#2632)

docker container

Co-authored-by: Dmitrij Vinogradov <[email protected]>
Dmitiry Vinogradov 2 月之前
父節點
當前提交
a4c38ec8ae
共有 3 個文件被更改,包括 3 次插入1 次删除
  1. 1 1
      DockerEntrypoint.sh
  2. 1 0
      Dockerfile
  3. 1 0
      docker-compose.yml

+ 1 - 1
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

+ 1 - 0
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" ]

+ 1 - 0
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