The registry was a git-committed file bind-mounted :ro from coder-core AND hand-patched live — two writers, neither authoritative. Root cause of the reconcile commits, dirty-tree deploy blocks, main-push gating, and multi-session collisions (codex/gpt-5.5 audited). - Registry is now ENGINE-OWNED at /app/data/registry.json (persistent volume), seeded once from the legacy bind-mount on first boot, never overwritten thereafter. - New authenticated mutation API: PUT/PATCH/DELETE /api/v1/apps/:app (+ ?dry_run=1 returns a normalized diff, no write), GET /api/v1/registry/export (+ timestamped snapshot). - Atomic writeRegistry (temp+rename), in-process mutation lock, schema validateEntry (allowed servers, branch-name safety, required fields). - Append-only hash-chained audit at /app/data/registry-events.jsonl (actor from request identity, before/after, prev_hash/event_hash). - FIX: audit.log moved /app/logs -> /app/data (the /app/logs path was never mounted, so the audit trail was lost on every restart). - compose: removed the deploy-registry.json git bind-mount. Clients (kua-app, kua-mcp-core) migrate to the API in a follow-up; git becomes an export sink, not the source of truth. |
||
|---|---|---|
| Dockerfile | ||
| NOTES-image-digest-pinning.md | ||
| README.md | ||
| docker-compose.yml | ||
| kua.json | ||
| package-lock.json | ||
| package.json | ||
| server.js | ||
README.md
kua-deploy
Authoritative deploy orchestrator for the Kua infrastructure fleet. Receives release triggers (admin API and Forgejo webhooks), runs git-pull → migration gate → docker build → recreate → SHA-verify on managed apps.
Split out of coder-core/services/kua-deploy/ on 2026-05-21 to break the self-rebuild loop that ran every coder-core release through this service as a side-effect.
Layout
server.js— Fastify app exposing/api/v1/apps/:app/deploy,/progress,/runtime-status,/webhook/forgejo.Dockerfile— node:22-alpine + docker-cli + ssh + git + kua-vault binary (mounted at runtime).docker-compose.yml— single-service compose project. Joinskua-services+production_proxynetworks.kua.json— release-app manifest (mode: direct,server: bruno).NOTES-image-digest-pinning.md— design notes for deferred prevention #4.
Registry
deploy-registry.json lives in coder-core/services/kua-deploy/deploy-registry.json and is bind-mounted in at /app/deploy-registry.json. This is a transitional arrangement; a future change can migrate the registry into this repo.
Deploying kua-deploy
Via release-app:
release-app kua-deploy
Which goes through kua-deploy's own admin POST /api/v1/apps/kua-deploy/deploy and uses the transient-container recreate pattern (Phase A) so the service can replace its own running container without false-success.
See also
services/kua-deploy/NOTES-image-digest-pinning.mdin this repoinfra-docs/docs/04-operations/deploy-listener.mdin coder-core (current-state callout + deploy_mode reference)