Skip to content

feat: hosh-deploy template mode (env port/data dirs, /healthz, HEALTHCHECK, deploy files) — legacy compose unchanged (PR 2/2) - #25

Merged
pazka merged 1 commit into
masterfrom
agent/hosh-deploy
Nov 6, 2026
Merged

pazka merged 1 commit into
masterfrom
agent/hosh-deploy

Conversation

@pazka

@pazka pazka commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Second step of moving draw.hosh.it to hosh-deploy (pazka/hosh-management#5, X.28k). Follows #24 (legacy-compose tests).

Backward compatible

With no env the image behaves exactly as before: port 80, /app/front/build/uploads, /app/.node-persist/storage. container smoke (legacy) (the box's compose verbatim) stays a gate; the release workflow also runs it on the candidate before pushing.

App

  • PORT, UPLOADS_DIR, PERSIST_DIR from env (Services/paths.ts, env.ts); uploads stay at /uploads/….
  • GET/HEAD /healthz → {"status":"ok","uploads":"writable","store":"writable","rooms":n} (503 otherwise), registered before the room routes (so it creates no room), not logged.
  • Image HEALTHCHECK (node scripts/healthcheck.js); /data owned by 10001 so a fresh volume is writable.
  • .ts recompiled in a node:26 container; test/compile.test.js passes.

Box files

docker-compose.example.yml (10001, read-only, tmpfs, cap_drop ALL, nnp, pids 128, mem 512m, drawtogether-data at /data, 127.0.0.1:9135:8000), .env.example (no secret), deploy/hosh-deploy.conf (POST_DEPLOY = node /app/scripts/capability-smoke.js http://127.0.0.1:8000), deploy/traefik-route.yml.tmpl, docs/BOX-CONTRACT.md, DEPLOY.md with §5 "Cutover from legacy".

Workflows

  • New deploy.yml (template, no-op with a notice without HOSH_DEPLOY_KEY).
  • Old deploy.yml → build-scan-push.yml, same name:, so security-autofix.yml still matches.
  • release.yml: legacy tag path unchanged (:vX.Y.Z + :latest; prereleases never :latest). Adds a legacy + template smoke before the push, and a deploy job for final vX.Y.Z tags only.

Tests

  • test/config.test.js.
  • Smoke mode template.
  • scripts/cutover-smoke.sh (CI job cutover smoke (legacy -> hosh-deploy)): data made under the legacy compose → the DEPLOY.md data move verbatim → docker compose with the example + register hardening check (copy of hosh-deploy's) → healthy, /healthz on BIND, POST_DEPLOY → identical rooms/image → restart → rollback to legacy.

Ran locally: the server tests (26/26), all 4 smoke modes, and the cutover rehearsal all pass.


Generated by Claude Code

…CHECK, deploy files), legacy compose unchanged

Makes draw.hosh.it deployable by hosh-deploy (box standard, Decision #16) while every image keeps
working with the box's legacy compose until the cutover:
- PORT, UPLOADS_DIR, PERSIST_DIR from the env (Services/paths.ts, env.ts); defaults = today's port 80,
  /app/front/build/uploads and node-persist's .node-persist/storage. Uploads keep their /uploads/ URL.
- GET/HEAD /healthz: uploads + store writable (dotfile probes), room list readable; 503 otherwise;
  registered before the room routes, not logged. Image HEALTHCHECK (node scripts/healthcheck.js);
  /data owned by 10001 so a fresh volume is writable.
- docker-compose.example.yml (10001, read-only, tmpfs, cap_drop ALL, pids/mem, drawtogether-data at
  /data, 127.0.0.1:9135:8000), .env.example, deploy/hosh-deploy.conf (POST_DEPLOY = capability smoke),
  deploy/traefik-route.yml.tmpl, docs/BOX-CONTRACT.md, DEPLOY.md incl. "Cutover from legacy".
- workflows: deploy.yml (template; no-op without HOSH_DEPLOY_KEY); the old deploy.yml is now
  build-scan-push.yml (same name, security-autofix unchanged); release.yml smokes the candidate in the
  legacy and template layouts before pushing and calls deploy only for final vX.Y.Z tags; the legacy
  tag path (:vX.Y.Z + :latest, prereleases never :latest) is unchanged.
- tests: test/config.test.js, smoke mode `template`, scripts/cutover-smoke.sh (legacy data -> the
  documented data move -> compose + register check -> POST_DEPLOY -> rollback), CI jobs for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016BZvd34vuBdbkgjXBip3VN
@pazka
pazka merged commit cb136ac into master Nov 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant