nixos: services: audiobookshelf: add fail2ban jail

This commit is contained in:
Bruno BELANYI 2024-09-22 01:10:52 +02:00
parent cedac6bbf4
commit f24cf2e16d

View file

@ -35,5 +35,21 @@ in
};
};
};
services.fail2ban.jails = {
audiobookshelf = ''
enabled = true
filter = audiobookshelf
port = http,https
'';
};
environment.etc = {
"fail2ban/filter.d/audiobookshelf.conf".text = ''
[Definition]
failregex = ^.*ERROR: \[Auth\] Failed login attempt for username ".*" from ip <ADDR>
journalmatch = _SYSTEMD_UNIT=audiobookshelf.service
'';
};
};
}