2026-05-19 00:26:53 +02:00
|
|
|
import { z } from 'zod';
|
|
|
|
|
|
|
|
|
|
const Env = z.object({
|
|
|
|
|
DATABASE_URL: z.string(),
|
|
|
|
|
REDIS_URL: z.string().default('redis://localhost:6379'),
|
|
|
|
|
ANTHROPIC_API_KEY: z.string().optional(),
|
2026-05-23 23:50:00 +02:00
|
|
|
GLM_API_KEY: z.string().optional(),
|
2026-05-19 00:26:53 +02:00
|
|
|
RUNNER_HOST: z.string().default('localhost'),
|
|
|
|
|
RUNNER_PORT_RANGE_START: z.coerce.number().default(4100),
|
|
|
|
|
RUNNER_PORT_RANGE_END: z.coerce.number().default(4999),
|
|
|
|
|
CONTROL_PLANE_URL: z.string().default('http://host.docker.internal:4000'),
|
|
|
|
|
CONTROL_PLANE_PUBLIC_URL: z.string().default('http://localhost:4000'),
|
2026-05-19 00:57:23 +02:00
|
|
|
OAUTH_ISSUER: z.string().optional(),
|
2026-05-23 23:50:00 +02:00
|
|
|
MODEL_GENERATE: z.string().default('glm-4.5'),
|
2026-05-19 00:26:53 +02:00
|
|
|
MODEL_FIX: z.string().default('claude-haiku-4-5-20251001'),
|
2026-05-25 22:09:06 +02:00
|
|
|
// When set (e.g. "mcp.buildmymcpserver.com"), each deployed runner gets a
|
|
|
|
|
// public URL of the form https://<slug>.<MCP_DOMAIN> instead of the legacy
|
|
|
|
|
// http://<RUNNER_HOST>:<port> form. Requires host-side nginx + DNS setup
|
|
|
|
|
// (see scripts/setup-runner-tls.sh). When unset, falls back to plain HTTP.
|
|
|
|
|
MCP_DOMAIN: z.string().optional(),
|
|
|
|
|
// Directory the generator drops per-runner map fragments into. A host-side
|
|
|
|
|
// inotify service combines them and reloads nginx. Mounted as a volume by
|
|
|
|
|
// docker-compose (see setup-runner-tls.sh).
|
|
|
|
|
RUNNER_MAP_DIR: z.string().default('/var/runner-map'),
|
2026-05-19 00:26:53 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const config = Env.parse(process.env);
|