Commit Graph
8 Commits
Author SHA1 Message Date
ayurishchevandClaude Sonnet 5.5 d38acd74de UI delivery, stage A: rebuild deploy/ui-dist from current APP_UI sources
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 13:19:27 +03:00
ayurishchevandClaude Sonnet 5.5 3fac8d70d8 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>
2026-10-07 12:58:42 +03:00
ayurishchevandClaude Sonnet 5.5 f8cdcd0fc6 Backup and Restore: packages, Local/S3/SFTP/FTP destinations, UI and API
Encrypted packages (databases, PKI, client profiles) with safe restore and
a pre-restore safety copy, usable for server-to-server migration across
container and system-service installs. New Management page, ovp_backups
volume, migrations code in the profiler image, server name in package names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 09:38:09 +03:00
ayurishchevandClaude Sonnet 5.5 ad6995bb63 Docs restructure, code review, gatherer reliability, JWT key fail-closed
Documentation
- Three levels: DOCS/General (overview, configuration), DOCS/Deployment
  (choose a method, first steps), details per method in Containers/ and
  System_Services/; new root README and DOCS/README map.
- Remove superseded pages (Deployment.md, Deployment_Docker/Native.md, Index.md);
  split the two scenario guides by section.
- Isolate the Timeweb/Hysteria2 records in DEPLOYMENTS/timeweb-hysteria2/
  (not linked from DOCS, listed in .graphifyignore).
- Add DOCS/code_review/ with a time-stamped analysis of the code base.

Gatherer (BUG-02, BUG-03)
- Session key (CN, address, connected_since_ts), baseline from the
  active_sessions snapshot, grace period for sessions missing from the status.
- Status file integrity (TITLE/TIME/END) and freshness; a torn read skips the tick.
- Cache applied after commit; main loop survives exceptions, backs off, and
  stops cleanly on SIGTERM/SIGINT; new client rows start with the first
  frame's totals; five tests.

JWT signing key (SEC-01)
- No built-in default: Core and Profiler refuse to start with a missing,
  placeholder or short (< 32) key; shipped config.ini has an empty value.
- Same rule in install.sh, update.sh (issues a new key when missing or weak),
  docker lib/entrypoint; five tests, conftest.py for the test key.

Each change has a plan and a summary under DOCS/Changes/.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 20:30:45 +03:00
ayurishchevandClaude Sonnet 5.5 f95a0b63e6 Native install: nftables script for VPN clients (masquerade, MSS clamp, TTL)
deploy/native/firewall.sh reads the server interfaces and applies, for traffic
from the VPN network to all other networks: masquerade, TCP MSS clamping
(path MTU tuning) and TTL tuning, in its own table `ip ovpmon`. Rules are
persisted in /etc/ovpmon/nftables.nft and loaded at boot by the ovpmon-nft
service (systemd and OpenRC). Opt-in: install.sh and update.sh do not call it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 14:48:39 +03:00
ayurishchevandClaude Sonnet 5.5 8371d889a4 Native install: mandatory install directory, UI delivered from the repository
- install.sh always asks for the install directory (--prefix or a prompt
  with confirmation, no default); refuses system directories, the
  repository checkout itself, paths inside/containing it and non-empty
  directories (a resumed install is allowed). A preflight refusal says
  nothing was changed.
- UI is part of the repository: committed build in deploy/ui-dist with
  SOURCE_HASH and a staleness guard (check-ui.sh, loud warning). install.sh
  and update.sh resolve the UI: --ui-dist FILE|DIR, --build-ui, committed
  build; install stops without a UI unless --no-ui. update.sh swaps the UI
  when its hash differs from the installed one (.ui-source-hash).
- build-ui.sh: --docker, --local (host Node >= 20.19, temporary copy),
  --node-download (portable Node, SHA-256 verified), --publish.
- Verified on Alpine 3.23: install without UI options installs the real UI;
  local build equals the Docker build; update skips an unchanged UI and
  warns on a stale build. --node-download is untested (needs network).
- Docs: Scenario 2 guide, change summary, plan, README.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 12:38:18 +03:00
ayurishchevandClaude Sonnet 5.5 4abd2044f0 Scenario 2: install and update as system services (Alpine, Debian, Ubuntu)
- deploy/native: install.sh, update.sh (backup, new code prepared aside,
  stop services, separate DB migration phase, start, automatic rollback;
  OpenVPN keeps running), backup.sh, restore.sh, build-ui.sh (Node 20
  container), lib.sh OS adapter (OpenRC and systemd).
- Root helper reads /etc/ovpmon/helper.conf (service manager, unit, config
  path), validated strictly; process.py/server.py honour OVPMON_RUNTIME,
  OVPMON_OPENVPN_SERVICE, OVPMON_OPENVPN_CONFIG. Debian/Ubuntu use
  openvpn-server@server and /etc/openvpn/server/server.conf.
- Service definitions rewritten (systemd, OpenRC). Fixes found by real runs:
  no seccomp-based options in the profiler unit (they imply NoNewPrivileges
  and break setuid doas); OpenRC start_pre extends PATH instead of
  replacing it; helper syntax check works on a read-only tree.
- Verified in containers with real init systems (Debian 12, Ubuntu 24.04,
  Alpine 3.23): install, PKI/server config/OpenVPN start, update on
  pre-versioned databases, rollback, backup/restore.
- Test: test_helper_config.py. Docs: Scenario 2 guide, change summary,
  README, Index.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 10:45:24 +03:00
ayurishchevandClaude Sonnet 5.5 1c49d0b9c2 Scenario 1: container install and update (all-in-one and per-component)
- Variant B: docker-compose.yml gets configurable host ports and health
  checks. Variant A: deploy/allinone image (nginx, supervisord, gunicorn,
  uvicorn, gatherer, OpenVPN) with an explicit database migration step
  before any service; docker-compose.allinone.yml. Same five volumes and
  paths in both variants.
- deploy/docker: install.sh, update.sh (backup, build, stop, separate DB
  migration phase, start, automatic rollback), backup.sh, restore.sh, lib.sh.
- Verified on Docker: install A/B, update with pre-versioned databases,
  rollback after an injected failure, backup/restore.
- Docs: Scenario1_Containers guide, change summary, README, Index;
  .dockerignore, .gitignore additions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 09:24:55 +03:00