[Watchdog, Config] Added WATCHDOG_NOTIFY_BAN to disable IP ban notifications

[Netfilter] Remove unused files after installation
[Compose] Some new images and a new option for watchdog: WATCHDOG_NOTIFY_BAN - defaults to y
This commit is contained in:
andryyy
2019-06-13 19:38:53 +02:00
parent e43951331c
commit 8984240e44
5 changed files with 19 additions and 6 deletions

View File

@@ -5,9 +5,10 @@ ENV XTABLES_LIBDIR /usr/lib/xtables
ENV PYTHON_IPTABLES_XTABLES_VERSION 12
ENV IPTABLES_LIBDIR /usr/lib
RUN apk add -U python3 python3-dev gcc musl-dev iptables ip6tables tzdata \
RUN apk add --virtual .build-deps gcc python3-dev musl-dev libffi-dev openssl-dev \
&& apk add -U python3 iptables ip6tables tzdata \
&& pip3 install --upgrade python-iptables==0.13.0 redis ipaddress dnspython \
&& apk del python3-dev gcc
&& apk del .build-deps
COPY server.py /
CMD ["python3", "-u", "/server.py"]

View File

@@ -687,8 +687,8 @@ while true; do
for host in "${F2B_RES[@]}"; do
log_msg "Banned ${host}"
rm /tmp/fail2ban 2> /dev/null
whois ${host} > /tmp/fail2ban
[[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" "IP ban: ${host}"
whois ${host} > /tmp/fail2ban
[[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && [[ ${WATCHDOG_NOTIFY_BAN} =~ ^([yY][eE][sS]|[yY])+$ ]] && mail_error "${com_pipe_answer}" "IP ban: ${host}"
done
elif [[ ${com_pipe_answer} =~ .+-mailcow ]]; then
kill -STOP ${BACKGROUND_TASKS[*]}