Skip to content

health: surface auth-readiness config (fixes #2) - #3

Merged
ai-nlma merged 1 commit into
mainfrom
fix/health-auth-readiness
Jul 27, 2026
Merged

ai-nlma merged 1 commit into
mainfrom
fix/health-auth-readiness

Conversation

@ai-nlma

@ai-nlma ai-nlma commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Issue #2's diagnosis and proposed fix (bind-mount TURNO_DATA_DIR, migrate/delete tenants.json) describe an architecture that predates the stateless-JWT-bearer refactor already on main. There is no TURNO_DATA_DIR, TURNO_TENANTS_FILE, or tenant store anywhere in the current codebase — verified with a repo-wide grep, the only hits are historical notes in BUILDOUT.md/CLAUDE.md describing the migration away from that model. A docker-compose.yml volume mount for that path would be a no-op today; nothing reads or writes it.

What's likely actually going on in production: the VPS container was still running a pre-refactor build (the .legacy-tenant-store/ snapshot dated 2026-04-21 lines up with that), so redeploying current main should already resolve the enrollment/401 symptom — self-contained bearers mean there's no tenant file to lose.

That said, the underlying concern in the issue — a server that looks healthy on every external probe while being structurally unable to authenticate anyone — maps onto a real gap in the current design. The one persistent secret today is TURNO_ENCRYPTION_KEY; src/index.ts already refuses to boot in http mode without one, but /health gave no visibility into that config after boot.

Changes

  • GET /health now reports transport, enrollEnabled, and encryptionKeyConfigured, and flips status to "degraded" if the encryption key isn't usable.
  • Added an integration test asserting the new fields on a correctly-configured server.

Out of scope (not code changes)

  • No docker-compose.yml/Dockerfile changes — the tenant-store volume mount this issue proposed doesn't apply to current main's stateless design.
  • .legacy-tenant-store/ cleanup on the VPS is an ops task (already tracked as a BUILDOUT.md follow-up), not something a code PR can touch.

Test plan

  • npm run typecheck
  • npm test (22/22 passing, including new /health assertions)
  • npm run build

Closes #2.

Issue #2's diagnosis (TURNO_DATA_DIR/tenants.json bind mount) describes
pre-stateless-refactor architecture that no longer exists on main — the
current design has no tenant store to lose. The real single point of
failure today is TURNO_ENCRYPTION_KEY, and index.ts already fails fast
at boot if it's missing/short. But /health gave no visibility into that
config, so the "healthy-looking but structurally can't authenticate
anyone" failure mode this issue warns about was still possible.

/health now reports transport, enrollEnabled, and
encryptionKeyConfigured, and flips status to "degraded" if the key
isn't usable.
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.

turno-mcp cannot persist tenant enrollment — TURNO_DATA_DIR has no volume mount, every client 401s

1 participant