Environment variables
Alphabetical reference for every GONI_* environment variable a self-hosted deployment configures.
What this page is
A greppable glossary of every GONI_* environment variable a self-hosted Goni deployment reads. Use it when filling in a Kubernetes ConfigMap or your deployment’s secret store.
In this reference
- Table shape: name, purpose, default, required in prod, example.
- Auth, warehouse, control plane, email, SSRF, rate limits, sweepers, feedback.
- Why Goni refuses to start with placeholder secrets when
GONI_DEV_MODE=0.
Boot-time secret guardrails
In production (GONI_DEV_MODE unset or 0) Goni refuses to start when any of GONI_JWT_SECRET, GONI_EMBED_SECRET, GONI_SECRET_KEY, or GONI_IP_SALT is unset, shorter than 32 bytes, or matches a known placeholder. GONI_DEV_MODE=1 is the only switch that re-enables the X-Goni-User header login, wildcard CORS, and dev-secret fallbacks; it must never ship enabled.
Warning: Setting
GONI_DEMO_RETURN_MAGIC_LINK=1underGONI_DEV_MODE=0also aborts boot. In production that flag would silently merge every visitor intoGONI_DEMO_USER_EMAIL, causing cross-tenant data exposure.
Generate every 32-byte secret with openssl rand -hex 32 (or openssl rand -base64 32 for GONI_SECRET_KEY). Store the output in your secret manager, then inject it into the process environment at boot.
Auth and secrets
| Name | Purpose | Default | Required in prod | Example |
|---|---|---|---|---|
GONI_DEV_MODE | Enables dev shortcuts: X-Goni-User login, wildcard CORS, secret fallbacks. | 0 | Must be 0 or unset | 1 (localhost only) |
GONI_JWT_SECRET | HS256 access-token signer. Rejected if under 32 bytes. | dev placeholder | Yes (unless GONI_JWT_PRIVATE_KEY_PEM is set) | 32-byte hex string |
GONI_JWT_PRIVATE_KEY_PEM | EdDSA (Ed25519) access-token signer, PKCS#8 PEM. Set on bi-api only. When set, bi-api signs EdDSA and refuses HS256 tokens, and GONI_JWT_SECRET must be unset or real. | unset | Optional | -----BEGIN PRIVATE KEY-----... |
GONI_JWT_SECRET_PREV | Previous JWT signer accepted for verification during rotation. Tokens minted by the current signer stay valid; tokens minted by the previous secret still verify until it is retired. | unset | Optional | 32-byte hex string |
GONI_JWT_PUBLIC_KEY_PEM | Public half of GONI_JWT_PRIVATE_KEY_PEM, PKIX PEM. The connector hubs verify bi-api’s tokens with it and never hold the private key. On bi-api it is optional (derived from the private key); if set, bi-api refuses to start when the two do not match. | unset | Optional | -----BEGIN PUBLIC KEY-----... |
GONI_EMBED_SECRET | JWT signer for embed and share URLs. | dev placeholder | Yes | 32-byte hex string |
GONI_EMBED_SECRET_PREV | Previous embed signer accepted for verification during rotation. | unset | Optional | 32-byte hex string |
GONI_EMBED_MAX_TTL_SECONDS | Upper bound on the TTL a caller may request when minting an embed token. Requests over the cap are clamped. | 604800 (7 days) | Optional | 86400 |
GONI_EMBED_EXPECTED_ISS | Required iss claim on inbound embed tokens; empty accepts any issuer. | empty | Recommended | https://embed.example.com |
GONI_SECRET_KEY | AES-256-GCM key encrypting connection credentials at rest. | dev fallback | Yes | 32-byte base64 string |
GONI_IP_SALT | Salt for hashing client IPs before storage. | dev fallback | Yes | 32-byte hex string |
GONI_CORS_ALLOWED_ORIGINS | Comma-separated CORS origin allow-list. Empty plus prod mode denies cross-origin. | empty | Yes for cross-origin SPA | https://app.example.com,https://embed.example.com |
GONI_ALLOWED_ORIGINS | CSRF Origin header allow-list applied to state-changing requests. Distinct from CORS: this gates the request itself, not the browser preflight. | empty (falls back to CORS list) | Recommended | https://app.example.com |
GONI_FORCE_SECURE_COOKIES | Force Secure cookie flag regardless of scheme. | 0 | Recommended | 1 |
GONI_PUBLIC_URL | Fully-qualified base URL Goni advertises to itself for building outbound links (magic-link emails, Stripe redirects, embed callbacks). | derived from request | Recommended | https://app.example.com |
GONI_PUBLIC_HOST | Hostname used when constructing magic-link email URLs. Overrides GONI_PUBLIC_URL when only the host differs. | derived from request | Optional | app.example.com |
GONI_MULTI_TENANT | Enables tenant-scoped filtering on identity carriers (PATs, sessions). Leave 0 for single-tenant deploys. | 0 | Set 1 for multi-tenant | 1 |
See Access control for how these secrets flow into the RBAC layer.
Warehouse (ClickHouse)
The Goni API, semantic layer, streaming plane, and migrations job all read the same set. Production reads them from a secret store into the deployment’s environment.
| Name | Purpose | Required in prod | Example |
|---|---|---|---|
GONI_CH_HOST | Warehouse hostname. | Yes | abc123.eu-west-1.aws.clickhouse.cloud |
GONI_CH_PORT | Warehouse port. | Yes | 443 |
GONI_CH_USER | Warehouse user. | Yes | default |
GONI_CH_PASSWORD | Warehouse password. | Yes | from ClickHouse Cloud |
GONI_CH_DATABASE | Default database. | Yes | goni_prod |
GONI_CH_PROTOCOL | native or http. | Yes | http |
GONI_CH_SECURE | TLS on the warehouse connection. | Yes | true |
See Architecture for the two-plane split.
Control plane and store
| Name | Purpose | Required in prod | Example |
|---|---|---|---|
GONI_PG_DSN | Control-plane Postgres DSN. | Yes | postgres://goni:...@10.0.0.5:5432/goni_cp?sslmode=require |
GONI_REDIS_URL | Sessions, rate-limit, token budget. | Yes | redis://:pw@10.0.0.6:6379/0 |
GONI_SEMANTIC_ROOT | Path to compiled semantic project. | Yes | /data/semantic/project |
GONI_REPO_ROOT | Root of the semantic project’s git checkout (used for metric-blame lookups). Defaults to /app/repo when unset. | Optional | /data/semantic/repo |
GONI_STORE_ROOT | Storage root for UI-editable YAML. | Yes | /data/store |
GONI_POLICIES_PATH | RBAC policies file. | Yes | /data/store/policies.yml |
GONI_ALERTS_PATH | Alerts YAML. | Yes | /data/store/alerts.yml |
GONI_REPORTS_PATH | Scheduled reports YAML. | Yes | /data/store/reports.yml |
Precedence at boot: Resend, then SMTP, then Noop. Under GONI_DEV_MODE=0 Goni refuses to start with the Noop sender (magic-link auth would silently fail). Goni’s production deploy uses the SMTP path via a Paysera on-prem relay reached over a GCP VPC tunnel (ADR 0010); Resend stays available for local dev.
| Name | Purpose | Required in prod | Example |
|---|---|---|---|
GONI_RESEND_API_KEY | Enables the Resend transport. Leave unset in prod (SMTP is authoritative). | No (local dev only) | re_... |
GONI_EMAIL_FROM | From address for both transports. | Yes | goni@paysera.com |
GONI_SMTP_HOST | SMTP relay hostname. | Yes | smtp.paysera.net |
GONI_SMTP_PORT | SMTP port. | Yes | 587 |
GONI_SMTP_USER | SMTP username. | Yes | goni@paysera.com |
GONI_SMTP_PASS | SMTP password. | Yes | opaque |
GONI_SMTP_TLS | STARTTLS on by default; 0 disables. | Recommended 1 | 1 |
GONI_SMTP_INSECURE_SKIP_VERIFY | Skip STARTTLS certificate verification. Only set to 1 for a private-tunnel relay whose cert isn’t in the public trust store (Paysera on-prem SMTP over GCP VPC peering — ADR 0010). MUST be unset for any relay reached over the public internet. | 1 for Paysera relay, unset otherwise | 1 |
Demo bookings
/api/marketing/demo-request books the slot on a Google Calendar and lets Google send the invitation with a Meet link (ADR 0029). With the three credentials unset the endpoint still answers; the operator email then asks a human to confirm each slot.
| Name | Purpose | Required in prod | Example |
|---|---|---|---|
GONI_GOOGLE_CALENDAR_CLIENT_ID | OAuth 2.0 client (Web application) in the GCP project. | No (auto-confirm off without it) | 1234-abc.apps.googleusercontent.com |
GONI_GOOGLE_CALENDAR_CLIENT_SECRET | Its client secret. | No | opaque |
GONI_GOOGLE_CALENDAR_REFRESH_TOKEN | Minted once with tools/google_calendar_oauth.py, approved in a browser signed in as the calendar owner. Events land on that account’s calendar and invitations come from it. | No | opaque |
GONI_GOOGLE_CALENDAR_ID | Calendar the events land on. | No (default primary) | primary |
GONI_DEMO_REQUEST_SALES_CC | Comma-separated inboxes that get a copy of every operator notification and are added as hidden attendees on the event. | No | vaso.ochigava@paysera.net |
GONI_DEMO_REMINDER_INTERVAL | Tick of the worker that emails the 24-hour and 15-minute reminders; 0 disables. | No (default 1m) | 1m |
SSRF
The SSRF gate wraps every outbound webhook and embed callback.
| Name | Purpose | Required in prod | Example |
|---|---|---|---|
GONI_SSRF_ALLOW_PRIVATE | Permits RFC1918 targets. | Must be 0 | 0 |
GONI_SSRF_ALLOWED_HOSTS | Comma-separated allow-list for otherwise-blocked hosts. | Optional | hooks.slack.com,api.pagerduty.com |
GONI_ALLOW_INSECURE_WEBHOOKS | Permits http:// webhook targets. | Must be 0 | 0 |
Rate limits
Three classes with independent burst and rps. Setting either the burst or the rps of a class to 0 short-circuits and disables that class. See REST API for what each class covers.
| Name | Production default | Example |
|---|---|---|
GONI_RATE_HEAVY_BURST | 60 | 60 |
GONI_RATE_HEAVY_RPS | 3 | 3 |
GONI_RATE_CHEAP_BURST | 200 | 200 |
GONI_RATE_CHEAP_RPS | 20 | 20 |
GONI_RATE_AUTH_BURST | 5 | 5 |
GONI_RATE_AUTH_RPS | 0.5 | 0.5 |
GONI_TRUSTED_PROXY_CIDRS | empty | 10.0.0.0/8 |
Sweepers and streaming
| Name | Purpose | Default | Required in prod | Example |
|---|---|---|---|---|
GONI_TRIAL_SWEEPER_INTERVAL | Cadence of the trial-expiry sweeper. 0 disables. | 1h | Recommended default | 1h |
GONI_STREAMING_ORPHAN_SWEEP_INTERVAL | Cadence of the streaming orphan sweeper (floor 1m). 0 disables. The sweeper runs only when GONI_STREAMING_ENABLED is on. | 5m | Recommended default | 5m |
GONI_MAX_STREAMING_SUBS_PER_TENANT | Cap on active streaming subscriptions per tenant. | 50 | Yes | 50 |
GONI_STREAMING_ENABLED | Master switch for the streaming subsystem, and the single statement that stream-hub is part of this deployment. Unset, empty or 0 means off: the subscription endpoints (create, pause, resume, reset offset, delete, status, DLQ redrive) answer 503 with code streaming_disabled, Kafka and Pub/Sub show as unavailable in the catalog and cannot be created, an existing Kafka or Pub/Sub pipeline is not run (one run records STREAMING_DISABLED), and the orphan sweeper does not start. Turn it on only where stream-hub runs; then an unreachable stream-hub is reported as an error. See Streaming subscriptions. | off (disabled) | Required for streaming | 1 |
GONI_DQ_SWEEP_INTERVAL | Data-quality sweeper cadence. | 5m | Recommended default | 5m |
GONI_DQ_DEFAULT_FREQUENCY | Default per-test frequency. | 1h | Recommended default | 1h |
GONI_DQ_FAIL_RETRY_FREQUENCY | Retry frequency after a failed test. | 10m | Recommended default | 10m |
GONI_MAX_CONCURRENT_PIPELINES | Concurrency cap for the pipeline scheduler (floor 1, ceiling 256). | 8 | Recommended | 4 |
GONI_CONNECTION_PROBE_INTERVAL | Cadence of connection health probes (floor 1m, ceiling 24h). | 15m | Optional | 1m |
Streaming client wiring: GONI_FLIGHT_STREAM_ADDR_CLIENT, GONI_FLIGHT_STREAM_INSECURE (dev only), GONI_FLIGHT_STREAM_CA_FILE, GONI_FLIGHT_STREAM_SERVER_NAME, GONI_STREAM_STATUS_ADDR_CLIENT. See Streaming subscriptions.
The stream-hub process binds its own status and Prometheus surfaces on GONI_STREAM_STATUS_ADDR (default :9084); bi-api does not read that variable.
Feedback and observability
| Name | Purpose | Default | Required in prod | Example |
|---|---|---|---|---|
GONI_FEEDBACK_SLACK_WEBHOOK | Slack webhook that the /api/feedback forwarder posts to. | empty | Optional | https://hooks.slack.com/services/... |
GONI_METRICS_TOKEN | Bearer token guarding the Prometheus endpoint. | empty (open) | Recommended | 16-byte hex string |
GONI_SECURITY_ALERT_WEBHOOK_URL | Slack-shaped webhook the security dispatcher fans pat.mint, embed.mint, policies.update, warehouse.config.*, and auth.magic_link.throttled events out to. Empty = counter-only mode (Prometheus counter still increments; nothing is dispatched). See Audit and lineage. | empty | Recommended | https://hooks.slack.com/services/... |
GONI_SECURITY_ALERT_WEBHOOK_SECRET | Optional HMAC secret used to sign the security webhook payload. Ignored when the URL is empty. | empty | Optional | 32-byte hex string |
GONI_DQ_ALERT_WEBHOOK_URL | Slack-shaped webhook the data-quality scheduler posts failed-test alerts to. Empty disables the fan-out; test failures still land in the audit log. | empty | Optional | https://hooks.slack.com/services/... |
GONI_DQ_ALERT_WEBHOOK_SECRET | Optional HMAC secret for the data-quality webhook. Ignored when the URL is empty. | empty | Optional | 32-byte hex string |
GONI_MAGIC_LINK_TTL_SECONDS | Override for the magic-link token TTL. Values less than or equal to zero are ignored (falls back to the 15-minute default). | 900 (15 minutes) | Optional | 600 |
GONI_REPORT_WEBHOOK_SECRET | HMAC secret used to sign outbound report-delivery webhook payloads. See Alerts and scheduled reports. | empty | Recommended for signed webhooks | 32-byte hex string |
GONI_REPORT_CSV_RETENTION_DAYS | How many days alert and report run history, including each report’s rendered CSV, is kept in the control-plane database before it is deleted automatically. | 90 | Optional | 14 |
AI
Provider selection is per-tenant BYOK, configured through the PATCH /api/settings/ai endpoint (see Ask); there is no process-wide backend env var. Only the Ask regression suite path is set via environment.
| Name | Purpose | Default | Required in prod | Example |
|---|---|---|---|---|
GONI_AI_EVAL_PATH | Path to an ai_eval.yml suite for Ask regression checks. Unset runs the suite bundled in bi-api. | unset | Optional | /data/semantic/project/ai_eval.yml |
GONI_OLLAMA_ALLOWED_HOSTS | Comma-separated allow-list of hosts a BYOK Ollama endpoint may target. Loopback (127.0.0.1, localhost) is always permitted. | empty | Optional | ollama.internal,10.0.0.5 |
OIDC (optional)
Set GONI_OIDC_ENABLED=1 and provide GONI_OIDC_ISSUER, GONI_OIDC_CLIENT_ID, GONI_OIDC_CLIENT_SECRET, and GONI_OIDC_REDIRECT_URL. Optional filters: GONI_OIDC_ALLOWED_DOMAINS (comma-separated), GONI_OIDC_REQUIRE_EMAIL_VERIFIED=0 to relax verification, GONI_SESSION_TTL_SECONDS to override the default TTL.
Stripe (optional)
GONI_STRIPE_SECRET_KEY, GONI_STRIPE_PUBLISHABLE_KEY, and GONI_STRIPE_WEBHOOK_SECRET. When the secret key is empty, /api/billing/* and /api/marketing/stripe-webhook return 503 (safe default; never accept unverified webhooks).
Sentry (optional)
Empty DSN disables error reporting cleanly. When set, panics + Error-level slog lines from the API (and uncaught errors + React render errors from the SPA) are forwarded to your Sentry instance with the environment + release tags.
| Name | Purpose | Component | Example |
|---|---|---|---|
GONI_SENTRY_DSN | API-side DSN, forwards backend events. | bi-api runtime env | https://<key>@sentry.example.com/<id> |
GONI_SENTRY_ENVIRONMENT | Tag on every event so alert rules can route per deploy target. | bi-api runtime env | sandbox, prod |
GONI_SENTRY_RELEASE | Release identifier: the commit the image was built from. Set as a Docker build arg and kept in the image, so a rollback reports the older release; runtime env overrides it. | Go images (bi-api, source-hub, files-hub) build arg | 846b29f4c1a2 |
VITE_SENTRY_DSN | SPA-side DSN. Vite substitutes import.meta.env.VITE_* at build time; runtime env is ignored. Baked into the bundle via Docker --build-arg. | bi-web build arg | https://<key>@sentry.example.com/<id> |
VITE_SENTRY_ENVIRONMENT | SPA environment tag. | bi-web build arg | sandbox, prod |
VITE_SENTRY_RELEASE | SPA release identifier. | bi-web build arg | sandbox-2026-09-07 |
Related
Last updated