Files

58 lines
2.3 KiB
Bash

# Application Configuration
# Copy this file to .env and fill in your values
# cp .env.example .env
# === Postgres ===
# No fallback default in docker-compose.yml — a missing value must stop the
# stack, not silently start Postgres with a well-known password.
POSTGRES_PASSWORD=change-me
DATABASE_URL=postgres://service_center:change-me@postgres:5432/service_center?sslmode=disable
# === JWT ===
# Must be at least 32 characters — main.go fails fast at startup otherwise.
# An unset/short JWT_SECRET would let the auth package sign (and accept)
# HS256 tokens keyed on an empty or guessable string, letting anyone mint
# themselves an owner-role token. 32 bytes matches HS256's own recommended
# minimum key size. Generate one with: openssl rand -base64 32
JWT_SECRET=change-me-to-a-long-random-string-at-least-32-chars
JWT_EXPIRES_IN=12h
# === MinIO ===
# No fallback defaults — see POSTGRES_PASSWORD above for why.
MINIO_ENDPOINT=minio:9000
MINIO_ACCESS_KEY=change-me
MINIO_SECRET_KEY=change-me
MINIO_BUCKET=service-center
MINIO_USE_SSL=false
# === CORS ===
# Comma-separated origins the web frontend will be served from.
CORS_ORIGINS=http://localhost:5173
# === First owner account (bootstrap) ===
# staff.EnsureOwner (internal/staff/bootstrap.go) creates the first owner
# account from these three vars on startup, but only if the staff_users
# table is still empty — this is the only way to get in, since there is no
# public registration endpoint. Once any staff account exists, the bootstrap
# is a permanent no-op and these vars can be removed. Change the password
# after first login. OWNER_PASSWORD must be at least 8 characters.
OWNER_NAME=Owner
OWNER_EMAIL=owner@example.com
OWNER_PASSWORD=change-me-please
# === Caddy (standalone deploy only, see Caddyfile) ===
DOMAIN=localhost
# === Server (optional) ===
# Address the Fiber server listens on. Defaults to ":3000" in code if unset
# — only set this if you need something other than the default.
# LISTEN_ADDR=:3000
# === Replication (optional) ===
# Tailscale IP to bind the postgres/minio ports to for a standby replica's
# streaming replication / bucket mirroring, instead of the default
# 127.0.0.1 (loopback-only, no replica reachable). See the comments next to
# these port bindings in docker-compose.yml. Leave unset if you don't run a
# failover replica.
# TAILSCALE_IP=127.0.0.1