mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: ♻️ Move config checker code into its own file
This commit is contained in:
parent
8a774fa05d
commit
0ecb65de29
2 changed files with 27 additions and 0 deletions
|
|
@ -120,6 +120,24 @@ export const configValidator = z.object({
|
|||
// Not using .ip() because we allow CIDR ranges and wildcards and such
|
||||
banned_ips: z.array(z.string()).default([]),
|
||||
banned_user_agents: z.array(z.string()).default([]),
|
||||
proxy: z
|
||||
.object({
|
||||
enabled: z.boolean().default(false),
|
||||
host: z.string().min(1).default("localhost"),
|
||||
port: z
|
||||
.number()
|
||||
.int()
|
||||
.min(1)
|
||||
.max(2 ** 16 - 1)
|
||||
.default(9050),
|
||||
type: z.enum(["socks4", "socks4a", "socks5"]).default("socks5"),
|
||||
})
|
||||
.default({
|
||||
enabled: false,
|
||||
host: "localhost",
|
||||
port: 9050,
|
||||
type: "socks5",
|
||||
}),
|
||||
tls: z
|
||||
.object({
|
||||
enabled: z.boolean().default(false),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue