refactor(reverse-proxy): use endpoints for deployed routes #53

Merged
alexion merged 1 commits from impl/migrate-routes-to-endpoints into main 2026-08-22 13:26:55 -04:00
2 changed files with 18 additions and 15 deletions

View File

@@ -150,24 +150,24 @@
reverse-proxy-actualbudget-guest-route =
let
testConfig =
(self.nixosConfigurations.pikachu.extendModules {
modules = [
{
guests.actualbudget.reverseProxy = {
enable = true;
host = "budget.alexion.dev";
backend = "http://10.23.20.42:5006";
};
}
];
}).config;
testConfig = self.nixosConfigurations.pikachu.config;
route = testConfig.modules.reverse-proxy.routes.actualbudget;
vhost = testConfig.containers.reverse-proxy.config.services.nginx.virtualHosts."budget.alexion.dev";
in
pkgs.runCommand "reverse-proxy-actualbudget-guest-route-check" { } ''
${
lib.optionalString (
!(route.host == "budget.alexion.dev" && route.backend == "http://10.23.20.42:5006")
!(
route.host == "budget.alexion.dev"
&& route.backend == null
&& route.endpoint == "pikachu-actualbudget"
&& route.port == 5006
&& route.tls
&& route.aliases == [ ]
&& route.path == "/"
&& !route.websockets
&& vhost.locations."/".proxyPass == "http://10.23.20.42:5006"
)
) "exit 1"
}
touch $out
@@ -261,6 +261,7 @@
&& fleetRoutes ? pikachu-actualbudget
&& vhosts."worker.alexion.dev".locations."/".proxyPass == "http://10.23.20.126:3923"
&& vhosts."budget.alexion.dev".locations."/".proxyPass == "http://10.23.20.42:5006"
&& vhosts."files.alexion.dev".locations."/".proxyPass == "http://10.23.20.126:3923"
)
) "exit 1"
}

View File

@@ -79,10 +79,11 @@
vlan = 20;
mac = "BC:24:11:C1:CD:28";
dataPath = "/pikachu/data/actualbudget";
endpoint.address = "10.23.20.42";
reverseProxy = {
enable = true;
host = "budget.alexion.dev";
backend = "http://10.23.20.42:5006";
port = 5006;
};
};
@@ -97,10 +98,11 @@
vlan = 20;
mac = "02:23:20:39:23:01";
statePath = "/pikachu/data/copyparty";
endpoint.address = "10.23.20.126";
reverseProxy = {
enable = true;
host = "files.alexion.dev";
backend = "http://10.23.20.126:3923";
port = 3923;
};
volumes = {
"/inbox" = {