Fix fail2ban install without Nginx
This commit is contained in:
@@ -1042,7 +1042,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
|
||||
WOGit.add(self, ["/etc/fail2ban"],
|
||||
msg="Adding Fail2ban into Git")
|
||||
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(
|
||||
self,
|
||||
'/etc/fail2ban/jail.d/custom.conf',
|
||||
|
||||
@@ -4,7 +4,7 @@ ignoreip = 127.0.0.1/8 ::1
|
||||
[recidive]
|
||||
enabled = true
|
||||
|
||||
[nginx-http-auth]
|
||||
{{#nginx}}[nginx-http-auth]
|
||||
enabled = true
|
||||
logpath = /var/log/nginx/*error*.log
|
||||
|
||||
@@ -23,4 +23,4 @@ maxretry = 5
|
||||
enabled = true
|
||||
filter = nginx-forbidden
|
||||
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