From 3e881e99388ab4c68daf0d7af340e68e07971fad Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 1 Jun 2026 18:24:45 -0400 Subject: [PATCH] fix(server): allow required CSP handoffs Permit GitHub App manifest form posts and signed HTTPS VNC preview iframes while keeping the rest of the SPA CSP locked down. Mirror the policy in the split-web Caddy config. --- docker/split-web/Caddyfile.static | 2 +- lib/crates/fabro-server/src/csp.rs | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docker/split-web/Caddyfile.static b/docker/split-web/Caddyfile.static index 2e1af9984..5f05003cf 100644 --- a/docker/split-web/Caddyfile.static +++ b/docker/split-web/Caddyfile.static @@ -9,7 +9,7 @@ Cross-Origin-Opener-Policy same-origin Cross-Origin-Resource-Policy same-origin Permissions-Policy "accelerometer=(), autoplay=(), camera=(), display-capture=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), usb=(), web-share=(), xr-spatial-tracking=()" - Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob: https://avatars.githubusercontent.com; connect-src 'self' ws: wss:; worker-src 'self' blob:; manifest-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self'; object-src 'none'" + Content-Security-Policy "default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob: https://avatars.githubusercontent.com; connect-src 'self' ws: wss:; worker-src 'self' blob:; frame-src 'self' https:; manifest-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'self' https://github.com; object-src 'none'" } @sourceMaps path *.map diff --git a/lib/crates/fabro-server/src/csp.rs b/lib/crates/fabro-server/src/csp.rs index d41324fde..bfed99e37 100644 --- a/lib/crates/fabro-server/src/csp.rs +++ b/lib/crates/fabro-server/src/csp.rs @@ -2,8 +2,7 @@ //! //! The policy is built once at server startup from the embedded SPA //! `index.html` so any inline `