// CONTENTS Part 04 · Configure

// PART 04

Environment variables

Chapter 19 / 60 2 min read English Part 04 of 15

Every environment variable the product reads is listed in the generated reference (Part 13). This page is how to use them: where they live, which ones matter, and what must never be put in .env.

Resolution order

For most secrets the order is Vault → environment → built-in default. A few desktop/offline paths intentionally read the environment first because no Vault is present there. The canonical example files are .env.example, botserver/.env.example and botmodels/.env.example.

The root .env.example is deliberately tiny:

# Vault connection
VAULT_ADDR=https://127.0.0.1:8200
VAULT_TOKEN=<your-vault-token-here>
VAULT_CACERT=./botserver-stack/vault/certs/ca.crt

# SaaS JWT secret (optional). Resolution order: the persisted
# saas_jwt_secret in botserver-stack/conf/system/directory_config.json,
# then SAAS_JWT_SECRET, then JWT_SECRET. When none is set a random secret is
# generated and persisted. Debug builds may opt into the public development
# constant with GB_ALLOW_DEV_JWT_SECRET=1 (never in production).

The runtime essentials

Variable Purpose
VAULT_ADDR / VAULT_TOKEN / VAULT_CACERT Vault connection used by the secret resolver
VAULT_SKIP_VERIFY disable Vault TLS verification (development only)
VAULT_CACHE_TTL secret cache lifetime in seconds (default 300)
DATABASE_URL PostgreSQL connection string; production credentials come from Vault gbo/tables
CACHE_URL / REDIS_URL / VALKEY_URL cache connection; credentials come from Vault gbo/cache
LLM_URL / LLM_MODEL / LLM_KEY chat-completions endpoint, model and key used when no Vault LLM entry exists
SAAS_JWT_SECRET / JWT_SECRET / GB_ALLOW_DEV_JWT_SECRET JWT secret fallbacks; the persisted saas_jwt_secret wins
BOTSERVER_STACK_PATH root of the runtime service stack (desktop/offline installs)
BOTSERVER_BIN / BOTSERVER_INSTALLERS_PATH explicit binary path / offline installer cache
BOTSERVER_DISABLE_TLS disable TLS (throwaway audit/offline profiles only)
BOTUI_PORT / BOTUI_CLOUD_PORT / BOTUI_LOGIN_PORT 3000 / 4000 / 5000 static servers
GB_LOGIN_URL / GB_PUBLIC_URL / GB_PLATFORM_DOMAIN origins advertised to clients and the bot-subdomain domain
RUST_LOG Rust log filter directive
DRIVE_SCAN_INTERVAL drive discovery cadence in seconds (default 30)
GB_SERVICES_ON re-enable a service a product file switched off (e.g. GB Lite’s directory)

Rules of engagement

  1. Never commit .env. It is git-ignored; a committed secret is an incident, not a config change.
  2. Credentials belong in Vault, not in .env: database, Drive, cache, mail, LLM keys. .env carries the Vault connection and, in desktop mode, a handful of path overrides.
  3. Bot-level settings belong in config.csv, not in the process environment — llm-url, llm-model, thresholds and feature flags are per-bot and hot-reloaded.
  4. Set RUST_LOG=info in production. Debug-level logs are a support tool, not a default.
  5. When a variable seems ignored, check the resolution order first (Vault wins), then whether the consumer is feature-gated (e.g. security feature for security fix).

The complete index — every name read in Rust plus the BotModels Python service, with the first read site — is the Environment variables page in Part 13; grep the repository for a name to see every consumer.

Found a mistake? Open an issue · All books

// SEARCH ESC
Pagefind · 236 pages · 4 books Enter to open ↑ ↓ to move