Skip to content

Commit a4c38ec

Browse files
simfishingDmitrij Vinogradov
and
Dmitrij Vinogradov
authored
fail2ban service in docker container (#2632)
docker container Co-authored-by: Dmitrij Vinogradov <[email protected]>
1 parent 0c47771 commit a4c38ec

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

DockerEntrypoint.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
# Start fail2ban
4-
fail2ban-client -x start
4+
[ $X_UI_ENABLE_FAIL2BAN == "true" ] && fail2ban-client -x start
55

66
# Run x-ui
77
exec /app/x-ui

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ RUN chmod +x \
4848
/app/x-ui \
4949
/usr/bin/x-ui
5050

51+
ENV X_UI_ENABLE_FAIL2BAN="true"
5152
VOLUME [ "/etc/x-ui" ]
5253
CMD [ "./x-ui" ]
5354
ENTRYPOINT [ "/app/DockerEntrypoint.sh" ]

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
- $PWD/cert/:/root/cert/
1212
environment:
1313
XRAY_VMESS_AEAD_FORCED: "false"
14+
X_UI_ENABLE_FAIL2BAN: "true"
1415
tty: true
1516
network_mode: host
1617
restart: unless-stopped

0 commit comments

Comments
 (0)