mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-28 14:44:55 +02:00
Merge branch 'holepunch' into hp-multi-client
This commit is contained in:
commit
473b5bd3db
8 changed files with 120 additions and 22 deletions
|
@ -8,7 +8,8 @@ import { eq } from "drizzle-orm";
|
|||
import { getNextAvailableClientSubnet } from "@server/lib/ip";
|
||||
|
||||
const inputSchema = z.object({
|
||||
publicKey: z.string()
|
||||
publicKey: z.string(),
|
||||
port: z.number().int().positive(),
|
||||
});
|
||||
|
||||
type Input = z.infer<typeof inputSchema>;
|
||||
|
@ -40,7 +41,7 @@ export const handleGetConfigMessage: MessageHandler = async (context) => {
|
|||
return;
|
||||
}
|
||||
|
||||
const { publicKey } = message.data as Input;
|
||||
const { publicKey, port } = message.data as Input;
|
||||
|
||||
const siteId = newt.siteId;
|
||||
|
||||
|
@ -64,7 +65,8 @@ export const handleGetConfigMessage: MessageHandler = async (context) => {
|
|||
.update(sites)
|
||||
.set({
|
||||
publicKey,
|
||||
address
|
||||
address,
|
||||
listenPort: port,
|
||||
})
|
||||
.where(eq(sites.siteId, siteId))
|
||||
.returning();
|
||||
|
@ -77,7 +79,8 @@ export const handleGetConfigMessage: MessageHandler = async (context) => {
|
|||
const [siteRes] = await db
|
||||
.update(sites)
|
||||
.set({
|
||||
publicKey
|
||||
publicKey,
|
||||
listenPort: port,
|
||||
})
|
||||
.where(eq(sites.siteId, siteId))
|
||||
.returning();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue