Authoritative deploy orchestrator. Split out of coder-core 2026-05-21 to break the self-rebuild loop.
  • JavaScript 99.4%
  • Dockerfile 0.5%
  • Shell 0.1%
Find a file
2026-08-10 21:30:15 +00:00
app-inspect.test.js fix(api): close redaction and bridge gaps found in hostile review 2026-08-10 21:13:29 +00:00
compose-redact.js fix(api): close redaction and bridge gaps found in hostile review 2026-08-10 21:13:29 +00:00
compose-service-discovery.test.js feat(api): expose authoritative app structure to off-host callers 2026-08-10 21:07:00 +00:00
deploy-compose fix(engine): fail closed without vault injection 2026-07-15 05:59:11 +00:00
docker-compose.yml fix(auth): require dedicated operational credentials 2026-08-10 00:32:50 +00:00
Dockerfile fix(build): enable BuildKit with buildx 2026-07-17 01:09:58 +00:00
kua.json fix(engine): use sol-prod local execution and Docker-network git 2026-07-15 01:32:05 +00:00
NOTES-image-digest-pinning.md feat: initial commit — extracted from coder-core/services/kua-deploy 2026-05-21 18:04:45 -04:00
package-lock.json feat: initial commit — extracted from coder-core/services/kua-deploy 2026-05-21 18:04:45 -04:00
package.json fix(registry): compare nested entries canonically 2026-08-09 07:39:11 +00:00
README.md fix(engine): fail closed without vault injection 2026-07-15 05:59:11 +00:00
registry-diff.js fix(registry): compare nested entries canonically 2026-08-09 07:39:11 +00:00
registry-diff.test.js fix(registry): compare nested entries canonically 2026-08-09 07:39:11 +00:00
server.js fix(api): close redaction and bridge gaps found in hostile review 2026-08-10 21:13:29 +00:00
service-proxy.test.js fix(auth): require dedicated operational credentials 2026-08-10 00:32:50 +00:00

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. Joins kua-services + production_proxy networks.
  • deploy-compose — mandatory production compose wrapper; injects kua-deploy/prod from kua-vault.
  • kua.json — release-app manifest (mode: direct, server: sol-prod).
  • NOTES-image-digest-pinning.md — design notes for deferred prevention #4.

Registry

The registry is engine-owned persistent state at /app/data/registry.json on the kua-services_kua-deploy-data volume. A fresh volume may seed from the image, but Git is not the runtime source of truth.

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.

For direct operator compose commands, always use the vault wrapper:

./deploy-compose build
./deploy-compose up -d --force-recreate

The compose file requires both the admin token and scoped-token JSON, so a plain docker compose up fails during interpolation before it can replace the healthy container with an unauthenticated/degraded one. A plain docker restart kua-deploy is safe because Docker retains the environment baked into the existing container.

See also

  • services/kua-deploy/NOTES-image-digest-pinning.md in this repo
  • infra-docs/docs/04-operations/deploy-listener.md in coder-core (current-state callout + deploy_mode reference)