Skip to content

Environment Variables 🟑 BETA

Set only the environment variables the code reads, and keep every secret in Vault rather than in .env.

Admin guide Β· environment runbook

When to use Before you start Steps Verify Roll back
Bringing up a node, changing a service address Access to the env file and Vault Read, set only VAULT_* locally, restart if required Process sees the value, no secret in file Restore the prior env file

When to use

Use this runbook when a service cannot reach a dependency or when a deployment setting must change.

Before you start

  • The .env file at the repository root may contain only VAULT_* variables. All other secrets come from Vault.
  • GB_LOGIN_URL is injected into the suite and cloud pages from LOGIN_URL (default http://localhost:5000). The login surface is the only one that serves sign-in.
  • LLM settings fall back to LLM_URL, LLM_MODEL and LLM_KEY only when Vault has no value; the provider is built at boot.
  • The BotModels service is addressed with BOTMODELS_HOST and BOTMODELS_API_KEY; the model server used during development is separate.
  • Desktop and agent VMs use BOTSERVER_STACK_PATH, BOTSERVER_INSTALLERS_PATH and BOTSERVER_BIN. Local LLM accounts use DEV_LLM_URL / DEV_LLM_KEY in development only.

Steps

# 1. Inspect the env file for disallowed entries without printing values.
grep -oE '^[A-Z0-9_]+=' .env | sort

# 2. Read only the Vault connection variables.
source <(grep -E '^VAULT_' .env)
export VAULT_ADDR="$VAULT_ADDR"
export VAULT_CACERT="${WORKSPACE}/botserver-stack/conf/system/certificates/ca/ca.crt"
export VAULT_TOKEN=$(cat /tmp/vault-token-gb 2>/dev/null || echo "$VAULT_TOKEN")

# 3. Confirm the listener state for the service you changed.
sudo incus exec <container> -- ss -tlnp
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/health

# 4. A provider change built at boot requires a restart of that process;
#    a config.csv change does not.

Verify

Variable family Source Pass condition
Vault connection .env only VAULT_* keys present
Login URL LOGIN_URL pages point at the login surface
LLM fallback LLM_URL, LLM_MODEL, LLM_KEY used only when Vault has no value
BotModels BOTMODELS_HOST, BOTMODELS_API_KEY service reachable
Desktop paths BOTSERVER_* stack and installer paths resolve
Secrets Vault no secret value in .env or logs

Roll back

πŸ”΄ Restore the previous .env from /tmp (never from the repository) and restart only the process whose boot-time settings changed. Re-run the table; a leaked credential is an incident under incident response.