Fix fail2ban install without Nginx
This commit is contained in:
@@ -15,11 +15,11 @@ export LANG='en_US.UTF-8'
|
|||||||
export LC_ALL='C.UTF-8'
|
export LC_ALL='C.UTF-8'
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
{
|
{
|
||||||
apt-get -qq purge mysql* graphviz* redis* php73-* php-*
|
apt-get -qq purge mysql* graphviz* redis* php73-* php-*
|
||||||
apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree
|
apt-get install -qq git python3-setuptools python3-dev python3-apt ccze tree
|
||||||
sudo apt-get -qq autoremove --purge
|
sudo apt-get -qq autoremove --purge
|
||||||
} > /dev/null 2>&1
|
} >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit_script() {
|
exit_script() {
|
||||||
@@ -349,3 +349,18 @@ for stack in $stack_purge; do
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
|
echo -e ' wo stack fail2ban '
|
||||||
|
echo -e "${CGREEN}#############################################${CEND}"
|
||||||
|
if {
|
||||||
|
wo stack install --fail2ban
|
||||||
|
} >>/var/log/wo/test.log; then
|
||||||
|
echo -ne " purging $stack [${CGREEN}OK${CEND}]\\r"
|
||||||
|
echo -ne '\n'
|
||||||
|
else
|
||||||
|
echo -e " purging $stack [${CRED}FAIL${CEND}]"
|
||||||
|
echo -ne '\n'
|
||||||
|
exit_script
|
||||||
|
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1042,7 +1042,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
|||||||
WOGit.add(self, ["/etc/fail2ban"],
|
WOGit.add(self, ["/etc/fail2ban"],
|
||||||
msg="Adding Fail2ban into Git")
|
msg="Adding Fail2ban into Git")
|
||||||
Log.info(self, "Configuring Fail2Ban")
|
Log.info(self, "Configuring Fail2Ban")
|
||||||
data = dict(release=WOVar.wo_version)
|
nginxf2b = bool(os.path.exists('/var/log/nginx'))
|
||||||
|
data = dict(release=WOVar.wo_version, nginx=nginxf2b)
|
||||||
WOTemplate.deploy(
|
WOTemplate.deploy(
|
||||||
self,
|
self,
|
||||||
'/etc/fail2ban/jail.d/custom.conf',
|
'/etc/fail2ban/jail.d/custom.conf',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ ignoreip = 127.0.0.1/8 ::1
|
|||||||
[recidive]
|
[recidive]
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
||||||
[nginx-http-auth]
|
{{#nginx}}[nginx-http-auth]
|
||||||
enabled = true
|
enabled = true
|
||||||
logpath = /var/log/nginx/*error*.log
|
logpath = /var/log/nginx/*error*.log
|
||||||
|
|
||||||
@@ -23,4 +23,4 @@ maxretry = 5
|
|||||||
enabled = true
|
enabled = true
|
||||||
filter = nginx-forbidden
|
filter = nginx-forbidden
|
||||||
action = iptables-multiport[name="nginx-forbidden", port="http,https"]
|
action = iptables-multiport[name="nginx-forbidden", port="http,https"]
|
||||||
logpath = /var/log/nginx/*error*.log
|
logpath = /var/log/nginx/*error*.log{{/nginx}}
|
||||||
Reference in New Issue
Block a user