Configuration
For a deployment operator wiring environment variables and the Group-1 secret files. This is the operator-facing view. Every variable bunyip reads, grouped by subsystem; the source of truth for the exhaustive list is ENV_INVENTORY in the api source, which the repository’s check-doc-surface guard keeps in step with the internal docs/configuration.md reference.
Two kinds of knob
- Environment variables are read once at process start. Changing one means restarting the container. They configure the deployment.
- In-app settings live in the database and are edited on the admin pages. They apply without a restart and configure the product. Where the same knob exists in both planes, the database row wins by declaration.
This page covers the environment-variable half. The admin pages describe the in-app settings in the UI itself.
Hosting
APP_PORT(default4401) is the api listen port inside the container.WEB_PORT(default4400) is the web listen port inside the container.APP_HOST(default0.0.0.0) is the api bind address.BUNYIP_API_URL(defaulthttp://api:4401) is howbunyip-webreachesbunyip-apiserver-side.BUNYIP_API_PUBLIC_ORIGINis the browser-facing origin of the api, used for OIDC redirect URIs and Stripe webhooks. Required for production.BUNYIP_HOSTis the apex host the web runs on. Used to build email links and theIssuerclaim.APP_NAME(defaultPSA Systems) is the product name shown on the sign-in page before the branding row is seeded. Once thebrandingrow is populated it wins.TRUSTED_PROXY_CIDRandWEB_TRUSTED_PROXY_CIDRrestrict which upstream proxies the api and web honour forwarded headers from. A request from outside these CIDRs is treated as the socket IP.
Database
DATABASE_URLconnects the admin pool (migration-granted). File-based through theDATABASE_URL_FILEconvention.APP_DATABASE_URLconnects the self-service pool asbunyip_app, the per-user RLS role.BUNYIP_APP_PASSWORDsets thebunyip_approle password on first boot. File-based throughBUNYIP_APP_PASSWORD_FILE.- Pools are sized for 10 connections each, measured against the healthy p99 of the request path. Raise only on acquire timeouts, and respect PostgreSQL’s connection limit.
Encryption and signing
APP_ENCRYPTION_KEYis the one 32-byte key that protects every encrypted database column. File-based.JWT_SECRETis the session JWT HMAC key. File-based.OIDC_JWT_PRIVATE_KEY_PATHpoints at the Ed25519 private key used to sign OIDC id_tokens and access tokens. The matching public key is served at/oauth2/jwks.OIDC_JWT_ACTIVE_KIDis the key id the api advertises as active. Rotate by adding a new key to the store, flipping this to the new kid, then retiring the old key after the token lifetime passes.
Email (SMTP)
EMAIL_ENABLED(defaultfalsein dev, requiredtruein production).EMAIL_FROMis the envelope sender on every piece of mail bunyip emits.SMTP_HOST,SMTP_PORT,SMTP_USERNAMEname the relay.- The SMTP password is a Group-2 integration secret: it comes from the store
SECRETS_STORAGEdeclares, never from the environment. See Secrets. EMAIL_LOG_TOKENSwrites the magic-link URL to the api log at DEBUG. Allowed in dev; forced off in production boot.
OIDC provider
- Discovery is served at
/.well-known/openid-configurationon the api. - The signing keys above (
OIDC_JWT_PRIVATE_KEY_PATH,OIDC_JWT_ACTIVE_KID) are the only OP-side material in the environment. Everything else (allowed scopes per client, grant types, audiences, redirect URIs) lives onoidc_clientsrows and is edited on the admin page. OIDC_ACCESS_TOKEN_TTLandOIDC_REFRESH_TOKEN_TTLcap bearer lifetimes.
Secrets storage (SECRETS_STORAGE)
Required; no default. One of environment, database, infisical. Governs where Group-2 integration secrets (SMTP password, Stripe credentials, support IMAP password) live. See Secrets for the full model.
Infisical (only when SECRETS_STORAGE=infisical)
INFISICAL_ENABLEDturns the client on. A client that never reaches out is inert.INFISICAL_BASE_URL,INFISICAL_PROJECT_ID,INFISICAL_ENVIRONMENTname the project to read from.INFISICAL_CLIENT_IDand the matchingINFISICAL_CLIENT_SECRET_FILEauthenticate the client.
Rate limiting
RATE_LIMIT_FLOORsets the baseline per-IP cap every api route sits under. Individual routes may add tighter per-user caps on top; the floor never raises them.RATE_LIMIT_WHITELISTis a CIDR list that bypasses the floor. Reserved for trusted internal callers, not for broad allow-listing.
Feature flags
Feature flags are features rows in the database, not environment variables. A new feature ships off and is turned on from the admin page. Environment variables cannot flip a feature.
IP geolocation
IP2LOCATION_LITE_PATHpoints at theIP2LOCATION-LITE-DBbinary used by the geolocation enrichment. Not required; absent means country is never resolved.IP_POLICY_PATHpoints at an optional allow/block ruleset for IP-level decisions ahead of the rate limit.
What is not an environment variable
- Product copy, palette, logos: these live on the one
brandingrow and are edited on the Branding admin page. The sign-in page reads them before auth, so a wrong value is visible to anonymous visitors. - Allowed OIDC scopes, grant types and redirect URIs per client:
oidc_clientsrows on the admin Clients page. - Rate-limit per-route overrides:
rate_limit_overridesrows. - Login approval policy: one
settingsrow.
Where to look next
- Secrets for the Group-1 vs Group-2 split and the
SECRETS_STORAGEmodes. - OIDC provider for client registration and the admin pages that drive the OP.
- Troubleshooting for the common failures caused by a wrong value in this list.