refactor(reverse-proxy): use endpoints for deployed routes
This commit was merged in pull request #53.
This commit is contained in:
27
flake.nix
27
flake.nix
@@ -150,24 +150,24 @@
|
|||||||
|
|
||||||
reverse-proxy-actualbudget-guest-route =
|
reverse-proxy-actualbudget-guest-route =
|
||||||
let
|
let
|
||||||
testConfig =
|
testConfig = self.nixosConfigurations.pikachu.config;
|
||||||
(self.nixosConfigurations.pikachu.extendModules {
|
|
||||||
modules = [
|
|
||||||
{
|
|
||||||
guests.actualbudget.reverseProxy = {
|
|
||||||
enable = true;
|
|
||||||
host = "budget.alexion.dev";
|
|
||||||
backend = "http://10.23.20.42:5006";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}).config;
|
|
||||||
route = testConfig.modules.reverse-proxy.routes.actualbudget;
|
route = testConfig.modules.reverse-proxy.routes.actualbudget;
|
||||||
|
vhost = testConfig.containers.reverse-proxy.config.services.nginx.virtualHosts."budget.alexion.dev";
|
||||||
in
|
in
|
||||||
pkgs.runCommand "reverse-proxy-actualbudget-guest-route-check" { } ''
|
pkgs.runCommand "reverse-proxy-actualbudget-guest-route-check" { } ''
|
||||||
${
|
${
|
||||||
lib.optionalString (
|
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"
|
) "exit 1"
|
||||||
}
|
}
|
||||||
touch $out
|
touch $out
|
||||||
@@ -261,6 +261,7 @@
|
|||||||
&& fleetRoutes ? pikachu-actualbudget
|
&& fleetRoutes ? pikachu-actualbudget
|
||||||
&& vhosts."worker.alexion.dev".locations."/".proxyPass == "http://10.23.20.126:3923"
|
&& 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."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"
|
) "exit 1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,10 +79,11 @@
|
|||||||
vlan = 20;
|
vlan = 20;
|
||||||
mac = "BC:24:11:C1:CD:28";
|
mac = "BC:24:11:C1:CD:28";
|
||||||
dataPath = "/pikachu/data/actualbudget";
|
dataPath = "/pikachu/data/actualbudget";
|
||||||
|
endpoint.address = "10.23.20.42";
|
||||||
reverseProxy = {
|
reverseProxy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = "budget.alexion.dev";
|
host = "budget.alexion.dev";
|
||||||
backend = "http://10.23.20.42:5006";
|
port = 5006;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -97,10 +98,11 @@
|
|||||||
vlan = 20;
|
vlan = 20;
|
||||||
mac = "02:23:20:39:23:01";
|
mac = "02:23:20:39:23:01";
|
||||||
statePath = "/pikachu/data/copyparty";
|
statePath = "/pikachu/data/copyparty";
|
||||||
|
endpoint.address = "10.23.20.126";
|
||||||
reverseProxy = {
|
reverseProxy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
host = "files.alexion.dev";
|
host = "files.alexion.dev";
|
||||||
backend = "http://10.23.20.126:3923";
|
port = 3923;
|
||||||
};
|
};
|
||||||
volumes = {
|
volumes = {
|
||||||
"/inbox" = {
|
"/inbox" = {
|
||||||
|
|||||||
Reference in New Issue
Block a user