chore(security): MED cluster — Coolify URL scrub + isCurrent device-id + SLEEP_DURATION migration note

- Coolify runbook + audit briefs scrub the live deploy URL to a
  placeholder (Sec-MED-2). Real values live in repo secrets.
- /api/auth/me/devices isCurrent now compares against the session's
  device id, not the unauthenticated X-Device-Id header (Sr-MED-5).
- Migration 0036 sleep-duration unit shift documented + verification
  command added to the coolify-auto-deploy howto.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Marc-André BombeckandClaude Opus 4.7 committed 2026-05-11 02:44:12 +02:00
1 parent 650f150353
commit 1a46bfe78a
5 files changed
+136 -10

No files matched your search

@@ -15,6 +15,18 @@
-- this enum value yet (per the v1.4.23 W1 research), so the change is
-- effectively schema-only — the application enforces the new unit going
-- forward via `getUnitForType()`.
--
-- Pre-deploy verification (v1.4.23 W6 reconcile, Sec MED cluster):
-- Before tagging v1.4.23 the maintainer MUST run
-- psql -c "select count(*) from measurements where type = 'SLEEP_DURATION'"
-- and confirm the result is `0`. If the count is non-zero, this
-- migration's "schema-only" assumption no longer holds and the operator
-- has to ship a one-shot data-migration multiplying every existing
-- SLEEP_DURATION row's `value` column by 60 (hours → minutes) BEFORE
-- this migration is applied. Skipping the check would silently rewrite
-- the unit semantics on rows that were ingested under the old contract,
-- shrinking displayed sleep duration by 60× without rewriting the
-- stored numeric.
-- ── MeasurementType — append 7 Apple-Health-shaped enum values ──────