fix(wireguard): поддержать IPv6 и исключить выключенные серверы
This commit is contained in:
1 parent
f3cbc32720
commit
4d3cb659c1
30 files changed
+2001
-82
No files matched your search
@@ -12,6 +12,7 @@ export function resolveWgClientEndpoint(clientEndpoint: string | undefined, serv
|
||||
}
|
||||
|
||||
export const wgStatusSchema = z.enum(["up", "down"])
|
||||
export const wgInterfaceAddressSchema = z.union([z.literal(""), z.cidrv4(), z.cidrv6()])
|
||||
|
||||
export const wgPeerDtoSchema = z.object({
|
||||
id: z.string().min(1),
|
||||
@@ -85,12 +86,13 @@ export const wgCreateInterfaceSchema = z.object({
|
||||
mtu: z.number().int().positive().default(1420),
|
||||
comment: z.string().optional(),
|
||||
privateKey: z.string().min(1).optional(),
|
||||
address: z.string().optional(),
|
||||
address: wgInterfaceAddressSchema.optional(),
|
||||
disabled: z.boolean().optional(),
|
||||
peer: wgCreatePeerSchema.optional(),
|
||||
})
|
||||
|
||||
export const wgPatchInterfaceSchema = z.object({
|
||||
address: wgInterfaceAddressSchema.optional(),
|
||||
name: z.string().min(1).max(64).optional(),
|
||||
listenPort: z.number().int().positive().optional(),
|
||||
mtu: z.number().int().positive().optional(),
|
||||
|
||||
Reference in new issue
Block a user