mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-16 15:32:19 +02:00
move ssl from target to resource
This commit is contained in:
parent
e279d93570
commit
1fb43a5ce4
2 changed files with 7 additions and 7 deletions
|
@ -34,6 +34,7 @@ export const resources = sqliteTable("resources", {
|
|||
}),
|
||||
name: text("name").notNull(),
|
||||
subdomain: text("subdomain"),
|
||||
ssl: integer("ssl", { mode: "boolean" }).notNull().default(false),
|
||||
});
|
||||
|
||||
export const targets = sqliteTable("targets", {
|
||||
|
@ -46,7 +47,6 @@ export const targets = sqliteTable("targets", {
|
|||
port: integer("port").notNull(),
|
||||
protocol: text("protocol"),
|
||||
enabled: integer("enabled", { mode: "boolean" }).notNull().default(true),
|
||||
ssl: integer("ssl", { mode: "boolean" }).notNull().default(false),
|
||||
});
|
||||
|
||||
export const exitNodes = sqliteTable("exitNodes", {
|
||||
|
|
|
@ -82,7 +82,7 @@ export async function traefikConfigProvider(
|
|||
? {
|
||||
domains: [
|
||||
{
|
||||
main: wildCard
|
||||
main: wildCard,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
@ -91,17 +91,17 @@ export async function traefikConfigProvider(
|
|||
|
||||
http.routers![routerName] = {
|
||||
entryPoints: [
|
||||
target.ssl
|
||||
resource.ssl
|
||||
? config.traefik.https_entrypoint
|
||||
: config.traefik.http_entrypoint,
|
||||
],
|
||||
middlewares: target.ssl ? [badgerMiddlewareName] : [],
|
||||
middlewares: resource.ssl ? [badgerMiddlewareName] : [],
|
||||
service: serviceName,
|
||||
rule: `Host(\`${resource.fullDomain}\`)`,
|
||||
...(target.ssl ? { tls } : {}),
|
||||
...(resource.ssl ? { tls } : {}),
|
||||
};
|
||||
|
||||
if (target.ssl) {
|
||||
if (resource.ssl) {
|
||||
// this is a redirect router; all it does is redirect to the https version if tls is enabled
|
||||
http.routers![routerName + "-redirect"] = {
|
||||
entryPoints: [config.traefik.http_entrypoint],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue