Deploy scripts: compose version check, ovpmon_backup.db in native backups

Docker: variant B needs Docker Compose 2.17+ (additional_contexts); install.sh
and update.sh check it in the preflight. Native: backup.sh, update.sh,
restore.sh and --rollback now copy and restore ovpmon_backup.db (Backup and
Restore settings) as an optional file. Verified install, update, backup,
restore and rollback on Debian 12 (systemd), Alpine 3.23 (OpenRC) and both
container variants.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ayurishchevandClaude Sonnet 5.5 committed 2026-10-07 12:58:42 +03:00
1 parent f8cdcd0fc6
commit 3fac8d70d8
11 files changed
+178 -7

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ Both variants use the **same five named volumes with the same in-container paths
## Requirements
- Docker Engine with the compose plugin (`docker compose`, v2, preferred) or `docker-compose`. **Variant B needs docker compose 2.17 or newer** (the profiler image is built with `additional_contexts`; the old `docker-compose` v1 does not support it). Variant A is not affected.
- Docker Engine with the compose plugin (`docker compose`, v2, preferred) or `docker-compose`. **Variant B needs docker compose 2.17 or newer** (the profiler image is built with `additional_contexts`; the old `docker-compose` v1 does not support it). Variant A is not affected. `install.sh` and `update.sh` check this in the preflight (phase 0) and stop with a message that names the required and the found version; an unreadable version only gives a warning.
- The Docker daemon running and usable by the user that runs the scripts (root, or a member of the `docker` group).
- Access to `/dev/net/tun` on the host and the `NET_ADMIN` capability (already set in the compose files).
- Free disk space: about 2 GB for images and builds, plus room for backups (the scripts check both).
+1 -1
View File
@@ -37,7 +37,7 @@ Variables of the scripts (environment of the shell, not `.env`): `OVPMON_BACKUP_
`ovp_backups` is not one of the five data volumes: `deploy/docker/backup.sh` and `update.sh` do not copy it (packages are not put inside copies of the volumes). Back it up separately or use a remote destination. See [Backup and Restore](../../Profiler_Management/Backup_Restore.md).
Variant B, profiler image: besides `APP_PROFILER` it holds `/opt/core` (`migrations.py`, `migrate.py`, `db.py` of `APP_CORE`, standard library only; `OVPMON_CORE_DIR=/opt/core`), added at build time through the build context `core` (`additional_contexts` in `docker-compose.yml`, docker compose 2.17+). The restore of a backup package uses it to migrate the monitoring database of the package.
Variant B, profiler image: besides `APP_PROFILER` it holds `/opt/core` (`migrations.py`, `migrate.py`, `db.py` of `APP_CORE`, standard library only; `OVPMON_CORE_DIR=/opt/core`), added at build time through the build context `core` (`additional_contexts` in `docker-compose.yml`, docker compose 2.17+; `install.sh` and `update.sh` check the version before the build). The restore of a backup package uses it to migrate the monitoring database of the package.
Not stored in volumes (lost when the container is recreated): the container file system, `profiler.log` and `openvpn_gatherer.log` (written into the working directory), supervisor state. Application logs go to `docker logs`.