# hezarfen_backend.env — production secrets for the podman compose stack. # # One-time setup ON THE VPS, by hand: # mkdir -p ~/hezarfen_backend # cp hezarfen_backend.env.example ~/hezarfen_backend/hezarfen_backend.env # # chmod 0600 ~/hezarfen_backend/hezarfen_backend.env # # The deploy NEVER creates, overwrites, or uploads this file — the operator # owns it; compose only reads it (compose --env-file, plus env_file into the # backend container). Plain KEY=value lines: no quotes, no `export`. # # POSTGRES_*/BUILDER_*/ZO_*/AI_* are ALSO compose interpolations (the stack # file builds DATABASE_URL and the postgres/openobserve config from them). # Every other key (COOKIE_SECURE, TRUST_PROXY, CORS_*, RATE_LIMIT_*, OTEL_*, # DEPLOY_ENV) is passed into the backend container verbatim via env_file. # ── Postgres (first boot) ──────────────────────────────────────────────────── # POSTGRES_PASSWORD is baked into the pgdata volume on the FIRST `compose up`; # changing it here later does NOT re-key the database. Set the real password # BEFORE the first production start. It is interpolated into DATABASE_URL, so # it must be URL-safe: no `@`, `:`, or `/`. POSTGRES_USER=hezarfen POSTGRES_PASSWORD= POSTGRES_DB=hezarfen_control # ── First-boot builder (operator) account ──────────────────────────────────── # Seeded once on boot if the username doesn't exist; existing accounts are # never promoted to builder or re-keyed (resolve conflicts by hand). BUILDER_USERNAME=builder BUILDER_PASSWORD= # ── HTTP posture ───────────────────────────────────────────────────────────── # Session-cookie Secure flag: true (the stack sits behind a TLS reverse proxy). COOKIE_SECURE=true # Derive client IPs from X-Forwarded-For behind the reverse proxy: true. TRUST_PROXY=true # Browser origins allowed to send the credentialed session cookie, # comma-separated. A lone `*` mirrors EVERY origin with credentials — list the # real frontends once known. CORS_ALLOWED_ORIGINS= # ── AI bridge (QUIC over UDP 8090) ─────────────────────────────────────────── # Empty overrides the laptop compose default (0.0.0.0:8090 / change-me) and # keeps the bridge off. Set BOTH to enable; address without token fails boot. AI_QUIC_ADDR= AI_SHARED_TOKEN= # Per-request deadline; defaults to 30s. Anything above the 300s stale-answer # horizon is clamped down at startup. #AI_REQUEST_TIMEOUT_SECS=30 # ── Telemetry (OpenObserve over OTLP) ──────────────────────────────────────── # Leave commented to keep export off (stdout logs only). Uncomment the # endpoint after ZO_ROOT_USER_* below are set. The backend mints # Authorization=Basic from those two values — do not set # OTEL_EXPORTER_OTLP_HEADERS unless the collector is not this OpenObserve. #OTEL_EXPORTER_OTLP_ENDPOINT=http://openobserve:5081 #OTEL_SERVICE_NAME=hezarfen_backend #DEPLOY_ENV=production # ── OpenObserve root account (first boot) ──────────────────────────────────── # OpenObserve enforces a password policy — 8-128 chars, upper + lower + digit # + special — and panics on boot otherwise. ZO_ROOT_USER_EMAIL= ZO_ROOT_USER_PASSWORD=