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
@@ -64,7 +64,7 @@ deploy/docker/install.sh --variant b --project ovpmon --http-port 8080 --vpn-por
|
||||
What `install.sh` does:
|
||||
|
||||
1. **Preflight:** docker and compose, running daemon, the other variant is not running, no foreign container with the same names, ports free, free disk space.
|
||||
2. **`.env`** next to the compose files, only if it does not exist: mode 600, random `JWT_SECRET`, initial administrator with a generated 24-character password. An existing `.env` is never overwritten (`--http-port` / `--vpn-port` only set their own keys in it).
|
||||
2. **`.env`** next to the compose files, only if it does not exist: mode 600, random `JWT_SECRET`, initial administrator with a generated 24-character password. An existing `.env` is never overwritten (`--http-port` / `--vpn-port` only set their own keys in it). It also checks `OVPMON_CSP_CONNECT_EXTRA` when set (see [Reference](Reference.md)).
|
||||
3. **Build, start** (`docker compose up -d`), write the state file `.ovpmon-deploy` (variant and project; used by `update.sh`, `backup.sh`, `restore.sh`), wait up to 3 minutes for the health checks.
|
||||
4. **Initial administrator:** when the users table is not empty, `OVPMON_INITIAL_ADMIN_*` are removed from `.env` and the container that reads them is recreated (variant B: `app-api`, variant A: `ovpmon`). If the table cannot be read or is empty, the lines stay in `.env` and a warning says so.
|
||||
5. **Result:** URL, ports, and the administrator login and password. **The password is shown once** and stored nowhere else. `JWT_SECRET` is never printed.
|
||||
|
||||
@@ -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).
|
||||
@@ -8,6 +8,7 @@ Install: [Containers](README.md). Update and backup: [Operations](Operations.md)
|
||||
|---|---|
|
||||
| `port 80/tcp is already in use` | Another service uses the port. Install with `--http-port 8080` or set `OVPMON_HTTP_PORT` in `.env` (same for `OVPMON_VPN_PORT`) |
|
||||
| `container 'ovp-...' of the OTHER variant is running` | Variants A and B cannot run together. Stop the other stack first |
|
||||
| `OVPMON_CSP_CONNECT_EXTRA ... is invalid` (script) or `check-csp-connect-extra` in the log of a container that stops at start | The value is not a list of origins. Use `https://host[:port]` or `http://host[:port]` separated by spaces (no `;`, quotes, commas, paths, leading space) or leave it empty |
|
||||
| `container 'ovp-ui' ... belongs to compose project 'x'` | A stack of another project uses the fixed names. Use `--project x` or remove that stack |
|
||||
| Health check does not turn healthy | `docker compose ps`, then `docker compose logs --tail 100 <service>` (A: `docker logs ovp-allinone`). The scripts print the last log lines of failing services. The profiler allows 40 s and the all-in-one container 60 s before failures count |
|
||||
| `FATAL: ... newer than this version` / migration "too new" | The database was migrated by a newer release. Do not start the old version on it: update to the newer sources, or restore a matching backup (`update.sh --rollback` or `restore.sh`) |
|
||||
|
||||
Reference in new issue
Block a user