Add option for docker subnet for netbird webproxy network

The same subnet on different routing peers makes problems for the
reverse proxy feature. Therefore add the possibility to set a different
subnet on different hosts.
This commit is contained in:
JuliusFreudenberger 2026-05-21 00:47:36 +02:00
parent b6e7e0a7dc
commit 3a0fe99688

View file

@ -37,6 +37,11 @@ in {
description = "Configuration for docker connection"; description = "Configuration for docker connection";
type = clientConfiguration; type = clientConfiguration;
}; };
dockerSubnet = lib.mkOption {
description = "Second part of ipv4 subnet";
type = lib.types.str;
default = "20";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -94,7 +99,7 @@ in {
Type = "oneshot"; Type = "oneshot";
}; };
script = '' script = ''
docker network inspect webproxy || docker network create webproxy --ipv4 --ipv6 --subnet=172.20.0.0/16 --gateway=172.20.0.1 docker network inspect webproxy || docker network create webproxy --ipv4 --ipv6 --subnet=172.${cfg.dockerSubnet}.0.0/16 --gateway=172.${cfg.dockerSubnet}.0.1
''; '';
}; };
}; };