feat: add host-side auto-updater for zero-touch API container rebuilds

When the in-container self-updater downloads a new version, it writes
trigger.json. The new systemd path unit watches for this file and runs
dashcaddy-update.sh, which backs up current API files, copies the new
ones, rebuilds the container, verifies health, and writes result.json.
Automatic rollback on build or health check failure.

Also fixes undefined `isWindows` variable in self-updater.js and adds
DASHCADDY_HOST_UPDATES_DIR env var to the installer's docker-compose
template for correct container-to-host path translation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-23 14:25:22 -07:00
parent abd54d4b99
commit d332084206
5 changed files with 231 additions and 0 deletions

View File

@@ -661,6 +661,7 @@ services:
- DASHCADDY_UPDATE_URL=https://get.dashcaddy.net/release
- DASHCADDY_MIRROR_URL=https://get2.dashcaddy.net/release
- DASHCADDY_UPDATES_DIR=/app/updates
- DASHCADDY_HOST_UPDATES_DIR=/opt/dashcaddy/updates
- DASHCADDY_API_SOURCE_DIR=${API_DIR}
- DASHCADDY_FRONTEND_DIR=/app/dashboard
extra_hosts: