mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-27 15:26:41 +00:00
Dont allow maintence page on remote nodes
This commit is contained in:
@@ -41,9 +41,10 @@ type TargetWithSite = Target & {
|
|||||||
export async function getTraefikConfig(
|
export async function getTraefikConfig(
|
||||||
exitNodeId: number,
|
exitNodeId: number,
|
||||||
siteTypes: string[],
|
siteTypes: string[],
|
||||||
filterOutNamespaceDomains = false,
|
filterOutNamespaceDomains = false, // UNUSED BUT USED IN PRIVATE
|
||||||
generateLoginPageRouters = false,
|
generateLoginPageRouters = false, // UNUSED BUT USED IN PRIVATE
|
||||||
allowRawResources = true
|
allowRawResources = true,
|
||||||
|
allowMaintenancePage = true, // UNUSED BUT USED IN PRIVATE
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
// Get resources with their targets and sites in a single optimized query
|
// Get resources with their targets and sites in a single optimized query
|
||||||
// Start from sites on this exit node, then join to targets and resources
|
// Start from sites on this exit node, then join to targets and resources
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ export async function getTraefikConfig(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showMaintenancePage) {
|
if (showMaintenancePage && allowMaintenancePage) {
|
||||||
const maintenanceServiceName = `${key}-maintenance-service`;
|
const maintenanceServiceName = `${key}-maintenance-service`;
|
||||||
const maintenanceRouterName = `${key}-maintenance-router`;
|
const maintenanceRouterName = `${key}-maintenance-router`;
|
||||||
const rewriteMiddlewareName = `${key}-maintenance-rewrite`;
|
const rewriteMiddlewareName = `${key}-maintenance-rewrite`;
|
||||||
|
|||||||
@@ -247,7 +247,8 @@ hybridRouter.get(
|
|||||||
["newt", "local", "wireguard"], // Allow them to use all the site types
|
["newt", "local", "wireguard"], // Allow them to use all the site types
|
||||||
true, // But don't allow domain namespace resources
|
true, // But don't allow domain namespace resources
|
||||||
false, // Dont include login pages,
|
false, // Dont include login pages,
|
||||||
true // allow raw resources
|
true, // allow raw resources
|
||||||
|
false // dont generate maintenance page
|
||||||
);
|
);
|
||||||
|
|
||||||
return response(res, {
|
return response(res, {
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ function MaintenanceSectionForm({
|
|||||||
name="maintenanceModeEnabled"
|
name="maintenanceModeEnabled"
|
||||||
render={({ field }) => {
|
render={({ field }) => {
|
||||||
const isDisabled =
|
const isDisabled =
|
||||||
isSecurityFeatureDisabled();
|
isSecurityFeatureDisabled() || resource.http === false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
|
|||||||
Reference in New Issue
Block a user