Repository navigation
feat: hosh-deploy template mode (env port/data dirs, /healthz, HEALTHCHECK, deploy files) — legacy compose unchanged (PR 2/2) - #25
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_DIRfrom 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.HEALTHCHECK(node scripts/healthcheck.js);/dataowned by 10001 so a fresh volume is writable..tsrecompiled in a node:26 container;test/compile.test.jspasses.Box files
docker-compose.example.yml(10001, read-only, tmpfs, cap_drop ALL, nnp, pids 128, mem 512m,drawtogether-dataat/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
deploy.yml(template, no-op with a notice withoutHOSH_DEPLOY_KEY).deploy.yml→build-scan-push.yml, samename:, sosecurity-autofix.ymlstill matches.release.yml: legacy tag path unchanged (:vX.Y.Z+:latest; prereleases never:latest). Adds a legacy + template smoke before the push, and adeployjob for finalvX.Y.Ztags only.Tests
test/config.test.js.template.scripts/cutover-smoke.sh(CI jobcutover smoke (legacy -> hosh-deploy)): data made under the legacy compose → the DEPLOY.md data move verbatim →docker composewith the example + register hardening check (copy of hosh-deploy's) → healthy,/healthzon 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