fail2ban: fix config; forgejo: repository path and persistency

This commit is contained in:
William 2025-11-09 16:57:17 -03:00
parent 5906fa6f36
commit 8e491dbe5e
3 changed files with 15 additions and 31 deletions

View file

@ -12,7 +12,6 @@
"192.168.0.0/16"
"100.64.0.0/10"
];
bantime = "1h";
bantime-increment = {
enable = true;
@ -20,24 +19,5 @@
maxtime = "10000h";
overalljails = true;
};
jails.forgejo = {
settings = {
enabled = true;
filter = "forgejo";
backend = "systemd";
maxretry = 10;
findtime = "1h";
bantime = "15m";
};
};
};
# Custom fail2ban filter for Forgejo using systemd journal
environment.etc."fail2ban/filter.d/forgejo.local".text = pkgs.lib.mkDefault (pkgs.lib.mkAfter ''
[Definition]
journalmatch = _SYSTEMD_UNIT=forgejo.service
failregex = Failed authentication attempt for .+ from <HOST>:\d+:
ignoreregex =
'');
}