Nope...we need a password I guess

This commit is contained in:
niten 2023-10-16 11:54:32 -07:00
parent 2a1bc560e1
commit f07f164fe4
2 changed files with 17 additions and 26 deletions

View File

@ -254,6 +254,10 @@ in {
];
virtualisation.arion.projects.mail-server.settings = let
redisPasswdFile =
pkgs.lib.passwd.stablerandom-passwd-file "mail-server-redis-passwd"
config.instance.build-seed;
image = { pkgs, ... }: {
project.name = "mail-server";
networks = {
@ -435,6 +439,7 @@ in {
host = "antivirus";
port = antivirusPort;
};
redis.password = readFile redisPasswdFile;
};
};
};
@ -501,9 +506,9 @@ in {
system.nssModules = lib.mkForce [ ];
services.redis.servers."rspamd" = {
enable = true;
# null -> all
bind = null;
bind = null; # null -> all
port = redisPort;
requirePassFile = "/run/redis/passwd";
};
};
};

View File

@ -48,6 +48,11 @@ in {
type = port;
default = 6379;
};
password = mkOption {
type = str;
description = "Password with which to connect to Redis.";
};
};
};
@ -71,6 +76,11 @@ in {
locals = {
"milter_headers.conf".text = "extended_spam_headers = yes;";
"redis.conf".text = ''
servers = "${cfg.redis.host}:${toString cfg.redis.port}";
password = "${cfg.redis.password}";
'';
"antivirus.conf".text = ''
clamav {
action = "reject";
@ -95,17 +105,9 @@ in {
}
'';
"dmarc.conf".text = ''
dmarc = {
servers = "${cfg.redis.host}:${toString cfg.redis.port}";
}
'';
"mx_check.conf".text = ''
enabled = true;
servers = "${cfg.redis.host}:${toString cfg.redis.port}";
timeout = 10.0;
exclude_domains = [
@ -119,38 +121,22 @@ in {
ip_reputation = {
selector "ip" {
}
backend "redis" {
servers = "${cfg.redis.host}:${toString cfg.redis.port}";
}
symbol = "IP_REPUTATION";
}
spf_reputation = {
selector "spf" {
}
backend "redis" {
servers = "${cfg.redis.host}:${toString cfg.redis.port}";
}
symbol = "SPF_REPUTATION";
}
dkim_reputation = {
selector "dkim" {
}
backend "redis" {
servers = "${cfg.redis.host}:${toString cfg.redis.port}";
}
symbol = "DKIM_REPUTATION"; # Also adjusts scores for DKIM_ALLOW, DKIM_REJECT
}
generic_reputation = {
selector "generic" {
selector = "ip"; # see https://rspamd.com/doc/configuration/selectors.html
}
backend "redis" {
servers = "${cfg.redis.host}:${toString cfg.redis.port}";
}
symbol = "GENERIC_REPUTATION";
}
}