You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rely on arocapi's sandbox headers instead of Caddy's CSP #58
arocapi 5 now sends its own Content-Security-Policy (sandbox) and nosniff on delivered crate files, deliberately leaving audio and video out because Chrome won't play media opened directly under a CSP. Caddy's own, weaker sandbox CSP on everything under /api/* duplicates that and puts a CSP back on media. Drop Caddy's CSP on /api/* and rely on arocapi's headers; Caddy's global security headers stay. Rewrite ldacapi's ADR 0002 context to state the decision as it now stands: arocapi sandboxes delivered bytes but not media, which still justifies the separate admin origin. Add a one-line comment saying why CORS is registered only in the /api scope (to keep CORS headers off /oauth and /admin), so nobody moves it to the root as arocapi's docs suggest.
Ships on the one #52 branch and PR, as its own commit. See #52 for the decisions behind it.
Acceptance criteria
Before removing Caddy's CSP, confirm arocapi's CSP and nosniff reach the client through Caddy
Caddy no longer sets a CSP on /api/*
Manual check recorded in the PR: on a deploy, a crate's HTML file is sandboxed by arocapi's header, and an audio file opened directly plays in Chrome
ADR 0002's context reflects arocapi's sandboxing and the media exemption
The CORS registration has a terse comment saying why it is scoped to /api
Implemented in #63. A local caddy:2 run with the new Caddyfile in front of a stub passed arocapi's CSP and nosniff through unchanged, with no CSP on audio. Still open: the check on a real deploy (HTML sandboxed, audio opened directly plays in Chrome).
behind caddy:2 running deploy/Caddyfile, with DOMAIN=localhost and HTTPS from Caddy's local CA
a test crate under CC BY 4.0 with an HTML file and a WAV file, opened in Google Chrome
Headers through Caddy:
HTML: content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox (a single CSP, none added by Caddy), plus x-content-type-options: nosniff.
Audio: nosniff, and no CSP.
In Chrome:
HTML: the page's script was blocked ("Blocked script execution … because the document's frame is sandboxed and the 'allow-scripts' permission is not set"), and the page's origin was null.
Audio: opened directly, it played in Chrome's media player with no error (readyState 4, currentTime 1.36 s of 2 s).
Activity
johnf commentedon Nov 4, 2026
Implemented in #63. A local
caddy:2run with the new Caddyfile in front of a stub passed arocapi's CSP andnosniffthrough unchanged, with no CSP on audio. Still open: the check on a real deploy (HTML sandboxed, audio opened directly plays in Chrome).johnf commentedon Nov 4, 2026
Checked on a local deploy rather than the production host. The setup:
ghcr.io/language-research-technology/ldacapi:mainimage (258b923, the Align with arocapi 5 and rewrite the README in its terms #63 merge)caddy:2runningdeploy/Caddyfile, withDOMAIN=localhostand HTTPS from Caddy's local CAHeaders through Caddy:
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox(a single CSP, none added by Caddy), plusx-content-type-options: nosniff.nosniff, and no CSP.In Chrome:
null.readyState4,currentTime1.36 s of 2 s).All acceptance criteria met.