Compare commits

..

No commits in common. "8c0db938fce787ff2ac63202daaf368c04d41b20" and "4cad9120d6a384a00b0a9cfbe7f714090f0af782" have entirely different histories.

2 changed files with 26 additions and 1 deletions

View file

@ -2,13 +2,17 @@
{ {
services.fail2ban = { services.fail2ban = {
enable = true; enable = true;
maxretry = 5;
bantime = "1h";
bantime-increment = { bantime-increment = {
enable = true; enable = true;
maxtime = "168h"; maxtime = "168h";
overalljails = true; overalljails = true;
}; };
ignoreIP = [ "127.0.0.1/8" "::1" ];
jails = { jails = {
# SSH jail auto-created by NixOS — just tighten the limits
sshd.settings = { sshd.settings = {
maxretry = 3; maxretry = 3;
findtime = "15m"; findtime = "15m";
@ -20,13 +24,34 @@
filter = "forgejo"; filter = "forgejo";
backend = "systemd"; backend = "systemd";
journalmatch = "_SYSTEMD_UNIT=forgejo.service"; journalmatch = "_SYSTEMD_UNIT=forgejo.service";
maxretry = 5;
findtime = "10m";
};
caddy-status.settings = {
enabled = true;
port = "http,https";
filter = "caddy-status";
backend = "systemd";
journalmatch = "_SYSTEMD_UNIT=caddy.service";
maxretry = 10;
findtime = "10m";
}; };
}; };
}; };
# Each virtualHost already has a `log` block for access logging.
# The global `servers { logs }` directive was removed in Caddy 2.11.
environment.etc."fail2ban/filter.d/forgejo.conf".text = '' environment.etc."fail2ban/filter.d/forgejo.conf".text = ''
[Definition] [Definition]
failregex = ^.*Failed authentication attempt for .* from <HOST> failregex = ^.*Failed authentication attempt for .* from <HOST>
ignoreregex = ignoreregex =
''; '';
environment.etc."fail2ban/filter.d/caddy-status.conf".text = ''
[Definition]
failregex = ^.*"client_ip":"<HOST>".*"status":\s*(401|403)
ignoreregex =
'';
} }

View file

@ -14,7 +14,7 @@
}; };
virtualisation.oci-containers.containers.uptime-kuma = { virtualisation.oci-containers.containers.uptime-kuma = {
image = "louislam/uptime-kuma:2.2.1"; image = "louislam/uptime-kuma:2";
podman.user = "podman"; podman.user = "podman";
volumes = [ volumes = [
"/srv/uptime-kuma/data:/app/data" "/srv/uptime-kuma/data:/app/data"