From 7ca15a7198a5c66cba0bebe70eaef1943d523fa9 Mon Sep 17 00:00:00 2001 From: Elian Loraux <elian.loraux@tetras-libre.fr> Date: Mon, 28 Apr 2025 09:59:23 +0200 Subject: [PATCH 1/3] variable for max retry traefik, 15 by default --- main.env.sample | 4 ++++ upgrade/traefik_fail2ban.sh | 1 + 2 files changed, 5 insertions(+) diff --git a/main.env.sample b/main.env.sample index 0c093ac..2b12124 100644 --- a/main.env.sample +++ b/main.env.sample @@ -36,6 +36,10 @@ export NEXTCLOUD_DATABASE_NAME="nextcloud" # Week for logrotate, by default 4 week export LOGROTATE=4 +# Fail2ban variables +# maxretry for traefik jail for fail2ban +export FAIL2BAN_TRAEFIK_MAXRETRY=15 # 15 by default + # Monit variables # CPU and RAM overload time is in monit cycle. 1 cycle = 2 minutes export CPU_OVERLOAD_TIME=30 # 1h by default diff --git a/upgrade/traefik_fail2ban.sh b/upgrade/traefik_fail2ban.sh index 79206d2..64e5cdf 100644 --- a/upgrade/traefik_fail2ban.sh +++ b/upgrade/traefik_fail2ban.sh @@ -5,6 +5,7 @@ cat <<EOF > /etc/fail2ban/jail.d/nocloud_traefik.conf enabled = true logpath = /home/dockerweb/traefik/log/access.log chain = DOCKER-USER +maxretry = ${FAIL2BAN_TRAEFIK_MAXRETRY:-15} mode = aggressive findtime = 4h banaction = docker-page -- GitLab From 09ead9ff4aa3dfd2e490498633979f2cbc42fb4b Mon Sep 17 00:00:00 2001 From: Elian Loraux <elian.loraux@tetras-libre.fr> Date: Mon, 28 Apr 2025 10:02:03 +0200 Subject: [PATCH 2/3] source env --- upgrade/traefik_fail2ban.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/upgrade/traefik_fail2ban.sh b/upgrade/traefik_fail2ban.sh index 64e5cdf..ad8ebd0 100644 --- a/upgrade/traefik_fail2ban.sh +++ b/upgrade/traefik_fail2ban.sh @@ -1,5 +1,15 @@ #!/bin/bash +DIR=$(realpath $(dirname $0)/..) +if [ ! -e $DIR/main.env ] +then + echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + exit 1 +else + echo "Environment file loaded" +fi +. $DIR/main.env + cat <<EOF > /etc/fail2ban/jail.d/nocloud_traefik.conf [traefik-auth] enabled = true -- GitLab From d471552351e37ef7dcf31537fe9d90655ef24e69 Mon Sep 17 00:00:00 2001 From: Elian Loraux <elian.loraux@tetras-libre.fr> Date: Mon, 28 Apr 2025 11:31:12 +0200 Subject: [PATCH 3/3] replace "racine" to "root" --- checks/backups.sh | 2 +- install/AptCacher.sh | 2 +- install/Base.sh | 2 +- install/Certbot.sh | 2 +- install/Collabora.sh | 2 +- install/Dolibarr.sh | 2 +- install/Monit.sh | 2 +- install/MySQL.sh | 2 +- install/Nextcloud.sh | 2 +- install/OnlyOffice.sh | 2 +- install/TetrasBack.sh | 2 +- install/Traefik.sh | 2 +- install/WebServer.sh | 2 +- upgrade/All.sh | 2 +- upgrade/Backups.sh | 2 +- upgrade/Collabora.sh | 2 +- upgrade/Dolibarr.sh | 2 +- upgrade/Monit.sh | 2 +- upgrade/Traefik.sh | 2 +- upgrade/WebServer.sh | 2 +- upgrade/traefik_fail2ban.sh | 2 +- utils/attestDolibarr.sh | 2 +- utils/getIgnoreIp.sh | 2 +- utils/startcollabora.sh | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/checks/backups.sh b/checks/backups.sh index e435f4b..6bcd606 100644 --- a/checks/backups.sh +++ b/checks/backups.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/AptCacher.sh b/install/AptCacher.sh index 92556bd..cc6c298 100755 --- a/install/AptCacher.sh +++ b/install/AptCacher.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/Base.sh b/install/Base.sh index 83ca18b..3e1de20 100644 --- a/install/Base.sh +++ b/install/Base.sh @@ -23,7 +23,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/Certbot.sh b/install/Certbot.sh index c18529e..e3c6219 100755 --- a/install/Certbot.sh +++ b/install/Certbot.sh @@ -21,7 +21,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/Collabora.sh b/install/Collabora.sh index 83a5b68..292954e 100644 --- a/install/Collabora.sh +++ b/install/Collabora.sh @@ -23,7 +23,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/Dolibarr.sh b/install/Dolibarr.sh index c708ad4..db1c491 100644 --- a/install/Dolibarr.sh +++ b/install/Dolibarr.sh @@ -23,7 +23,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/Monit.sh b/install/Monit.sh index f2b01f0..be46b82 100644 --- a/install/Monit.sh +++ b/install/Monit.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/MySQL.sh b/install/MySQL.sh index 2c47f22..aca3fc1 100644 --- a/install/MySQL.sh +++ b/install/MySQL.sh @@ -23,7 +23,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/Nextcloud.sh b/install/Nextcloud.sh index 4472daf..de20675 100644 --- a/install/Nextcloud.sh +++ b/install/Nextcloud.sh @@ -23,7 +23,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/OnlyOffice.sh b/install/OnlyOffice.sh index 72378aa..7e22ec8 100644 --- a/install/OnlyOffice.sh +++ b/install/OnlyOffice.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/TetrasBack.sh b/install/TetrasBack.sh index 50bb267..378ce48 100644 --- a/install/TetrasBack.sh +++ b/install/TetrasBack.sh @@ -25,7 +25,7 @@ set -o nounset # Treat unset variables as an error if [ ! -e $(pwd)/$(dirname "$0")/../main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 fi . $(pwd)/$(dirname "$0")/../main.env diff --git a/install/Traefik.sh b/install/Traefik.sh index 11fb6c7..fda6f17 100644 --- a/install/Traefik.sh +++ b/install/Traefik.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/install/WebServer.sh b/install/WebServer.sh index 958a7f5..300d89f 100644 --- a/install/WebServer.sh +++ b/install/WebServer.sh @@ -23,7 +23,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/All.sh b/upgrade/All.sh index e1ff825..925de35 100644 --- a/upgrade/All.sh +++ b/upgrade/All.sh @@ -22,7 +22,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/Backups.sh b/upgrade/Backups.sh index de60613..58d9184 100644 --- a/upgrade/Backups.sh +++ b/upgrade/Backups.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/Collabora.sh b/upgrade/Collabora.sh index f2eed93..65f87b0 100644 --- a/upgrade/Collabora.sh +++ b/upgrade/Collabora.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/Dolibarr.sh b/upgrade/Dolibarr.sh index 25d1b1c..eec51d5 100644 --- a/upgrade/Dolibarr.sh +++ b/upgrade/Dolibarr.sh @@ -21,7 +21,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/Monit.sh b/upgrade/Monit.sh index ada60aa..cc36823 100644 --- a/upgrade/Monit.sh +++ b/upgrade/Monit.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/Traefik.sh b/upgrade/Traefik.sh index 21fc6da..f0b8c65 100644 --- a/upgrade/Traefik.sh +++ b/upgrade/Traefik.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/WebServer.sh b/upgrade/WebServer.sh index 8b47d78..97dc049 100644 --- a/upgrade/WebServer.sh +++ b/upgrade/WebServer.sh @@ -5,7 +5,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/upgrade/traefik_fail2ban.sh b/upgrade/traefik_fail2ban.sh index ad8ebd0..5dedfe6 100644 --- a/upgrade/traefik_fail2ban.sh +++ b/upgrade/traefik_fail2ban.sh @@ -3,7 +3,7 @@ DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/utils/attestDolibarr.sh b/utils/attestDolibarr.sh index 2f75062..d10fc80 100755 --- a/utils/attestDolibarr.sh +++ b/utils/attestDolibarr.sh @@ -4,7 +4,7 @@ echo "RUN $(basename "$0") ===" if [ ! -e $(dirname "$0")/../main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/utils/getIgnoreIp.sh b/utils/getIgnoreIp.sh index 1cff80a..32522b8 100644 --- a/utils/getIgnoreIp.sh +++ b/utils/getIgnoreIp.sh @@ -7,7 +7,7 @@ echo "RUN $(basename "$0") ===" DIR=$(realpath $(dirname $0)/..) if [ ! -e $DIR/main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" diff --git a/utils/startcollabora.sh b/utils/startcollabora.sh index 54654f4..bf7211e 100755 --- a/utils/startcollabora.sh +++ b/utils/startcollabora.sh @@ -4,7 +4,7 @@ echo "RUN $(basename "$0") ===" if [ ! -e $(dirname "$0")/../main.env ] then - echo "Please copy in racine of NoCloud Auto Installer main.env.sample to main.env and edit it" + echo "Please copy in root of NoCloud Auto Installer main.env.sample to main.env and edit it" exit 1 else echo "Environment file loaded" -- GitLab