mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 14:39:29 +02:00
Configure if allow raw resources
This commit is contained in:
parent
b0500fac29
commit
d8e547c9a0
2 changed files with 6 additions and 2 deletions
|
@ -179,6 +179,7 @@ export const configSchema = z
|
||||||
.default("/var/dynamic/router_config.yml"),
|
.default("/var/dynamic/router_config.yml"),
|
||||||
static_domains: z.array(z.string()).optional().default([]),
|
static_domains: z.array(z.string()).optional().default([]),
|
||||||
site_types: z.array(z.string()).optional().default(["newt", "wireguard", "local"]),
|
site_types: z.array(z.string()).optional().default(["newt", "wireguard", "local"]),
|
||||||
|
allow_raw_resources: z.boolean().optional().default(true),
|
||||||
file_mode: z.boolean().optional().default(false)
|
file_mode: z.boolean().optional().default(false)
|
||||||
})
|
})
|
||||||
.optional()
|
.optional()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Request, Response } from "express";
|
import { Request, Response } from "express";
|
||||||
import { db, exitNodes } from "@server/db";
|
import { db, exitNodes } from "@server/db";
|
||||||
import { and, eq, inArray, or, isNull, ne } from "drizzle-orm";
|
import { and, eq, inArray, or, isNull, ne, isNotNull } from "drizzle-orm";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import HttpCode from "@server/types/HttpCode";
|
import HttpCode from "@server/types/HttpCode";
|
||||||
import config from "@server/lib/config";
|
import config from "@server/lib/config";
|
||||||
|
@ -149,7 +149,10 @@ export async function getTraefikConfig(
|
||||||
eq(sites.exitNodeId, exitNodeId),
|
eq(sites.exitNodeId, exitNodeId),
|
||||||
isNull(sites.exitNodeId)
|
isNull(sites.exitNodeId)
|
||||||
),
|
),
|
||||||
inArray(sites.type, siteTypes)
|
inArray(sites.type, siteTypes),
|
||||||
|
config.getRawConfig().traefik.allow_raw_resources
|
||||||
|
? isNotNull(resources.http) // ignore the http check if allow_raw_resources is true
|
||||||
|
: eq(resources.http, true),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue