This commit is contained in:
mjallen18
2025-08-23 10:26:12 -05:00
parent a96b8ddf86
commit bc18b0775b
43 changed files with 796 additions and 177 deletions

View File

@@ -58,11 +58,9 @@ in
[ "${script}/bin/register-bouncer" ];
};
networking = {
firewall = {
allowedTCPPorts = [ cfg.port ];
allowedUDPPorts = [ cfg.port ];
};
networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ cfg.port ];
allowedUDPPorts = [ cfg.port ];
};
};
}

View File

@@ -5,23 +5,33 @@ with lib;
enable = mkEnableOption "crowdsec service";
port = mkOption {
type = types.int;
type = types.port;
default = 9898;
description = "Port for crowdsec API";
};
openFirewall = mkOption {
type = types.bool;
default = true;
description = "Whether to open firewall for crowdsec";
};
apiAddress = mkOption {
type = types.str;
default = "127.0.0.1";
description = "API address for crowdsec";
};
apiKey = mkOption {
type = types.str;
default = "";
description = "API key for crowdsec bouncer";
};
dataDir = mkOption {
type = types.str;
default = "";
description = "Data directory for crowdsec";
};
};
}