Clean up config for dns servers

This commit is contained in:
Owen
2026-10-28 15:51:08 -04:00
parent 3dd46e48ec
commit 8ce036b413
5 changed files with 63 additions and 0 deletions
+9
View File
@@ -4,6 +4,7 @@ import { configFilePath1, configFilePath2 } from "./consts";
import { z } from "zod";
import stoi from "./stoi";
import { getEnvOrYaml, readEnvOrFile } from "./getEnvOrYaml";
import { getRunMode } from "./runMode";
// type-only: offlineThresholds imports config, which imports this file
import type { OfflineThresholds } from "@server/lib/offlineThresholds";
@@ -325,6 +326,10 @@ export const configSchema = z
base_endpoint: z
.string()
.optional()
// The standalone DNS server never creates exit nodes
.transform((url) =>
url === undefined && getRunMode() === "dns" ? "" : url
)
.pipe(z.string())
.transform((url) => url.toLowerCase()),
subnet_group: z.string().optional().default("100.89.137.0/18"),
@@ -516,6 +521,10 @@ export const configSchema = z
)
.refine(
(data) => {
// The standalone DNS server never uses the secret
if (getRunMode() === "dns") {
return true;
}
// If hybrid is not defined, server secret must be defined
return (
data.server?.secret !== undefined &&