Harden the web platform's headers, embeds and analytics
Free, open-source timeline editor for exact dates at any scale.
Brought to you by:
athanclark
Originally created by: athanclark
Closes [#504]. Refs [#521] (HSTS on the editor frame and embeds; hiding nginx's version is separate).
Security headers on every page:
frame-ancestors 'none', nosniff, Referrer-Policy: no-referrer, and HSTS over HTTPS./compare, /privacy, /terms and 404 pages weren't.transportSecurity() in server/site.mjs).Analytics (only when an operator sets GOOGLE_ANALYTICS_ID and a visitor accepts):
analyticsPage() in platform/lib/analytics.js)./timelines./compare, /editor and /connect are sent without their ids or codes.docs/administration.md asks operators to turn off three of GA's "Enhanced measurement" options that code can't.Embeds:
$ patterns stays as written.Tests:
analytics.test.mjs: the scrubbing rules;editor-routes.test.mjs: titles with $ patterns, and HSTS and framing on the frame and embed routes;site.test.mjs.next-platform.mjs checks the headers on /compare, /privacy, /terms, 404s and unknown timeline addresses.sharing-postgres.mjs checks which pages are marked public for analytics.next-platform, next-postgres, and sharing-postgres up to its browser steps, which run in CI.Docs: docs/administration.md, docs/sharing.md, platform/README.md.
🤖 Generated with Claude Code
Ticket changed by: athanclark