diff --git a/server/routers/target/createTarget.ts b/server/routers/target/createTarget.ts index 742cdf68..de9ac1f3 100644 --- a/server/routers/target/createTarget.ts +++ b/server/routers/target/createTarget.ts @@ -23,7 +23,7 @@ const createTargetParamsSchema = z const createTargetSchema = z .object({ - ip: z.string().ip().or(z.literal('localhost')), + ip: z.string(), method: z.string().min(1).max(10), port: z.number().int().min(1).max(65535), protocol: z.string().optional(), diff --git a/server/routers/target/updateTarget.ts b/server/routers/target/updateTarget.ts index 3e288020..8d774bac 100644 --- a/server/routers/target/updateTarget.ts +++ b/server/routers/target/updateTarget.ts @@ -19,7 +19,7 @@ const updateTargetParamsSchema = z const updateTargetBodySchema = z .object({ - ip: z.string().ip().or(z.literal('localhost')).optional(), // for now we cant update the ip; you will have to delete + ip: z.string().optional(), method: z.string().min(1).max(10).optional(), port: z.number().int().min(1).max(65535).optional(), enabled: z.boolean().optional() diff --git a/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx b/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx index 9b858835..cb2ff5ac 100644 --- a/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx +++ b/src/app/[orgId]/settings/resources/[resourceId]/connectivity/page.tsx @@ -64,7 +64,7 @@ import { import { SwitchInput } from "@app/components/SwitchInput"; const addTargetSchema = z.object({ - ip: z.union([z.string().ip(), z.literal("localhost")]), + ip: z.string(), method: z.string(), port: z.coerce.number().int().positive() // protocol: z.string(), @@ -179,7 +179,7 @@ export default function ReverseProxyTargets(props: { // make sure that the target IP is within the site subnet const targetIp = data.ip; const subnet = site.subnet; - if (targetIp === "localhost" || !isIPInSubnet(targetIp, subnet)) { + if (!isIPInSubnet(targetIp, subnet)) { toast({ variant: "destructive", title: "Invalid target IP",