e63748c344
Adds backend/internal/devsandbox: an idempotent boot-time hook that, when BACKEND_DEV_SANDBOX_EMAIL is set, ensures (1) the configured engine_version row, (2) the real dev user, (3) PlayerCount-1 deterministic dummy users, (4) a private "Dev Sandbox" game with a year-out turn schedule, (5) memberships for every participant via the new lobby.Service.InsertMembershipDirect helper, (6) a drive of the lifecycle to running. Re-running on a populated DB is a no-op; partial states from earlier crashes are recovered. tools/local-dev gains the matching env vars in .env, surfaces them in compose, and acquires a `make build-engine` target that builds galaxy-engine:local-dev from game/Dockerfile (a prerequisite of `up`/`rebuild`). The compose game-state mount is changed from a named volume to a host bind on /tmp/galaxy-game-state so backend's bind-mount source for spawned engine containers resolves on the docker daemon. After `make -C tools/local-dev up`, login as dev@local.test with the dev code 123456 and the Dev Sandbox already shows up in My Games. Per-user behaviour for the same email survives a backend restart. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
19 lines
921 B
Bash
19 lines
921 B
Bash
# Default environment for `make -C tools/local-dev up`. The compose
|
|
# file reads these via ${VAR:-} expansions; override per-developer by
|
|
# editing this file (it is committed only with the project defaults).
|
|
|
|
# Six-digit decimal accepted by ConfirmEmailCode in addition to the
|
|
# real bcrypt-verified code. Leave the value blank to disable the
|
|
# override and force every login through Mailpit.
|
|
BACKEND_AUTH_DEV_FIXED_CODE=123456
|
|
|
|
# Boot-time dev sandbox (backend/internal/devsandbox). When EMAIL is
|
|
# non-empty the backend ensures a real user with that address, the
|
|
# configured number of dummy participants, a private "Dev Sandbox"
|
|
# game, and drives the lifecycle to running on every boot. Leave
|
|
# EMAIL blank to disable the bootstrap entirely.
|
|
BACKEND_DEV_SANDBOX_EMAIL=dev@local.test
|
|
BACKEND_DEV_SANDBOX_ENGINE_IMAGE=galaxy-engine:local-dev
|
|
BACKEND_DEV_SANDBOX_ENGINE_VERSION=0.1.0
|
|
BACKEND_DEV_SANDBOX_PLAYER_COUNT=20
|