mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
refactor: ♻️ Move config checker code into its own file
This commit is contained in:
parent
8a774fa05d
commit
0ecb65de29
|
|
@ -83,6 +83,15 @@ banned_user_agents = [
|
||||||
# "wget\/1.20.3",
|
# "wget\/1.20.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[http.proxy]
|
||||||
|
# For SOCKS proxies (e.g. Tor)
|
||||||
|
# Will be used for all outgoing requests
|
||||||
|
enabled = false
|
||||||
|
host = "127.0.0.1"
|
||||||
|
port = 9050
|
||||||
|
# Can be socks4, socks4a or socks5
|
||||||
|
type = "socks5"
|
||||||
|
|
||||||
[http.tls]
|
[http.tls]
|
||||||
# If these values are set, Lysand will use these files for TLS
|
# If these values are set, Lysand will use these files for TLS
|
||||||
enabled = false
|
enabled = false
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,24 @@ export const configValidator = z.object({
|
||||||
// Not using .ip() because we allow CIDR ranges and wildcards and such
|
// Not using .ip() because we allow CIDR ranges and wildcards and such
|
||||||
banned_ips: z.array(z.string()).default([]),
|
banned_ips: z.array(z.string()).default([]),
|
||||||
banned_user_agents: 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
|
tls: z
|
||||||
.object({
|
.object({
|
||||||
enabled: z.boolean().default(false),
|
enabled: z.boolean().default(false),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue