Sanitize values before including in treafik config

This commit is contained in:
Owen
2026-10-27 15:10:08 -04:00
parent a85b633ca0
commit f4410cdbeb
14 changed files with 157 additions and 26 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { Request, Response, NextFunction } from "express";
import { z } from "zod";
import { routePathSchema } from "@server/lib/schemas";
import {
db,
statusHistory,
@@ -76,7 +77,7 @@ const createTargetSchema = z
hcTlsServerName: z.string().optional().nullable(),
hcHealthyThreshold: z.int().positive().min(1).optional().nullable(),
hcUnhealthyThreshold: z.int().positive().min(1).optional().nullable(),
path: z.string().optional().nullable(),
path: routePathSchema.optional().nullable(),
pathMatchType: z
.enum(["exact", "prefix", "regex"])
.optional()
+2 -1
View File
@@ -1,5 +1,6 @@
import { Request, Response, NextFunction } from "express";
import { z } from "zod";
import { routePathSchema } from "@server/lib/schemas";
import { db, targetHealthCheck } from "@server/db";
import { aiProviders, newts, resources, sites, targets } from "@server/db";
import { eq } from "drizzle-orm";
@@ -54,7 +55,7 @@ const updateTargetBodySchema = z
hcTlsServerName: z.string().optional().nullable(),
hcHealthyThreshold: z.int().positive().min(1).optional().nullable(),
hcUnhealthyThreshold: z.int().positive().min(1).optional().nullable(),
path: z.string().optional().nullable(),
path: routePathSchema.optional().nullable(),
pathMatchType: z
.enum(["exact", "prefix", "regex"])
.optional()