a134c47152
Gate a new /api/admin/* route set (register/list/update/delete servers) behind a single shared MCMAPPER_ADMIN_TOKEN header, and add a /admin frontend page (Alpine) to unlock, register new servers, and edit authMode/anonymousChatAllowed/waypointFormat per server — these columns already existed but were only editable via direct DB edit until now. Written test-first per the project's TDD workflow: admin.ts's domain logic, the index.ts route wiring, and a new e2e/tests/admin.spec.ts covering the token gate and register/edit/delete round trip through the real browser UI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015tKdPZt78zbPUZMXWzKEKt
29 lines
1.6 KiB
Bash
29 lines
1.6 KiB
Bash
PORT=3000
|
|
DATABASE_URL=postgres://mcmapper:mcmapper@postgres:5432/mcmapper
|
|
REDIS_URL=redis://redis:6379
|
|
|
|
# Tiles/meshes live in a dedicated `mcmapper-tiles` bucket on a shared MinIO instance rather
|
|
# than a per-stack container — see README.md's "Object storage" section for how the bucket and
|
|
# this scoped access key (read/write on mcmapper-tiles only, nothing else) were provisioned.
|
|
# 192.168.0.3:28205 is that instance's LAN address; swap for the public gateway
|
|
# (MINIO_ENDPOINT=s3.octoturge.com, MINIO_PORT=443, MINIO_USE_SSL=true) if this stack isn't on
|
|
# the same LAN. MINIO_SECRET_KEY is real and must NOT be committed — set it in an untracked
|
|
# `.env` next to this file (docker-compose layers it on top, see docker-compose.yml).
|
|
MINIO_ENDPOINT=192.168.0.3
|
|
MINIO_PORT=28205
|
|
MINIO_USE_SSL=false
|
|
MINIO_ACCESS_KEY=mcmapper
|
|
MINIO_SECRET_KEY=changeme-set-in-untracked-env
|
|
|
|
# Only read by `bun run seed` (see scripts/seed-server.ts) — the admin panel's "register a new
|
|
# server" form (MCMAPPER_ADMIN_TOKEN below) is now the real registration path; this script is
|
|
# kept around as a fallback for scripted/headless setup.
|
|
MCMAPPER_SEED_SERVER_NAME=dev-server
|
|
MCMAPPER_SEED_SERVER_TOKEN=changeme
|
|
|
|
# Gates every /api/admin/* route (server registry + settings — see api/src/admin.ts) behind a
|
|
# single shared secret, checked via the X-MCMapper-Admin-Token header. Left unset here on
|
|
# purpose: an unset token disables admin routes entirely (401) rather than defaulting to open.
|
|
# Set a real value in an untracked `.env` next to this file, same as MINIO_SECRET_KEY above.
|
|
MCMAPPER_ADMIN_TOKEN=
|