Linux/Nextcloud: Difference between revisions
< Linux
(Die Seite wurde neu angelegt: „ == Cron == * /etc/cron.d/nextcloud <blockquote> <pre> # m h dom mon dow user command */5 * * * * root /bin/bash /sr…“) |
No edit summary |
||
Line 1: | Line 1: | ||
== fail2ban == | |||
* /etc/fail2ban/filter.d/nextcloud.conf | |||
<blockquote> | |||
<pre> | |||
[Definition] | |||
failregex=^{"reqId":".*","remoteAddr":".*","app":"core","message":"Login failed: '.*' \(Remote IP: '<HOST>'\)","level":2,"time":".*"}$ | |||
^{"reqId":".*","level":2,"time":".*","remoteAddr":".*","user,:".*","app":"no app in context".*","method":".*","message":"Login failed: '.*' \(Remote IP: '<HOST>'\)".*}$ | |||
^{"reqId":".*","level":2,"time":".*","remoteAddr":".*","user":".*","app":".*","method":".*","url":".*","message":"Login failed: .* \(Remote IP: <HOST>\).*}$ | |||
</pre> | |||
</blockquote> | |||
* /etc/fail2ban/jail.d/nextcloud.local | |||
<blockquote> | |||
<pre> | |||
[nextcloud] | |||
backend = auto | |||
enabled = true | |||
port = 80,443 | |||
protocol = tcp | |||
filter = nextcloud | |||
maxretry = 10 | |||
bantime = 3600 | |||
findtime = 36000 | |||
logpath = /srv/docker-data/nextcloud/html/data/nextcloud.log | |||
</pre> | |||
</blockquote> | |||
Latest revision as of 15:47, 29 July 2020
fail2ban
- /etc/fail2ban/filter.d/nextcloud.conf
[Definition] failregex=^{"reqId":".*","remoteAddr":".*","app":"core","message":"Login failed: '.*' \(Remote IP: '<HOST>'\)","level":2,"time":".*"}$ ^{"reqId":".*","level":2,"time":".*","remoteAddr":".*","user,:".*","app":"no app in context".*","method":".*","message":"Login failed: '.*' \(Remote IP: '<HOST>'\)".*}$ ^{"reqId":".*","level":2,"time":".*","remoteAddr":".*","user":".*","app":".*","method":".*","url":".*","message":"Login failed: .* \(Remote IP: <HOST>\).*}$
- /etc/fail2ban/jail.d/nextcloud.local
[nextcloud] backend = auto enabled = true port = 80,443 protocol = tcp filter = nextcloud maxretry = 10 bantime = 3600 findtime = 36000 logpath = /srv/docker-data/nextcloud/html/data/nextcloud.log
Cron
- /etc/cron.d/nextcloud
# m h dom mon dow user command */5 * * * * root /bin/bash /srv/docker-config/nextcloud/run_cronjob.sh
- /srv/docker-config/nextcloud/run_cronjob.sh
docker exec -u www-data nextcloud_app_1 php cron.php