revert changes around sites assigned to exit nodes

This commit is contained in:
Owen
2025-10-21 11:11:31 -07:00
parent e77909d498
commit e447549de1
7 changed files with 24 additions and 96 deletions

View File

@@ -40,6 +40,7 @@ import {
CertificateResult,
getValidCertificatesForDomains
} from "#private/lib/certificates";
import { build } from "@server/build";
const redirectHttpsMiddlewareName = "redirect-to-https";
const redirectToRootMiddlewareName = "redirect-to-root";
@@ -120,7 +121,15 @@ export async function getTraefikConfig(
and(
eq(targets.enabled, true),
eq(resources.enabled, true),
eq(sites.exitNodeId, exitNodeId),
or(
eq(sites.exitNodeId, exitNodeId),
and(
build != "saas" // so it runs in enterprise
? isNull(sites.exitNodeId)
: sql`0 = 1`,
eq(sites.type, "local")
)
),
or(
ne(targetHealthCheck.hcHealth, "unhealthy"), // Exclude unhealthy targets
isNull(targetHealthCheck.hcHealth) // Include targets with no health check record