Files
SciMesh/users/.env.example
T
Efremenko Arhip a7e949a0a7 feat(users): bootstrap first admin on startup
BOOTSTRAP_ADMIN_EMAIL/PASSWORD seed a role=admin account at boot if absent —
the only way to get the first admin, since /register makes plain users and
promotion needs an existing admin. Idempotent and race-safe. Tests included.
2026-07-26 19:44:06 +03:00

30 lines
1.2 KiB
Bash

# Copy to .env and adjust. All settings are read from the environment.
USERSERVICE_ADDR=:8081
DATABASE_URL=postgres://scimesh:scimesh@localhost:5433/scimesh_users?sslmode=disable
# Shared HS256 secret used to sign JWTs. The coordinator verifies tokens with
# this SAME secret, so the two values must match exactly. Minimum 32 bytes.
JWT_SECRET=change-me-to-a-long-random-secret-min-32-bytes
# How long an issued token stays valid.
JWT_TTL=24h
# bcrypt work factor. Empty/0 uses the library default (10).
# BCRYPT_COST=10
# First-admin bootstrap. When both are set and no such account exists, the
# service creates it with role=admin on startup (idempotent). This is the only
# way to get the first admin. Leave empty in production once seeded.
# BOOTSTRAP_ADMIN_EMAIL=root@scimesh.local
# BOOTSTRAP_ADMIN_PASSWORD=change-me-strong
# Logging. LOG_LEVEL: debug|info|warn|error. LOG_FILE empty = stdout only;
# set a path to also write a size-rotated file (kept across restarts).
LOG_LEVEL=info
# LOG_FILE=./logs/userservice.log
# Optional tuning (defaults shown).
DB_MAX_CONNS=10
# How long to keep retrying the initial DB connection while Postgres boots.
DB_CONNECT_TIMEOUT=30s
REQUEST_TIMEOUT=15s