Compare commits

..

2 Commits

Author SHA1 Message Date
8446bf9516 fix(reverse-proxy): reject unmatched HTTPS hosts 2026-08-17 21:56:08 -04:00
3fca42147d feat(reverse-proxy): collect fleet routes 2026-08-17 21:56:08 -04:00
3 changed files with 13 additions and 12 deletions

View File

@@ -189,7 +189,7 @@
}
];
};
fleetRoutes = self.lib.reverseProxyRoutes.collectFleetRoutes {
fleetRoutes = self.lib.collectReverseProxyRoutes {
inherit routeHost;
pikachu = self.nixosConfigurations.pikachu;
};

View File

@@ -16,6 +16,15 @@ let
serviceIdentityRegistry = import ./service-identities.nix { inherit lib; };
reverseProxyRoutes = import ./reverse-proxy-routes.nix { inherit lib; };
collectReverseProxyRoutes =
hosts:
lib.concatMapAttrs (
hostName: host:
lib.mapAttrs' (
routeName: route: lib.nameValuePair "${hostName}-${routeName}" route
) host.config.modules.reverse-proxy.routes
) hosts;
collectNixFiles =
dir:
flatten (
@@ -36,7 +45,7 @@ let
specialArgs = {
inherit inputs self;
my = self.lib;
reverseProxyFleetRoutes = self.lib.reverseProxyRoutes.collectFleetRoutes self.nixosConfigurations;
reverseProxyFleetRoutes = self.lib.collectReverseProxyRoutes self.nixosConfigurations;
};
bridgeName = id: "br-vlan${toString id}";
@@ -85,6 +94,7 @@ in
mkHost
mkHosts
bridgeName
collectReverseProxyRoutes
reverseProxyRoutes
;

View File

@@ -64,18 +64,9 @@ let
websockets
;
};
collectFleetRoutes =
hosts:
lib.concatMapAttrs (
hostName: host:
lib.mapAttrs' (
routeName: route: lib.nameValuePair "${hostName}-${routeName}" route
) host.config.modules.reverse-proxy.routes
) hosts;
in
{
inherit collectFleetRoutes mkRouteOptions routeFields;
inherit mkRouteOptions routeFields;
routeType = lib.types.submodule (
{ name, ... }: