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:
ayurishchevandClaude Sonnet 5.5 committed 2026-10-07 13:33:27 +03:00
1 parent 3347fffe8e
commit b61989bd22
13 files changed
+203 -9

No files matched your search

+4 -3
View File
@@ -9,7 +9,8 @@ Configuration (`.env`), ports and volumes of the container installation. Install
| `JWT_SECRET` | yes | none (compose refuses to start) | Signing key of both APIs (`OVPMON_API_SECRET_KEY`). At least 32 characters, no `change-me`/`changeme`: `install.sh`, `update.sh` and the all-in-one container refuse a weak value. Changing it logs every user out. Keep the same value across updates |
| `OVPMON_INITIAL_ADMIN_USER`, `OVPMON_INITIAL_ADMIN_PASSWORD` | first start only | empty | Seed for the first user, used only while the users table is empty. Removed by `install.sh` afterwards |
| `OVPMON_CORS_ORIGINS` | no | empty (off) | Comma-separated extra origins; the UI is same-origin behind nginx |
| `OVPMON_HTTP_PORT` | no | `80` | Host port of the UI |
| `OVPMON_HTTP_PORT` | no | `80` | Host port of the UI (variant B: mapped to port 8080 of `ovp-ui`, variant A: to port 80 of `ovp-allinone`) |
| `OVPMON_CSP_CONNECT_EXTRA` | no | empty | Extra origins in the `connect-src` of the Content-Security-Policy, for a UI whose `config.json` points to an API on another host: `https://host[:port]` or `http://host[:port]`, separated by spaces (quote the value when there are several). Anything else is refused with a message by `install.sh` / `update.sh` and by the containers at start (the value goes into a response header). Passed to the containers as `OVP_CSP_CONNECT_EXTRA`; apply with `docker compose up -d` (the container is recreated) |
| `OVPMON_VPN_PORT` | no | `1194` | Host UDP port of OpenVPN (the container side is always 1194) |
Variables of the scripts (environment of the shell, not `.env`): `OVPMON_BACKUP_DIR` (backup root, default `./backups`), `OVPMON_BACKUP_IMAGE` (helper image, default `alpine:3`), `OVPMON_HEALTH_TIMEOUT` (seconds, default 180), `OVPMON_MIN_FREE_MB` (docker data, default 2048), `OVPMON_MIN_FREE_BACKUP_MB` (backups, default 1024).
@@ -20,7 +21,7 @@ Variables of the scripts (environment of the shell, not `.env`): `OVPMON_BACKUP_
| Port | Published | Purpose |
|---|---|---|
| `${OVPMON_HTTP_PORT:-80}/tcp` | yes | UI and reverse proxy to both APIs (plain HTTP) |
| `${OVPMON_HTTP_PORT:-80}/tcp` | yes | UI and reverse proxy to both APIs (plain HTTP). Inside the container: `8080` in variant B (`ovp-ui` runs nginx as the unprivileged user `nginx`), `80` in variant A. Custom compose files or a proxy that target port 80 of `ovp-ui` must be changed to 8080 |
| `${OVPMON_VPN_PORT:-1194}/udp` | yes | OpenVPN |
| `5001` (monitoring API), `8000` (profiler API) | no | variant B: `expose`d on `ovp-net` only; variant A: listen on `127.0.0.1` inside the container |
@@ -51,4 +52,4 @@ The profiler resolves `easy-rsa/` and `client-config/` relative to its working d
Processes in `ovp-allinone` (`deploy/allinone/supervisord.conf`, started in this order, all with `autorestart`, logs to stdout/stderr): `gatherer`, `api` (`gunicorn -w 2 -b 127.0.0.1:5001 openvpn_api_v3:app`), `profiler` (`uvicorn` on `127.0.0.1:8000`, no reload), `nginx`. OpenVPN is started by the profiler API on request (direct start inside containers), as in variant B.
`deploy/allinone/entrypoint.sh` runs before `supervisord`: secret mapping (`JWT_SECRET` → `OVPMON_API_SECRET_KEY` when only the first is set), `/dev/net/tun`, easy-rsa workspace (copied only when the volume does not have it yet), NAT and MSS rules without duplicates, the nginx configuration rendered from `APP_UI/default.conf.template` for `127.0.0.1`, then the **database migration as an explicit step**: the container does not start if it fails. The services then run with `OVPMON_AUTO_MIGRATE=0` (they only verify the schema).
`deploy/allinone/entrypoint.sh` runs before `supervisord`: secret mapping (`JWT_SECRET` → `OVPMON_API_SECRET_KEY` when only the first is set), `/dev/net/tun`, easy-rsa workspace (copied only when the volume does not have it yet), NAT and MSS rules without duplicates, the nginx configuration rendered from `APP_UI/default.conf.template` for `127.0.0.1` (port 80, CSP origins from `OVP_CSP_CONNECT_EXTRA`, checked first: an invalid value stops the container), then the **database migration as an explicit step**: the container does not start if it fails. The services then run with `OVPMON_AUTO_MIGRATE=0` (they only verify the schema).