import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env' export function register() { if (process.env.NEXT_RUNTIME !== 'nodejs') {return} // storage: R2 is required in production. ALLOW_LOCAL_MEDIA=1 lets a production build run on local disk for // local checks and CI only — never set it in Coolify. // @starter:if crawl // cookieCrawl: IPAL_COOKIE_SCAN_URL / IPAL_COOKIE_SCAN_TOKEN in production (cookieScanner.crawl, the shared service). // @starter:endif // databaseName: DATABASE_URI must name example-studiopl_dev / example-studiopl_prod (databaseNamesFor). // R2_PUBLIC_URL optional: media are served through the app by default (storage.md, env.md). assertEnv( ipalEnvRules({ // @starter:if crawl cookieCrawl: true, // IPAL_COOKIE_SCAN_URL / IPAL_COOKIE_SCAN_TOKEN in production — the shared cookie-crawler service // @starter:endif databaseName: { domain: 'example-studio.pl' }, // @starter:if graph //: emailGraph: true, // GRAPH_* — e-mail through Microsoft Graph // @starter:endif ipHeader: true, // @starter:if r2 storage: process.env.ALLOW_LOCAL_MEDIA !== '1', // @starter:else //: storage: false, // media on local disk — a Coolify persistent volume (AGENTS.md → Project decisions) // @starter:endif }).map((rule) => (rule.name === 'R2_PUBLIC_URL' ? { ...rule, required: false } : rule)), ) }