mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-11 17:54:08 -05:00
* Nginx to caddy (#5) Convert all nginx instances to caddy instances, setup acme as well * matrix implemented
24 lines
774 B
Nix
24 lines
774 B
Nix
{
|
|
inputs,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
environment.etc = {
|
|
# Define an action that will trigger a Ntfy push notification upon the issue of every new ban
|
|
"fail2ban/action.d/ntfy.local".text = pkgs.lib.mkDefault (pkgs.lib.mkAfter ''
|
|
[Definition]
|
|
norestored = true # Needed to avoid receiving a new notification after every restart
|
|
actionban = curl -H "Title: <ip> has been banned" -d "<name> jail has banned <ip> from accessing ${config.hostSpec.hostName} after <failures> attempts of attacking the system." https://notify.wanderingcrow.net/Fail2banNotifications
|
|
'');
|
|
};
|
|
services.fail2ban = {
|
|
enable = true;
|
|
extraPackages = [
|
|
pkgs.curl
|
|
];
|
|
ignoreIP = [
|
|
inputs.nix-secrets.network.primary.publicIP
|
|
];
|
|
};
|
|
}
|