mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 09:46:40 +00:00
Add tcp, udp ports, and icmp to blueprints
This commit is contained in:
@@ -90,7 +90,10 @@ export async function updateClientResources(
|
|||||||
destination: resourceData.destination,
|
destination: resourceData.destination,
|
||||||
enabled: true, // hardcoded for now
|
enabled: true, // hardcoded for now
|
||||||
// enabled: resourceData.enabled ?? true,
|
// enabled: resourceData.enabled ?? true,
|
||||||
alias: resourceData.alias || null
|
alias: resourceData.alias || null,
|
||||||
|
disableIcmp: resourceData["disable-icmp"],
|
||||||
|
tcpPortRangeString: resourceData["tcp-ports"],
|
||||||
|
udpPortRangeString: resourceData["udp-ports"]
|
||||||
})
|
})
|
||||||
.where(
|
.where(
|
||||||
eq(
|
eq(
|
||||||
@@ -217,7 +220,10 @@ export async function updateClientResources(
|
|||||||
destination: resourceData.destination,
|
destination: resourceData.destination,
|
||||||
enabled: true, // hardcoded for now
|
enabled: true, // hardcoded for now
|
||||||
// enabled: resourceData.enabled ?? true,
|
// enabled: resourceData.enabled ?? true,
|
||||||
alias: resourceData.alias || null
|
alias: resourceData.alias || null,
|
||||||
|
disableIcmp: resourceData["disable-icmp"],
|
||||||
|
tcpPortRangeString: resourceData["tcp-ports"],
|
||||||
|
udpPortRangeString: resourceData["udp-ports"]
|
||||||
})
|
})
|
||||||
.returning();
|
.returning();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
import { portRangeStringSchema } from "@server/lib/ip";
|
||||||
|
|
||||||
export const SiteSchema = z.object({
|
export const SiteSchema = z.object({
|
||||||
name: z.string().min(1).max(100),
|
name: z.string().min(1).max(100),
|
||||||
@@ -222,6 +223,9 @@ export const ClientResourceSchema = z
|
|||||||
// destinationPort: z.int().positive().optional(),
|
// destinationPort: z.int().positive().optional(),
|
||||||
destination: z.string().min(1),
|
destination: z.string().min(1),
|
||||||
// enabled: z.boolean().default(true),
|
// enabled: z.boolean().default(true),
|
||||||
|
"tcp-ports": portRangeStringSchema.optional().default("*"),
|
||||||
|
"udp-ports": portRangeStringSchema.optional().default("*"),
|
||||||
|
"disable-icmp": z.boolean().optional().default(false),
|
||||||
alias: z
|
alias: z
|
||||||
.string()
|
.string()
|
||||||
.regex(
|
.regex(
|
||||||
|
|||||||
Reference in New Issue
Block a user