add fail2ban

This commit is contained in:
xqtc 2024-07-17 13:01:09 +02:00
parent 21ebbdf59c
commit 55ae36e017
4 changed files with 35 additions and 20 deletions

View file

@ -89,11 +89,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1721102596, "lastModified": 1721188984,
"narHash": "sha256-NwkxySooO4c+0AmWz+199HKB7cyZAOuzdqwDyYYJrow=", "narHash": "sha256-muLvm4TcNtZtbC71vWpJT84do8xxcX2JDbwZ/GBCbIM=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "2004d4c0218505901d8fad29948f1a1191f658f6", "rev": "fe4e311097bb57450231e603d7a99f96d147e456",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -344,11 +344,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720734513, "lastModified": 1721135958,
"narHash": "sha256-neWQ8eNtLTd+YMesb7WjKl1SVCbDyCm46LUgP/g/hdo=", "narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "90ae324e2c56af10f20549ab72014804a3064c7f", "rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -419,11 +419,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1720270372, "lastModified": 1721151247,
"narHash": "sha256-G5iteuo2gobI0Y5jHNEBc6UN9ixjwj6zopPKi7bJBE4=", "narHash": "sha256-m6LmfrUMpt1ZUX3eqB7Gp+ZV6sAWPqkATwZNvA7Bj9U=",
"owner": "viperML", "owner": "viperML",
"repo": "nh", "repo": "nh",
"rev": "7f8a1859ed6ea971fcf49b07ca8938e3000c3af4", "rev": "168c7ceea2b8d6208cf32de9eb8effa9c008b40d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -544,11 +544,11 @@
}, },
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1721124769, "lastModified": 1721210484,
"narHash": "sha256-TsPEod+7+A2LqUb/8oZCGFx67BBqBmNfxPzkMXUhIy0=", "narHash": "sha256-QppHmSS4JGlKHuZku1M8rvkUcosi8GRSrWa/hFAzF80=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "69367538edc76e4b7fc27e68cf66f03a37ccdfa0", "rev": "e5e12391d9dd8a351562938b6cf3fa215a34a2ac",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -592,16 +592,16 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1719663039, "lastModified": 1720954236,
"narHash": "sha256-tXlrgAQygNIy49LDVFuPXlWD2zTQV9/F8pfoqwwPJyo=", "narHash": "sha256-1mEKHp4m9brvfQ0rjCca8P1WHpymK3TOr3v34ydv9bs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4a1e673523344f6ccc84b37f4413ad74ea19a119", "rev": "53e81e790209e41f0c1efa9ff26ff2fd7ab35e27",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-23.11", "ref": "nixos-24.05",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -12,6 +12,7 @@ with lib; {
./jellyfin.nix ./jellyfin.nix
./calibre-web.nix ./calibre-web.nix
./transmission.nix ./transmission.nix
./fail2ban.nix
./lanrarari.nix ./lanrarari.nix
./uptime.nix ./uptime.nix
./networking.nix ./networking.nix

View file

@ -0,0 +1,14 @@
{config, lib, ...}:
{
services.fail2ban = {
enable = true;
maxretry = 3;
bantime-increment = {
enable = true;
formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";
# multipliers = "1 2 4 8 16 32 64";
maxtime = "336h";
overalljails = true;
};
};
}

View file

@ -56,13 +56,13 @@
(config.services.nextcloud.package.packages.apps) (config.services.nextcloud.package.packages.apps)
contacts contacts
calendar calendar
notes # notes
previewgenerator
previewgenerator
; ;
recognize = pkgs.fetchNextcloudApp { recognize = pkgs.fetchNextcloudApp {
sha256 = "sha256-hg8uY7cvdYnmEh6vKC36vkORDC+MSZA8lFqGQK2RbkE="; sha256 = "sha256-7qp9UbUcMwBNdGixaR0BAigMAtlyCAN39WxqHbsFVGE=";
url = "https://github.com/nextcloud/recognize/releases/download/v7.0.2/recognize-7.0.2.tar.gz"; url = "https://github.com/nextcloud/recognize/releases/download/v7.0.0/recognize-7.0.0.tar.gz";
license = "agpl3Only"; license = "agpl3Only";
}; };
}; };