add flag to disable config managed domains

This commit is contained in:
miloschwartz 2025-06-17 17:25:41 -04:00
parent a24431bc3b
commit 17ac5a5e81
No known key found for this signature in database
3 changed files with 14188 additions and 14074 deletions

View file

@ -40,20 +40,7 @@ export const configSchema = z
prefer_wildcard_cert: z.boolean().optional().default(false)
})
)
.refine(
(domains) => {
const keys = Object.keys(domains);
if (keys.length === 0) {
return false;
}
return true;
},
{
message: "At least one domain must be defined"
}
),
.optional(),
server: z.object({
integration_port: portSchema
.optional()
@ -253,6 +240,7 @@ export const configSchema = z
enable_redis: z.boolean().optional(),
disable_local_sites: z.boolean().optional(),
disable_basic_wireguard_sites: z.boolean().optional(),
disable_config_managed_domains: z.boolean().optional()
})
.optional()
})
@ -267,6 +255,21 @@ export const configSchema = z
message:
"If Redis is enabled, configuration details must be provided"
}
)
.refine(
(data) => {
const keys = Object.keys(data.domains || {});
if (data.flags?.disable_config_managed_domains) {
return true;
}
if (keys.length === 0) {
return false;
}
return true;
},
{
message: "At least one domain must be defined"
}
);
export function readConfigFile() {