export const config = { port: Number(process.env.PORT || 3000), databaseUrl: process.env.DATABASE_URL, bootstrapApiKey: process.env.POSTPLAN_BOOTSTRAP_API_KEY, publicBaseUrl: process.env.POSTPLAN_PUBLIC_BASE_URL, maxHtmlBytes: Number(process.env.MAX_HTML_BYTES || 512 * 1024), // Directory for uploaded HTML. In Docker this is /data/html and should be a // mounted volume so drafts survive container recreation. htmlDir: process.env.POSTPLAN_HTML_DIR || "./data/html", // Web sign-in (dashboard). Absent POSTPLAN_SESSION_SECRET, all web-auth // routes respond 503 and the API/serving paths are unaffected. sessionSecret: process.env.POSTPLAN_SESSION_SECRET, shooBaseUrl: (process.env.SHOO_BASE_URL || "https://shoo.dev").replace(/\/+$/, "") }; export function requireEnv(name, value) { if (!value) { throw new Error(`Missing required environment variable: ${name}`); } return value; }