Commit graph

21 commits

Author SHA1 Message Date
359260fcef Fix deploy/rebuild: use absolute paths to avoid cd + Compose v5 CWD issues 2026-07-14 13:43:34 +00:00
36c0d7b2aa Fix docker compose deploy: pass -f docker-compose.yml explicitly for Compose v5 compatibility 2026-07-14 13:39:46 +00:00
db4bb4deb8 Add rebuild endpoint — docker compose up --build without git pull 2026-07-14 13:22:57 +00:00
f46fe07ca8 Stack-level backup: Nextcloud WebDAV + Docker volume backup via SSH
- backup container: builds from Dockerfile (adds openssh-client, curl, jq)
  fetches Nextcloud creds from Settings API at runtime, pg_dumps all DBs
  and tars Docker volumes on each app LXC via SSH, uploads to Nextcloud
  WebDAV, writes runs.ndjson log, heartbeats Uptime Kuma
- updater: gains docker-cli, Docker socket mount, /backup/runs,
  /backup/status, /backup/trigger endpoints; reads runs.ndjson for status
- kuma_data mounted read-only into backup container for local backup
- .env.example updated with SETTINGS_URL, SETTINGS_SECRET, PG_SUPERPASS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 11:03:59 +00:00
cc5fc99242 Fix SSH known_hosts noise — add UserKnownHostsFile=/dev/null to all SSH calls
/root/.ssh is mounted read-only in the management container, causing stderr
noise on every SSH connection. Routing to /dev/null avoids the write attempt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 09:38:56 +00:00
caf81d5f39 Add shell exec endpoint — POST /exec runs SSH command on any known container host
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 09:27:44 +00:00
20a8d50084 Fix git log SSH: split SHA and timestamp into separate calls to avoid shell quoting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 09:16:05 +00:00
e66164cdb7 Fix git log format — pipe in --format broken by remote shell, use space
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 09:14:55 +00:00
66355bd698 Add RAM and disk stats to health-status endpoint via SSH
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 09:04:22 +00:00
90c2e69d51 Replace execSync/exec shell interpolation with spawn arg arrays in updater
sshGet() and deploy() built SSH commands via template literal string
interpolation, which would allow shell injection if host/path values
from the app registry were tampered with. Replaced with spawnAsync()
using shell: false and explicit argv arrays. Added path validation
guard (/^\/opt\/[a-z0-9-]+$/) before both SSH calls. Also removes
the event-loop-blocking execSync in deploy().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 09:25:09 +00:00
568cd8d299 Fix webhook signature verification — raw body capture + Forgejo header support
- fastify-raw-body was never registered, so HMAC ran over re-serialised
  JSON and every Forgejo delivery failed with 401
- accept X-Forgejo-Signature / X-Gitea-Signature (bare hex) as well as
  the GitHub-style sha256= prefix, and reject length mismatches instead
  of crashing timingSafeEqual with a 500

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 13:54:37 +00:00
e2a86bf30f feat(updater): include commit timestamps in status response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 15:58:41 +00:00
c26f7e18b2 Replace static deploy-map with dynamic auth registry
updater now fetches app registry from auth /api/auth/internal/registry
and uses internal_host/internal_port for SSH status checks and deploys.
Removes hardcoded host map; platform infra (auth, portal, settings)
kept in INFRA_DEPLOY/INFRA_HEALTH constants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 20:49:39 +00:00
b120fbf44e Add settings service to deploy map and health monitor
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 19:23:25 +00:00
1d5b345ea4 Add force=true param to bypass status cache on manual refresh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 17:49:59 +00:00
dae5524dbc Fix health check treating 404 as unreachable
Apps without a /health route return 404 from nginx, but the service IS
running. Treat any HTTP response as up; only connection errors are down.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 17:43:32 +00:00
5b3b45a45c Add /health-status endpoint for live HTTP health checks
Parallel-fetches /health on each app LXC, returns up/down + response
time. Used by the portal Uptime tab instead of embedding Uptime Kuma.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-01 17:34:56 +00:00
cfb3986584 Remove management from deploy-map (can't self-update)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 17:14:50 +00:00
8fdf3c8e4e Async SSH for parallel status checks; Kuma 2 --base-path via CLI arg
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 17:13:38 +00:00
5984043e7c Updater: /status endpoint (Forgejo vs deployed commit), /deploy/:repo manual trigger
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 17:04:57 +00:00
ab329d497b Initial commit: management 2026-07-01 12:09:54 +00:00