Adds Sentry and Umami monitoring to the site
Continuous Integration / lighthouse (pull_request) Canceled after 0s
Continuous Integration / deploy-test (pull_request) Canceled after 0s
Continuous Integration / deploy-production (pull_request) Canceled after 0s
Continuous Integration / check (pull_request) Canceled after 2m22s

Sentry loads after the page and reports errors only, without personal data;
Umami counts visits per environment. Both only run on andreaslop.nl and
test.andreaslop.nl. The CSP allows just these two hosts, and builds carry the
commit SHA as release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 12:08:47 +02:00
co-authored by Claude Opus 5.5
parent 0bfe50e723
commit 6d3a1566c2
20 changed files with 518 additions and 21 deletions
+6 -3
View File
@@ -1,17 +1,20 @@
// HTTP-securityheaders voor de Vite dev- en preview-server. De productieset is
// ook het voorschrift voor de toekomstige host (zie NFR-SEC-01/02).
import { sentryIngestOrigin, umamiOrigin } from '../src/monitoring/config.ts';
type Mode = 'production' | 'development';
// Chakra/Emotion zetten tijdens runtime <style>-tags in de pagina, daarom
// staat style-src 'unsafe-inline' toe. Scripts komen alleen van de eigen site.
// staat style-src 'unsafe-inline' toe. Scripts komen van de eigen site en het
// Umami-script; verbindingen alleen naar Umami en Sentry (monitoring-plan M7).
const productionCsp: Record<string, string[]> = {
'default-src': ["'self'"],
'script-src': ["'self'"],
'script-src': ["'self'", umamiOrigin],
'style-src': ["'self'", "'unsafe-inline'"],
'img-src': ["'self'", 'data:'],
'font-src': ["'self'"],
'connect-src': ["'self'"],
'connect-src': ["'self'", umamiOrigin, sentryIngestOrigin],
'object-src': ["'none'"],
'base-uri': ["'self'"],
'form-action': ["'self'"],