diff --git a/deploy/compose-build-at-deploy.yml b/deploy/compose-build-at-deploy.yml index 107de16..1f3dc2d 100644 --- a/deploy/compose-build-at-deploy.yml +++ b/deploy/compose-build-at-deploy.yml @@ -118,6 +118,21 @@ services: # file, so `COACH_PROVIDER` sitting in the panel while the container never sees it is a # configuration that looks applied and does nothing. The `:-` defaults are what keep an # instance that sets none of them exactly as it was: an empty value reads as unset. + # + # ADMIN_UIDS is the one that bites hardest: it is the ONLY way to become an admin (nothing in + # the code sets `user.admin`), and without it named here an instance has no dashboard at all — + # no user list, no activity log, no invites, and the "Admin dashboard" row never appears in + # Settings. The rest of these are the instance's own switches and the activity log's bounds. + ADMIN_UIDS: ${ADMIN_UIDS:-} + INVITE_ONLY: ${INVITE_ONLY:-} + ALLOW_GUEST: ${ALLOW_GUEST:-} + SESSION_DAYS: ${SESSION_DAYS:-} + AUDIT_LOG: ${AUDIT_LOG:-} + AUDIT_MAX: ${AUDIT_MAX:-} + AUDIT_DAYS: ${AUDIT_DAYS:-} + AUDIT_IP: ${AUDIT_IP:-} + VAPID_SUBJECT: ${VAPID_SUBJECT:-} + REMINDER_TICK_MS: ${REMINDER_TICK_MS:-} COACH_PROVIDER: ${COACH_PROVIDER:-} COACH_BASE_URL: ${COACH_BASE_URL:-} COACH_MODEL: ${COACH_MODEL:-} diff --git a/docs/SELF_HOSTING.md b/docs/SELF_HOSTING.md index 17e7c44..295df96 100644 --- a/docs/SELF_HOSTING.md +++ b/docs/SELF_HOSTING.md @@ -118,7 +118,19 @@ ALLOW_GUEST=0 # remove "Continue without account" ``` Register your own passkey profile first, then find your id in `./data/db.json` under `users[].id` -and put it in `ADMIN_UIDS`. You'll get an **Admin dashboard** link in Settings: who's training +and put it in `ADMIN_UIDS`. + +**`ADMIN_UIDS` is the only way to become an admin** — nothing in the code ever sets `user.admin`, so +an instance that never sets this variable has no dashboard at all, and the *Admin dashboard* row does +not even appear in Settings (the app asks `/api/me`, which reports `admin: false`). On a deployment +whose compose lists the environment explicitly — `deploy/compose-build-at-deploy.yml` is one — the +variable also has to be *named* there, or it reaches the host and never the container. To read the +ids off a running instance: + +```bash +docker exec node -e \ + "const d=require('/data/db.json');console.log(d.users.map(u=>u.id+' '+u.name).join('\n'))" +``` You'll get an **Admin dashboard** link in Settings: who's training right now, each user's workout history and body weight, the ability to disable an account (signed out and locked out everywhere until you re-enable it), and — with `INVITE_ONLY=1` — generating and revoking invite codes. Existing accounts keep working when you switch invite-only on. Admin access