refactor: ♻️ Move config checker code into its own file

This commit is contained in:
Jesse Wierzbinski 2024-06-25 16:30:51 -10:00
parent 8a774fa05d
commit 0ecb65de29
No known key found for this signature in database
2 changed files with 27 additions and 0 deletions

View file

@ -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),