- 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>
36 lines
1.1 KiB
Desktop File
36 lines
1.1 KiB
Desktop File
# managed by ovpmon deploy/native (install.sh / update.sh replace this file only while this marker line is present)
|
|
#
|
|
# OpenVPN Monitor gatherer (reads the OpenVPN status log into the monitoring database, APP_CORE).
|
|
# Install: see ovpmon-api.service. Settings come from /etc/ovpmon/env.
|
|
# The gatherer starts and keeps running while OpenVPN is down (it waits for the status log).
|
|
[Unit]
|
|
Description=OpenVPN Monitor Gatherer
|
|
After=network.target
|
|
Wants=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=ovpmon
|
|
Group=ovpmon
|
|
EnvironmentFile=/etc/ovpmon/env
|
|
WorkingDirectory=/opt/OpenVPN-Monitoring-Simple/APP_CORE
|
|
ExecStart=/opt/OpenVPN-Monitoring-Simple/APP_CORE/venv/bin/python openvpn_gatherer_v3.py
|
|
Restart=always
|
|
RestartSec=3
|
|
|
|
# Hardening: code and virtualenv are root-owned and read-only for the service
|
|
NoNewPrivileges=yes
|
|
PrivateTmp=yes
|
|
ProtectHome=yes
|
|
ProtectSystem=full
|
|
ProtectKernelTunables=yes
|
|
ProtectKernelModules=yes
|
|
ProtectControlGroups=yes
|
|
RestrictRealtime=yes
|
|
LockPersonality=yes
|
|
# Write access: monitoring database (and its migration backups) and logs
|
|
ReadWritePaths=/var/lib/ovpmon /var/log/ovpmon
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|