feat: auto forward ports and open firewall

This commit is contained in:
Katharina Heidenreich 2026-03-16 19:05:55 +01:00
parent b166c58127
commit 44d2263bdf
4 changed files with 20 additions and 13 deletions

View file

@ -95,4 +95,13 @@ rec {
dnsMappings = lib.filterAttrs _predOnlyLocalObjs _dnsMappingObjects;
reverse_proxy = lib.filterAttrs (name: value: value ? reverse_proxy) services;
_portsUsedInService = (service: if service ? reverse_proxy
then if service.reverse_proxy ? listen
then map (obj: obj.port) service.reverse_proxy.listen
else if service.reverse_proxy ? ssl && service.reverse_proxy.ssl
then [80 443]
else [80]
else [80]);
usedPorts = lib.unique (lib.concatLists (map _portsUsedInService (builtins.attrValues services)));
}