Add maintence page support for remote nodes

This commit is contained in:
Owen
2026-06-13 21:45:52 -07:00
parent c6ddd5c402
commit 50da863bb7
4 changed files with 12 additions and 16 deletions

View File

@@ -527,7 +527,7 @@ export class TraefikConfigManager {
build == "saas"
? false
: config.getRawConfig().traefik.allow_raw_resources, // dont allow raw resources on saas otherwise use config
build != "oss", // generate maintenance pages on cloud and hybrid
build != "oss" ? browserGatewayUiUrl : null, // generate maintenance pages on cloud and hybrid
browserGatewayUiUrl // generate browser gateway targets on cloud and hybrid
);

View File

@@ -84,7 +84,7 @@ export async function getTraefikConfig(
filterOutNamespaceDomains = false,
generateLoginPageRouters = false,
allowRawResources = true,
allowMaintenancePage = true,
maintenancePageUiUrl: string | null = null,
browserGatewayUiUrl: string | null = null
): Promise<any> {
// Get resources with their targets and sites in a single optimized query
@@ -630,7 +630,7 @@ export async function getTraefikConfig(
}
}
if (showMaintenancePage && allowMaintenancePage) {
if (showMaintenancePage && maintenancePageUiUrl) {
const maintenanceServiceName = `${key}-maintenance-service`;
const maintenanceRouterName = `${key}-maintenance-router`;
const rewriteMiddlewareName = `${key}-maintenance-rewrite`;
@@ -646,15 +646,11 @@ export async function getTraefikConfig(
? `*.${domainParts.slice(1).join(".")}`
: fullDomain;
const maintenancePort = config.getRawConfig().server.next_port;
const maintenanceHost =
config.getRawConfig().server.internal_hostname;
config_output.http.services[maintenanceServiceName] = {
loadBalancer: {
servers: [
{
url: `http://${maintenanceHost}:${maintenancePort}`
url: maintenancePageUiUrl
}
],
passHostHeader: true
@@ -1119,7 +1115,7 @@ export async function getTraefikConfig(
}
}
if (showBgMaintenancePage && allowMaintenancePage) {
if (showBgMaintenancePage && maintenancePageUiUrl) {
const bgMaintenanceServiceName = `bg-r${bgResource.resourceId}-maintenance-service`;
const bgMaintenanceRouterName = `bg-r${bgResource.resourceId}-maintenance-router`;
const bgRewriteMiddlewareName = `bg-r${bgResource.resourceId}-maintenance-rewrite`;
@@ -1140,7 +1136,7 @@ export async function getTraefikConfig(
loadBalancer: {
servers: [
{
url: browserGatewayUiUrl
url: maintenancePageUiUrl
}
],
passHostHeader: true

View File

@@ -277,7 +277,7 @@ hybridRouter.get(
);
}
const browserGatewayUiUrl = config.getRawConfig().app.dashboard_url; // points to the dashboard to serve from there
const pangolinUIUrl = config.getRawConfig().app.dashboard_url; // points to the dashboard to serve from there
try {
const traefikConfig = await getTraefikConfig(
@@ -286,8 +286,8 @@ hybridRouter.get(
true, // But don't allow domain namespace resources
false, // Dont include login pages,
true, // allow raw resources
false, // dont generate maintenance page
browserGatewayUiUrl // generate browser gateway targets
pangolinUIUrl, // dont generate maintenance page
pangolinUIUrl // generate browser gateway targets
);
return response(res, {

View File

@@ -19,7 +19,7 @@ export async function traefikConfigProvider(
const maintenancePort = config.getRawConfig().server.next_port;
const maintenanceHost = config.getRawConfig().server.internal_hostname;
const browserGatewayUiUrl = `http://${maintenanceHost}:${maintenancePort}`;
const pangolinUIUrl = `http://${maintenanceHost}:${maintenancePort}`;
const traefikConfig = await getTraefikConfig(
currentExitNodeId,
@@ -27,8 +27,8 @@ export async function traefikConfigProvider(
build == "oss", // filter out the namespace domains in open source
build != "oss", // generate the login pages on the cloud and and enterprise,
config.getRawConfig().traefik.allow_raw_resources,
build != "oss", // generate maintenance page on cloud and enterprise
browserGatewayUiUrl
pangolinUIUrl,
pangolinUIUrl
);
if (traefikConfig?.http?.middlewares) {