Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

Update core container Dockerfiles

aapanel.comfcc32626a53b
diff --git a/Dockerfiles/core/Dockerfile b/Dockerfiles/core/Dockerfile
index 794e1880..ff6cb777 100644
--- a/Dockerfiles/core/Dockerfile
+++ b/Dockerfiles/core/Dockerfile
@@ -8,6 +8,7 @@ ENV LC_ALL=C.UTF-8
# COPY repositories /etc/apk/repositories
COPY stop-supervisor.sh /stop-supervisor.sh
COPY core.sh /core.sh
+COPY restart_fail2ban.sh /restart_fail2ban.sh
# Install dependencies (using Alpine's apk package manager)
RUN apk add --no-cache \
@@ -23,7 +24,7 @@ RUN apk add --no-cache \
iptables \
ipset \
&& rm -rf /var/cache/apk/* \
- && chmod +x /stop-supervisor.sh /core.sh
+ && chmod +x /stop-supervisor.sh /core.sh /restart_fail2ban.sh
# Copy file
diff --git a/Dockerfiles/core/core.sh b/Dockerfiles/core/core.sh
index e1e13297..ac7db3d4 100644
--- a/Dockerfiles/core/core.sh
+++ b/Dockerfiles/core/core.sh
@@ -42,6 +42,13 @@ if [[ ${FAIL2BAN_INIT} == "y" ]]; then
if [ ! -f "/etc/fail2ban/jail.d/roundcube-accesslimit.conf" ]; then
cp -f /opt/billionmail/conf/core/fail2ban_init/jail.d/roundcube-accesslimit.conf /etc/fail2ban/jail.d/roundcube-accesslimit.conf
fi
+
+ if ! grep -q "restart_fail2ban.sh" /var/spool/cron/crontabs/root; then
+ chmod +x /restart_fail2ban.sh
+ echo "02 */12 * * * bash /restart_fail2ban.sh" >> /var/spool/cron/crontabs/root
+ pkill -9 crond
+ fi
+
else
rm -f /etc/fail2ban/jail.d/core-accesslimit.conf
rm -f /etc/fail2ban/jail.d/roundcube-accesslimit.conf
diff --git a/Dockerfiles/core/restart_fail2ban.sh b/Dockerfiles/core/restart_fail2ban.sh
new file mode 100644
index 00000000..d7387abc
--- /dev/null
+++ b/Dockerfiles/core/restart_fail2ban.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+if [[ ${FAIL2BAN_INIT} == "y" ]]; then
+ /usr/bin/fail2ban-client reload core-accesslimit
+ /usr/bin/fail2ban-client reload roundcube-accesslimit
+fi
diff --git a/Dockerfiles/core/supervisord.conf b/Dockerfiles/core/supervisord.conf
index 39b8b750..343cb921 100644
--- a/Dockerfiles/core/supervisord.conf
+++ b/Dockerfiles/core/supervisord.conf
@@ -31,6 +31,15 @@ startsecs=10
priority=200
+[program:crond]
+command=/usr/sbin/crond -f
+autostart=true
+autorestart=true
+stdout_logfile=/dev/stdout
+stdout_logfile_maxbytes=0
+stderr_logfile=/dev/stderr
+stderr_logfile_maxbytes=0
+user=root
[eventlistener:processes]
command=/stop-supervisor.sh