Serve index.html no-cache on every route; check the theme script's CSP hash

`try_files` served the SPA fallback inside `location /`, so `/` and every
client route went out without `Cache-Control: no-cache`. The fallback is now
the last argument, an internal redirect to the exact no-cache location.

`src/csp.check.ts` recomputes the inline theme script's sha256 and fails
`bun run check` with the new value when the CSP no longer names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013GAeg4Jo6xjZzjwy9QDWMQ
This commit is contained in:
2026-10-07 09:32:06 +02:00
co-authored by Claude Opus 5.5
parent 8684f27f58
commit 0869e5b156
3 changed files with 39 additions and 2 deletions
+2 -1
View File
@@ -3,7 +3,8 @@
#
# script-src: the bundle, plus the theme script inline in index.html by its
# hash. Edit that script and this hash must change with it (sha256 of the text
# between the tags, base64), or the app paints light-then-dark again.
# between the tags, base64), or the app paints light-then-dark again;
# `bun run check` (src/csp.check.ts) fails with the new value.
# style-src 'unsafe-inline': Monaco, Radix's scroll lock and the toasts insert
# <style> elements at runtime, which no hash can name.
# img/frame-src take any http(s): a camera stream or website widget points