feat(web): weekly automatic updates with health check and rollback

A General-tab toggle (off by default) checks for and installs LEDMatrix and
plugin updates once a week, overnight in the configured timezone.

- Pre-update checks skip (and report) instead of forcing: local edits or
  commits, merge/live rebase, no upstream, low disk, missing health check, or
  a version that was already rolled back. An abandoned rebase (HEAD back on a
  branch) is cleared, since it would otherwise block every pull.
- The pull reuses the Update Code path (now perform_core_update(), which
  reports dependency install failures as data).
- ledmatrix-update-verify.service, started via a .path unit from a request
  file, restarts the services from its own cgroup, requires them to come up
  and stay up, and otherwise resets to the previous commit and reinstalls the
  previous requirements. It runs a copy of the checker taken before the pull.
- No SSH needed: switching the toggle on restarts the display service, which
  (as root) installs the two units from the repo templates for the web user.
  first_time_install.sh installs them too and takes --enable-auto-update /
  LEDMATRIX_AUTO_UPDATE (passed through by one-shot-install.sh).
- Plugins update after the code passes its check; failures, blocks and
  rollbacks raise an Overview banner and show under the toggle.

Tested end to end on a Pi: web-UI setup, a good update, a broken web service
and a broken display (both rolled back), a blocked local edit, and an
abandoned rebase found on the device.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-14 17:37:35 -04:00
co-authored by Claude Opus 5
parent 6d1cbfb70b
commit 1eed7ff485
24 changed files with 2796 additions and 192 deletions
+8 -1
View File
@@ -525,8 +525,15 @@ def _load_general_partial():
try:
if pages_v3.config_manager:
main_config = pages_v3.config_manager.load_config()
try:
from web_interface.auto_update import describe_status
auto_update_status = describe_status(main_config)
except Exception:
logger.debug("Could not read auto-update status", exc_info=True)
auto_update_status = None
return render_template('v3/partials/general.html',
main_config=main_config)
main_config=main_config,
auto_update_status=auto_update_status)
except Exception as e:
logger.error("Error loading partial", exc_info=True)
return "Error loading partial", 500