Skip to main content
Custos reads process environment variables. It does not open a .env file itself — supply these through whatever starts the binary: a shell, a systemd environment file or credential store, container configuration, or a hosting platform. The convention: CUSTOS_-prefixed variables are ours. Third-party credentials keep their own upstream names (RESEND_API_KEY, the OTEL_* family).

Required

Control plane

Client IPs behind a proxy

The auth rate limit keys on the client IP. The control plane takes it from the TCP connection unless that peer is in CUSTOS_TRUSTED_PROXIES; then it reads X-Forwarded-For from the right and uses the first address that is not a trusted proxy. Every hop between the client and the control plane must therefore either be trusted or rewrite the client address itself, or all clients share the last untrusted hop’s limit. With a proxy on the same host, the default is enough. See the control-plane HTTPS examples. If Cloudflare sits in front of nginx, let nginx restore the real client address from CF-Connecting-IP for requests from Cloudflare’s published ranges:
nginx then forwards the real client in X-Forwarded-For and the control plane needs no extra setting. Re-run it occasionally; Cloudflare rarely changes its ranges. Check whether a domain is proxied with curl -sI https://<domain>/livez | grep -i cf-ray.
CUSTOS_ENCRYPTION is Custos’s own hybrid X25519 payload sealing between the API and its clients. It is separate from HTTPS/TLS and from at-rest vault encryption, and turning it off disables neither. It is commonly off in local development.

Invitations, password resets, and email

OpenTelemetry

Setting the one general endpoint enables logs, traces, and metrics over OTLP HTTP/protobuf. The exporters append /v1/logs, /v1/traces, or /v1/metrics as appropriate. Use the signal-specific variables only when exporting selected signals, and leave the general endpoint empty. If every endpoint is empty, OTLP export is disabled and JSON logs still go to stderr. Daemons need no OTLP variables of their own — see Observability.

Client-side value

CUSTOS_SERVER_TRANSPORT_PUBLIC_KEY is generated by custoscp gen-keys and configured on every client that calls the API — for the web app, as a container environment variable. The control-plane process never reads it.