Added extraAllowedIps to transmission

This commit is contained in:
rasmus-kirk
2024-03-15 14:51:04 +01:00
parent dd2fa602e3
commit 9d7c6c5ea4
+14 -2
View File
@@ -94,6 +94,17 @@ in {
description = "Open firewall for `peer-port` and `rpc-port`.";
};
extraAllowedIps = mkOption {
type = with types; listOf str;
default = [];
example = [ "10.19.5.10" ];
description = ''
Extra IP addresses allowed to access the Transmission RPC. By default
`192.168.*` and `127.0.0.1` (localhost) are allowed, but if your
local network has a weird ip for some reason, you can add it here.
'';
};
vpn.enable = mkOption {
type = types.bool;
default = false;
@@ -320,9 +331,10 @@ in {
then "192.168.15.1"
else "127.0.0.1";
rpc-port = cfg.uiPort;
# TODO: fix this for ssh tunneling...
rpc-whitelist-enabled = true;
rpc-whitelist = "127.0.0.1,192.168.*";
rpc-whitelist = strings.concatStringsSep "," ([
"127.0.0.1,192.168.*" # Defaults
] ++ cfg.extraAllowedIps);
rpc-authentication-required = false;
blocklist-enabled = true;