UI delivery: plan, summary and docs (CSP origins, --csp-connect-extra, nginx-unprivileged)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3347fffe8e
commit
b61989bd22
13 files changed
+203
-9
No files matched your search
@@ -49,4 +49,12 @@ The UI is served by Nginx in production and proxies API requests to:
|
||||
See [Deployment Guide](../Deployment/README.md) for Nginx configuration details.
|
||||
|
||||
## Web server headers (container image)
|
||||
`APP_UI/default.conf.template` (also used by the all-in-one image) sends `X-Content-Type-Options`, `X-Frame-Options: DENY`, `Referrer-Policy: no-referrer` and a CSP (`default-src 'self'`, inline styles allowed, `img-src`/`font-src` with `data:`, `connect-src 'self'`), compresses text files, serves `/assets/` with `immutable` caching and `index.html`/`config.json` with `no-cache`. If `config.json` points to another origin, add it to `connect-src`. The system-service nginx (`deploy/native/nginx`) has its own headers.
|
||||
`APP_UI/default.conf.template` (also used by the all-in-one image) sends `X-Content-Type-Options`, `X-Frame-Options: DENY`, `Referrer-Policy: no-referrer` and a CSP (`default-src 'self'`, inline styles allowed, `img-src`/`font-src` with `data:`, `connect-src 'self'` plus optional extra origins), compresses text files, serves `/assets/` with `immutable` caching and `index.html`/`config.json` with `no-cache`.
|
||||
|
||||
The CSP is written once (`set $csp "..."` in the `server` block) and sent with `add_header Content-Security-Policy $csp always` in the `server` block and in `location /assets/` (a location with its own `add_header` does not inherit the server ones).
|
||||
|
||||
**API on another origin.** If `config.json` points the UI to another origin, list it in `OVPMON_CSP_CONNECT_EXTRA` (inside the containers `OVP_CSP_CONNECT_EXTRA`): origins `https://host[:port]` or `http://host[:port]` separated by spaces, empty by default (same origin only). The value goes into a response header, so anything but origins is refused (`;`, quotes, commas, paths, a leading space): by the deploy scripts, by the all-in-one entrypoint and by `/docker-entrypoint.d/15-check-csp-connect-extra.sh` of the `app-ui` image (the container stops with a message). The API on the other origin must also allow this UI origin in `OVPMON_CORS_ORIGINS`.
|
||||
|
||||
The `app-ui` image is based on `nginxinc/nginx-unprivileged:alpine`: nginx runs as the user `nginx` (uid 101) and listens on `OVP_UI_PORT` (8080 in the image); docker-compose publishes it as the host port `OVPMON_HTTP_PORT` (default 80). In the all-in-one image the same template listens on 80 (the supervisor runs everything as root, OpenVPN needs it).
|
||||
|
||||
The system-service nginx (`deploy/native/nginx/ovpmon.conf.template`) sends the same CSP (headers are declared on the `server` level only); extra origins are set with `install.sh` / `update.sh --csp-connect-extra`, see [System services](../Deployment/System_Services/README.md).
|
||||
Reference in new issue
Block a user