// ============================================================================= // 0pt -- Next.js config // ============================================================================= // SECURITY HEADERS (BACKLOG P0-13 / SEC-06). // // CHANGELOG.md has claimed since 2026-08 that this repo ships // CSP/HSTS/X-Frame-Options. Until this commit that claim was FALSE on `main`: // a repo-wide grep for `content-security-policy|strict-transport-security| // x-frame-options` matched exactly one file -- CHANGELOG.md itself. There was // no `headers()`, no middleware header injection, no reverse-proxy config in // this repo. The only thing that ever set HSTS on 0pt.app was Vercel's own // platform default, which is not this repo's and disappears the moment the app // moves to Coolify/Traefik (siax.config.json `deploy.target` is already // "coolify"; .gitea/workflows/cd.yml already points at a real Coolify app id). // Setting them here, at the framework level, means they travel with the app // regardless of host -- same idiom as sax3l/siax-io's next.config.mjs. // // CARVE-OUTS, each grep-verified against THIS tree (2026-09-07), not inherited // from an older branch: // // * script-src/style-src 'unsafe-inline' -- Next's App Router injects inline // hydration/RSC-payload scripts and next-themes injects an inline // no-flash script; Tailwind + recharts emit inline style attributes. A // per-request nonce threaded through middleware + layout is the real fix // and is deliberately NOT attempted here: this commit closes "zero // headers", not "zero inline tolerance". Tracked in BACKLOG. // * 'unsafe-eval' is added ONLY in `next dev` (webpack/Turbopack eval source // maps + HMR). Production never gets it. Guarded on NODE_ENV so a // dev-only relaxation can never leak into a built image, whose runtime // stage sets NODE_ENV=production (see Dockerfile). // * form-action 'self' -- no cross-origin