mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2025-05-04 17:50:51 +05:00
rspamd: add allowedIPs option
This commit is contained in:
parent
196b9b61e5
commit
0f1155b064
@ -100,6 +100,7 @@ example with `basic auth <https://docs.nginx.com/nginx/admin-guide/security-cont
|
|||||||
mailserver.rspamdWebUI = {
|
mailserver.rspamdWebUI = {
|
||||||
enable = true;
|
enable = true;
|
||||||
domain = "rspamd.example.com";
|
domain = "rspamd.example.com";
|
||||||
|
allowedIPs = [ "0.0.0.0" "::/0" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts."${config.mailserver.rspamdWebUI.domain}".basicAuthFile = "/basic/auth/hashes/file";
|
services.nginx.virtualHosts."${config.mailserver.rspamdWebUI.domain}".basicAuthFile = "/basic/auth/hashes/file";
|
||||||
|
@ -31,10 +31,18 @@ in
|
|||||||
example = true;
|
example = true;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable the rspamd web ui on the configured domain.
|
Whether to enable the rspamd web ui on the configured domain.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
:::warning
|
allowedIPs = lib.mkOption {
|
||||||
Make sure to configure authentication for it!
|
type = with lib.types; listOf str;
|
||||||
:::
|
default = [ ];
|
||||||
|
example = [ "0.0.0.0" "::/0" ];
|
||||||
|
description = ''
|
||||||
|
List of IPs from which the web ui will be reachable *without* authentication.
|
||||||
|
|
||||||
|
When using a reverse proxy like nginx and another authentication method like basic auth or oatuh2-proxy is implemented,
|
||||||
|
than this can be set to ``[ "0.0.0.0" "::/0" ]`` to solely rely on the other authentication method.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -69,10 +77,7 @@ in
|
|||||||
inherit debug;
|
inherit debug;
|
||||||
|
|
||||||
overrides = lib.mkIf cfg.rspamdWebUI.enable {
|
overrides = lib.mkIf cfg.rspamdWebUI.enable {
|
||||||
"worker-controller.inc".text = ''
|
"worker-controller.inc".text = lib.concatMapStringsSep "\n" (ip: ''secure_ip = "${ip}";'') cfg.rspamdWebUI.allowedIPs;
|
||||||
secure_ip = "0.0.0.0/0";
|
|
||||||
secure_ip = "::/0";
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
locals = {
|
locals = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user