From edeb1eb148dd104195523ce6e726c4b2c371b96b Mon Sep 17 00:00:00 2001 From: Keysat Date: Sat, 9 May 2026 12:05:11 -0500 Subject: [PATCH] =?UTF-8?q?v1.0.0:2=20=E2=80=94=20revert=20CSP=20nonces;?= =?UTF-8?q?=20restore=20inline-friendly=20CSP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1.0.0:1 shipped a per-request nonce-based CSP via Next.js middleware. In production it produced a blank first paint: Next 14.2.x's bootstrap inline scripts weren't picking up the nonce reliably from the x-nonce request header, so the browser blocked them. This release reverts to the pre-experiment posture: - middleware.ts back to auth gating only (no nonce, no CSP). - next.config.js restores the static CSP with `'unsafe-inline'` allowed for script-src and style-src. Same headers (HSTS, Referrer-Policy, Permissions-Policy, frame-ancestors 'none', etc.) all stay. - New startos/versions/v1.0.0.2.ts with empty up/down migrations and a release note explaining the bug + revert. Promoted to `current` in the version graph; v1.0.0:1 moves to `other` so existing installs upgrade in place. No schema changes, no data migration. Existing v1.0.0:1 installs keep their /data. Re-attempt path documented in middleware.ts and next.config.js comments: future PR can revisit nonce CSP using Next's documented pattern verbatim (notably setting CSP on BOTH request headers and response headers — we only set it on response). --- proof-of-work/middleware.ts | 85 +++++++++---------------- proof-of-work/next.config.js | 32 ++++++++-- start9/0.4/startos/versions/index.ts | 19 +++--- start9/0.4/startos/versions/v1.0.0.2.ts | 30 +++++++++ 4 files changed, 98 insertions(+), 68 deletions(-) create mode 100644 start9/0.4/startos/versions/v1.0.0.2.ts diff --git a/proof-of-work/middleware.ts b/proof-of-work/middleware.ts index 87fa59c..9d8f558 100644 --- a/proof-of-work/middleware.ts +++ b/proof-of-work/middleware.ts @@ -1,76 +1,49 @@ import { NextRequest, NextResponse } from 'next/server'; /** - * Per-request CSP nonce + auth gating. + * Auth gating only. * - * Nonces drop the previous `'unsafe-inline'` from `script-src`. Next - * 13.4+ automatically picks up the nonce from the `x-nonce` request - * header and stamps it on the bootstrap inline scripts it emits, so - * the in-app code (which doesn't itself emit inline `