Add site_block_size and migration for beta.3

This commit is contained in:
Owen Schwartz 2025-01-11 12:25:33 -05:00
parent 484a099ee3
commit 38544cc2d6
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
7 changed files with 53 additions and 23 deletions

View file

@ -3,15 +3,7 @@ import yaml from "js-yaml";
import path from "path";
import { z } from "zod";
import { fromError } from "zod-validation-error";
<<<<<<< HEAD
import { __DIRNAME, APP_PATH, configFilePath1, configFilePath2 } from "@server/lib/consts";
=======
import {
__DIRNAME,
configFilePath1,
configFilePath2
} from "@server/lib/consts";
>>>>>>> c3d19454f7f5c5546a7efb47c23fc040dbbf94d2
import { loadAppVersion } from "@server/lib/loadAppVersion";
import { passwordSchema } from "@server/auth/passwordSchema";
@ -19,15 +11,9 @@ const portSchema = z.number().positive().gt(0).lte(65535);
const hostnameSchema = z
.string()
.regex(
<<<<<<< HEAD
/^(?!-)[a-zA-Z0-9-]{1,63}(?<!-)(\.[a-zA-Z]{2,})*$/,
"Invalid hostname. Must be a valid hostname like 'localhost' or 'test.example.com'."
);
=======
/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$/
)
.or(z.literal("localhost"));
>>>>>>> c3d19454f7f5c5546a7efb47c23fc040dbbf94d2
const environmentSchema = z.object({
app: z.object({
@ -59,7 +45,8 @@ const environmentSchema = z.object({
base_endpoint: z.string().transform((url) => url.toLowerCase()),
use_subdomain: z.boolean(),
subnet_group: z.string(),
block_size: z.number().positive().gt(0)
block_size: z.number().positive().gt(0),
site_block_size: z.number().positive().gt(0)
}),
rate_limits: z.object({
global: z.object({