mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-19 08:48:34 +02:00
Allow anything for the ip
This commit is contained in:
parent
b4dd827ce1
commit
ab69ded396
3 changed files with 4 additions and 4 deletions
|
@ -23,7 +23,7 @@ const createTargetParamsSchema = z
|
||||||
|
|
||||||
const createTargetSchema = z
|
const createTargetSchema = z
|
||||||
.object({
|
.object({
|
||||||
ip: z.string().ip().or(z.literal('localhost')),
|
ip: z.string(),
|
||||||
method: z.string().min(1).max(10),
|
method: z.string().min(1).max(10),
|
||||||
port: z.number().int().min(1).max(65535),
|
port: z.number().int().min(1).max(65535),
|
||||||
protocol: z.string().optional(),
|
protocol: z.string().optional(),
|
||||||
|
|
|
@ -19,7 +19,7 @@ const updateTargetParamsSchema = z
|
||||||
|
|
||||||
const updateTargetBodySchema = z
|
const updateTargetBodySchema = z
|
||||||
.object({
|
.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(),
|
method: z.string().min(1).max(10).optional(),
|
||||||
port: z.number().int().min(1).max(65535).optional(),
|
port: z.number().int().min(1).max(65535).optional(),
|
||||||
enabled: z.boolean().optional()
|
enabled: z.boolean().optional()
|
||||||
|
|
|
@ -64,7 +64,7 @@ import {
|
||||||
import { SwitchInput } from "@app/components/SwitchInput";
|
import { SwitchInput } from "@app/components/SwitchInput";
|
||||||
|
|
||||||
const addTargetSchema = z.object({
|
const addTargetSchema = z.object({
|
||||||
ip: z.union([z.string().ip(), z.literal("localhost")]),
|
ip: z.string(),
|
||||||
method: z.string(),
|
method: z.string(),
|
||||||
port: z.coerce.number().int().positive()
|
port: z.coerce.number().int().positive()
|
||||||
// protocol: z.string(),
|
// protocol: z.string(),
|
||||||
|
@ -179,7 +179,7 @@ export default function ReverseProxyTargets(props: {
|
||||||
// make sure that the target IP is within the site subnet
|
// make sure that the target IP is within the site subnet
|
||||||
const targetIp = data.ip;
|
const targetIp = data.ip;
|
||||||
const subnet = site.subnet;
|
const subnet = site.subnet;
|
||||||
if (targetIp === "localhost" || !isIPInSubnet(targetIp, subnet)) {
|
if (!isIPInSubnet(targetIp, subnet)) {
|
||||||
toast({
|
toast({
|
||||||
variant: "destructive",
|
variant: "destructive",
|
||||||
title: "Invalid target IP",
|
title: "Invalid target IP",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue