feat: dockerize dev stack and add first-run admin bootstrap #1
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/dev-stack-bootstrap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dev stack in Docker:
just dev-uptojust devto match the backup-manager convention; document the trailing-args pattern that goes todocker compose up.mokosh-serverservice tocompose.dev.yml. Builds from the devDockerfile, mounts source for live reload, depends on Infisical health, reaches the host PostgreSQL viahost.docker.internal:host-gateway, and connects to Infisical inside the network ashttp://infisical:8080.4301. Bind to the host's private LAN IP (br0/eth0) instead of127.0.0.1. Thejust devrecipe discovers the IP at runtime withsys net | where name =~ 'eth0|br0'and writesMOKOSH_HOST_BIND_IPinto.env. This keeps the port off the public internet on a VPS while still allowing sibling Docker containers on the host to connect.127.0.0.1forMOKOSH_HOST_BIND_IPwhen unset sojust dev-downandjust dev-cleanparse cleanly before the firstjust dev.DATABASE_URL_IN_CONTAINER,MOKOSH_PORT,JWT_SECRET, andENCRYPTION_KEYto.env.devwith dev-only defaults.EXPOSEin the devDockerfilefrom 8080 to 4301 to match.First-run admin bootstrap:
src/modules/auth/bootstrap.rs. When bothADMIN_EMAILandADMIN_PASSWORDare set AND theuserstable is empty, the server creates asuper_adminuser under the default tenant on startup, marks itactivewithemail_verified_at = NOW(), and hashes the password with the existing Argon2id helper. Once any user exists the env vars are ignored, so it is safe to leave them in place during development.ADMIN_USERNAME/ADMIN_PASSWORDpattern invervain-server.main.rsafter migrations; bootstrap failures are logged-but-non-fatal so the server still starts..env.devships dev defaults (admin@example.com/devpassword12);.env.exampledocuments the pattern with blank fields.Docs:
README.mdcovering architecture, prerequisites, quick start, configuration, recipes, Infisical bootstrap, admin bootstrap, migrations, Docker images, repo layout, releases. Nushell syntax throughout.Signed-off-by: David Randall David@NiceGuyIT.biz