mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-30 06:29:23 +02:00
Basic clients working
This commit is contained in:
parent
15adfcca8c
commit
28f8b05dbc
21 changed files with 387 additions and 87 deletions
|
@ -40,7 +40,7 @@ const createHttpResourceSchema = z
|
|||
siteId: z.number(),
|
||||
http: z.boolean(),
|
||||
protocol: z.enum(["tcp", "udp"]),
|
||||
domainId: z.string()
|
||||
domainId: z.string(),
|
||||
})
|
||||
.strict()
|
||||
.refine(
|
||||
|
@ -59,7 +59,8 @@ const createRawResourceSchema = z
|
|||
siteId: z.number(),
|
||||
http: z.boolean(),
|
||||
protocol: z.enum(["tcp", "udp"]),
|
||||
proxyPort: z.number().int().min(1).max(65535)
|
||||
proxyPort: z.number().int().min(1).max(65535),
|
||||
enableProxy: z.boolean().default(true)
|
||||
})
|
||||
.strict()
|
||||
.refine(
|
||||
|
@ -378,7 +379,7 @@ async function createRawResource(
|
|||
);
|
||||
}
|
||||
|
||||
const { name, http, protocol, proxyPort } = parsedBody.data;
|
||||
const { name, http, protocol, proxyPort, enableProxy } = parsedBody.data;
|
||||
|
||||
// if http is false check to see if there is already a resource with the same port and protocol
|
||||
const existingResource = await db
|
||||
|
@ -411,7 +412,8 @@ async function createRawResource(
|
|||
name,
|
||||
http,
|
||||
protocol,
|
||||
proxyPort
|
||||
proxyPort,
|
||||
enableProxy
|
||||
})
|
||||
.returning();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue