Open firewall ports

This commit is contained in:
niten 2023-09-28 12:31:03 -07:00
parent 41f5cf4c26
commit a5ed6cc504
4 changed files with 237 additions and 222 deletions

View File

@ -35,6 +35,12 @@ in {
}; };
}; };
networking.firewall = {
enable = true;
allowedTCPPorts = [ cfg.port ];
allowedUDPPorts = [ cfg.port ];
};
systemd.tmpfiles.rules = systemd.tmpfiles.rules =
[ "d ${cfg.state-directory} 0750 clamav clamav - -" ]; [ "d ${cfg.state-directory} 0750 clamav clamav - -" ];

View File

@ -75,6 +75,12 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall = {
enable = true;
allowedTCPPorts = [ cfg.port ];
allowedUDPPorts = [ cfg.port ];
};
services.opendkim = { services.opendkim = {
enable = true; enable = true;
selector = cfg.selector; selector = cfg.selector;

View File

@ -412,11 +412,6 @@ in {
imports = [ ./rspamd.nix ]; imports = [ ./rspamd.nix ];
boot.tmp.useTmpfs = true; boot.tmp.useTmpfs = true;
system.nssModules = lib.mkForce [ ]; system.nssModules = lib.mkForce [ ];
networking.firewall = {
enable = true;
allowedTCPPorts = [ metricsPort antispamPort ];
allowedUDPPorts = [ antispamPort ];
};
fudo.mail.rspamd = { fudo.mail.rspamd = {
enable = true; enable = true;
ports = { ports = {

View File

@ -45,13 +45,20 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
services.prometheus.exporters.rspamd = { networking.firewall = {
enable = true;
allowedTCPPorts = with cfg.ports; [ metrics controller milter ];
allowedUDPPorts = with cfg.ports; [ controller milter ];
};
services = {
prometheus.exporters.rspamd = {
enable = true; enable = true;
listenAddress = "127.0.0.1"; listenAddress = "127.0.0.1";
port = cfg.ports.metrics; port = cfg.ports.metrics;
}; };
services.rspamd = { rspamd = {
enable = true; enable = true;
locals = { locals = {
@ -277,4 +284,5 @@ in {
}; };
}; };
}; };
};
} }