rspamd: Use redis over a unix socket by default
Both rspamd and redis run on the same host by default, so a UNIX domain socket is the cheapest way to facilitate that communication. It also allows us to get rid of overly complicated IP adddress parsing logic, that we can shift onto the user if they need it.
This commit is contained in:
parent
7bdf5003c7
commit
745c6ee861
3 changed files with 22 additions and 21 deletions
|
@ -42,7 +42,11 @@ in
|
|||
extended_spam_headers = true;
|
||||
''; };
|
||||
"redis.conf" = { text = ''
|
||||
servers = "${cfg.redis.address}:${toString cfg.redis.port}";
|
||||
servers = "${if cfg.redis.port == null
|
||||
then
|
||||
cfg.redis.address
|
||||
else
|
||||
"${cfg.redis.address}:${toString cfg.redis.port}"}";
|
||||
'' + (lib.optionalString (cfg.redis.password != null) ''
|
||||
password = "${cfg.redis.password}";
|
||||
''); };
|
||||
|
@ -113,14 +117,12 @@ in
|
|||
|
||||
};
|
||||
|
||||
services.redis.servers.rspamd = {
|
||||
enable = lib.mkDefault true;
|
||||
port = lib.mkDefault 6380;
|
||||
};
|
||||
services.redis.servers.rspamd.enable = lib.mkDefault true;
|
||||
|
||||
systemd.services.rspamd = {
|
||||
requires = [ "redis-rspamd.service" ] ++ (lib.optional cfg.virusScanning "clamav-daemon.service");
|
||||
after = [ "redis-rspamd.service" ] ++ (lib.optional cfg.virusScanning "clamav-daemon.service");
|
||||
serviceConfig.SupplementaryGroups = [ config.services.redis.servers.rspamd.group ];
|
||||
};
|
||||
|
||||
systemd.services.rspamd-dmarc-reporter = lib.optionalAttrs (cfg.dmarcReporting.enable) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue