feat(updates): check Gitea automatically and deploy on owner confirmation

Add owner-only update controls, a read-only SSH checker and independent systemd deployment services. Build before maintenance; back up code and database; restore on failed deployment. Preserve runtime configuration and gate business writes during the switch.
This commit is contained in:
WangShen007 committed 2026-10-24 07:26:41 +00:00
1 parent ed8dc01ed9
commit f3ad539998
28 files changed
+1346 -1

No files matched your search

@@ -0,0 +1,11 @@
[Unit]
Description=Check ReplyPier Gitea main for updates (never installs)
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /opt/replypier-updater/cli.py check
ExecStopPost=/usr/bin/python3 /opt/replypier-updater/cli.py finish-check
TimeoutStartSec=180
UMask=0077
@@ -0,0 +1,11 @@
[Unit]
Description=Check ReplyPier updates every 30 minutes
[Timer]
OnBootSec=3min
OnUnitActiveSec=30min
Persistent=true
Unit=replypier-update-check.service
[Install]
WantedBy=timers.target
@@ -0,0 +1,15 @@
[Unit]
Description=Recover an interrupted ReplyPier deployment before accepting traffic
After=docker.service
Requires=docker.service
Before=replypier-backend.service replypier-knowledge.service
[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /opt/replypier-updater/cli.py recover-boot
RemainAfterExit=yes
TimeoutStartSec=20min
UMask=0077
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,14 @@
[Unit]
Description=Install the ReplyPier version explicitly confirmed by its owner
After=network-online.target docker.service
Requires=docker.service
[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /opt/replypier-updater/cli.py apply
ExecStopPost=/usr/bin/python3 /opt/replypier-updater/cli.py recover
TimeoutStartSec=2h
TimeoutStopSec=20min
KillMode=control-group
UMask=0077
Nice=10