Skip to content
BurnerByte

getting-started

Configuration

All configuration options — config.yaml, environment variables, and runtime overrides.

Configuration Sources

BurnerByte layers configuration, each source overriding the one before it:

  1. Built-in defaults — registered in internal/config/config.go
  2. config.yaml — optional, searched in . and /etc/burnerbyte/, or at BB_CONFIG_PATH
  3. Environment variables — prefixed with BB_, where the prefix replaces the dots in the key path (BB_SERVER_PORTserver.port, BB_SMTP_HOSTNAMEsmtp.hostname)
  4. Database overrides — applied at startup from the system_configs table for the mailer, storage, sso and platform groups, so setup-wizard and admin-UI values take precedence over the environment for those keys

DATABASE_URL, REDIS_URL, JWT_SECRET and ENCRYPTION_KEY are read without the BB_ prefix.

Note

Server

KeyEnv VarDefaultDescription
server.portAPI_PORT8080HTTP listen port
server.base_urlAPI_BASE_URLhttp://localhost:8080Public API URL
server.frontend_urlFRONTEND_URLhttp://localhost:3000Frontend URL (for email links)
server.read_timeoutBB_SERVER_READ_TIMEOUT30sHTTP read timeout
server.write_timeoutBB_SERVER_WRITE_TIMEOUT30sHTTP write timeout
server.idle_timeoutBB_SERVER_IDLE_TIMEOUT120sHTTP idle timeout
server.shutdown_timeoutBB_SERVER_SHUTDOWN_TIMEOUT15sGraceful shutdown timeout
server.max_body_sizeBB_SERVER_MAX_BODY_SIZE1048576Max request body size (bytes)

Database

KeyEnv VarDefaultDescription
database.urlDATABASE_URLPostgreSQL connection string
database.max_open_connsBB_DATABASE_MAX_OPEN_CONNS25Max open connections
database.max_idle_connsBB_DATABASE_MAX_IDLE_CONNS5Max idle connections
database.conn_max_lifetimeBB_DATABASE_CONN_MAX_LIFETIME5mConnection max lifetime

Redis

KeyEnv VarDefaultDescription
redis.urlREDIS_URLRedis connection string
redis.max_retriesBB_REDIS_MAX_RETRIES3Max retry attempts

JWT

KeyEnv VarDefaultDescription
jwt.secretJWT_SECRETRequired. Signing secret
jwt.access_ttlBB_JWT_ACCESS_TTL15mAccess token lifetime
jwt.refresh_ttlBB_JWT_REFRESH_TTL168hRefresh token lifetime (7 days)

SMTP Inbound

KeyEnv VarDefaultDescription
smtp.listenBB_SMTP_LISTEN0.0.0.0:2525SMTP listen address
smtp.hostnameBB_SMTP_HOSTNAMElocalhostHostname in the SMTP greeting and the MX/SPF target the API compares domains against during verification — set it on the API process too, or no domain will verify
smtp.max_sizeBB_SMTP_MAX_SIZE26214400Max message size (25 MB)
smtp.queue_sizeBB_SMTP_QUEUE_SIZE1000Processing queue buffer
smtp.workersBB_SMTP_WORKERS4Worker goroutines
smtp.tls_certBB_SMTP_TLS_CERTTLS certificate path (enables STARTTLS)
smtp.tls_keyBB_SMTP_TLS_KEYTLS private key path

Mailer (Outbound)

KeyEnv VarDescription
mailer.hostBB_MAILER_HOSTSMTP server host
mailer.portBB_MAILER_PORTSMTP server port
mailer.usernameBB_MAILER_USERNAMEAuth username
mailer.passwordBB_MAILER_PASSWORDAuth password
mailer.fromBB_MAILER_FROMSender address
mailer.tlsBB_MAILER_TLSEnable TLS
Note

MinIO / S3

KeyEnv VarDescription
minio.endpointBB_MINIO_ENDPOINTMinIO endpoint
minio.access_keyBB_MINIO_ACCESS_KEYAccess key
minio.secret_keyBB_MINIO_SECRET_KEYSecret key
minio.bucketBB_MINIO_BUCKETBucket name
minio.use_sslBB_MINIO_USE_SSLEnable SSL

Encryption

KeyEnv VarDefaultDescription
encryption.keyENCRYPTION_KEY (or BB_ENCRYPTION_KEY)Strongly recommended. 32-byte hex-encoded (64-char) AES-256-GCM key. When empty, SSO client secrets, SMTP passwords and storage credentials are written to the database in plaintext — the API still boots. Docker Compose forwards only the unprefixed name.

SSO / OIDC

KeyEnv VarDescription
sso.providerBB_SSO_PROVIDEROIDC provider name
sso.client_idBB_SSO_CLIENT_IDOAuth client ID
sso.client_secretBB_SSO_CLIENT_SECRETOAuth client secret
sso.redirect_urlBB_SSO_REDIRECT_URLCallback URL
sso.tenant_idBB_SSO_TENANT_IDOIDC tenant/realm identifier
sso.issuer_urlBB_SSO_ISSUER_URLOIDC issuer URL for discovery
sso.auto_provisionBB_SSO_AUTO_PROVISIONAuto-create users on first SSO login
sso.default_org_roleBB_SSO_DEFAULT_ORG_ROLEDefault org role for SSO-provisioned users
sso.default_team_roleBB_SSO_DEFAULT_TEAM_ROLEDefault team role for SSO-provisioned users
sso.allowed_domainsBB_SSO_ALLOWED_DOMAINSComma-separated allowed email domains

Rate Limiting

KeyEnv VarDefaultDescription
rate_limit.enabledBB_RATE_LIMIT_ENABLEDtrueEnable rate limiting
rate_limit.authenticatedBB_RATE_LIMIT_AUTHENTICATED300Requests/min (authenticated)
rate_limit.unauthenticatedBB_RATE_LIMIT_UNAUTHENTICATED60Requests/min (unauthenticated)
rate_limit.loginBB_RATE_LIMIT_LOGIN10Login attempts/min per IP
rate_limit.forgot_passwordBB_RATE_LIMIT_FORGOT_PASSWORD3Reset requests/hour per IP
rate_limit.trusted_proxiesBB_RATE_LIMIT_TRUSTED_PROXIES(empty)Comma-separated CIDRs (a bare IP is treated as /32) whose X-Forwarded-For is trusted for client-IP resolution

Account Lockout

KeyEnv VarDefaultDescription
lockout.max_attemptsBB_LOCKOUT_MAX_ATTEMPTS5Failed attempts before lockout
lockout.durationBB_LOCKOUT_DURATION15mLockout duration

Password Policy

KeyEnv VarDefaultDescription
password_policy.min_lengthBB_PASSWORD_POLICY_MIN_LENGTH8Minimum password length
password_policy.require_uppercaseBB_PASSWORD_POLICY_REQUIRE_UPPERCASEtrueRequire uppercase letter
password_policy.require_lowercaseBB_PASSWORD_POLICY_REQUIRE_LOWERCASEtrueRequire lowercase letter
password_policy.require_numberBB_PASSWORD_POLICY_REQUIRE_NUMBERtrueRequire digit
password_policy.require_specialBB_PASSWORD_POLICY_REQUIRE_SPECIALtrueRequire special character
password_policy.bcrypt_costBB_PASSWORD_POLICY_BCRYPT_COST12bcrypt hashing cost (higher is slower and stronger). The timing-equalising dummy comparison that hides user enumeration is derived from this value, so raising it stays safe

Defaults

KeyEnv VarDefaultDescription
defaults.attachments_enabledBB_DEFAULTS_ATTACHMENTS_ENABLEDtrueGlobal attachment toggle
defaults.allow_registrationBB_DEFAULTS_ALLOW_REGISTRATIONtrueAllow new user registration
defaults.enforce_ssoBB_DEFAULTS_ENFORCE_SSOfalseEnforce SSO for all users
defaults.default_inbox_ttlBB_DEFAULTS_DEFAULT_INBOX_TTL10mDefault inbox lifetime
defaults.max_inbox_ttlBB_DEFAULTS_MAX_INBOX_TTL24hMaximum inbox lifetime
defaults.max_attachment_size_mbBB_DEFAULTS_MAX_ATTACHMENT_SIZE_MB25Max attachment size
defaults.max_domainsBB_DEFAULTS_MAX_DOMAINS10Max domains per org
defaults.max_teamsBB_DEFAULTS_MAX_TEAMS50Max teams per org
defaults.max_inboxes_per_domainBB_DEFAULTS_MAX_INBOXES_PER_DOMAIN100Max inboxes per domain
defaults.max_sessions_per_userBB_DEFAULTS_MAX_SESSIONS_PER_USER5Max concurrent active sessions per user
defaults.password_reset_ttlBB_DEFAULTS_PASSWORD_RESET_TTL1hPassword reset token lifetime
defaults.invite_expiry_ttlBB_DEFAULTS_INVITE_EXPIRY_TTL48hInvite link lifetime
defaults.presigned_url_ttlBB_DEFAULTS_PRESIGNED_URL_TTL15mAttachment download URL lifetime
defaults.webhook_timeoutBB_DEFAULTS_WEBHOOK_TIMEOUT10sWebhook HTTP timeout
defaults.webhook_max_retriesBB_DEFAULTS_WEBHOOK_MAX_RETRIES3Max webhook delivery attempts
defaults.analytics_cache_ttlBB_DEFAULTS_ANALYTICS_CACHE_TTL2hAnalytics cache duration
defaults.analytics_default_daysBB_DEFAULTS_ANALYTICS_DEFAULT_DAYS30Default days for emails-per-day charts
defaults.timezoneBB_DEFAULTS_TIMEZONEUTCDefault user timezone
defaults.date_formatBB_DEFAULTS_DATE_FORMATYYYY-MM-DDDefault date display format
defaults.time_formatBB_DEFAULTS_TIME_FORMAT24hDefault time display format (12h or 24h)

Workers

KeyEnv VarDefaultDescription
workers.dns_recheck_intervalBB_WORKERS_DNS_RECHECK_INTERVAL1hDNS verification recheck
workers.cleanup_intervalBB_WORKERS_CLEANUP_INTERVAL5mExpired inbox/session cleanup
workers.webhook_retry_intervalBB_WORKERS_WEBHOOK_RETRY_INTERVAL1mFailed webhook retry
workers.reconciler_intervalBB_WORKERS_RECONCILER_INTERVAL1mRedis ↔ Postgres sync
workers.analytics_intervalBB_WORKERS_ANALYTICS_INTERVAL5mAnalytics cache refresh

Two of the seven workers have hardcoded intervals and no config key:

WorkerIntervalDescription
invite_expiry24hEmails inviters about invites expiring within 24 hours, then deletes lapsed ones
admin_stats10sRefreshes the cached platform stats streamed over /api/v1/ws/admin-stats

Every job runs once at startup before its ticker begins, and every API process starts all seven — there is no leader election and no way to run an API instance without them. See Production Deployment.

CORS

KeyEnv VarDescription
cors.allowed_originsBB_CORS_ALLOWED_ORIGINSComma-separated origins
cors.allowed_methodsBB_CORS_ALLOWED_METHODSAllowed HTTP methods
cors.allowed_headersBB_CORS_ALLOWED_HEADERSAllowed request headers
cors.max_ageBB_CORS_MAX_AGEPreflight cache duration (seconds)

Email Verification

KeyEnv VarDefaultDescription
email_verification.enabledBB_EMAIL_VERIFICATION_ENABLEDtrueRequire email verification on registration
email_verification.ttlBB_EMAIL_VERIFICATION_TTL24hVerification link lifetime

Logging & Metrics

KeyEnv VarDefaultDescription
logging.levelLOG_LEVELinfoLog level (debug, info, warn, error)
logging.formatLOG_FORMATjsonLog format (json, text)
metrics.enabledBB_METRICS_ENABLEDtrueEnable Prometheus metrics
metrics.pathBB_METRICS_PATH/metricsMetrics endpoint path
metrics.tokenBB_METRICS_TOKEN(empty)When set, /metrics also requires Authorization: Bearer <token>. The loopback/private-address check alone depends on your proxy overwriting inbound X-Forwarded-For and X-Real-IP; a token does not. Prometheus sends it via bearer_token

Security

KeyEnv VarDefaultDescription
security.allow_token_query_paramBB_SECURITY_ALLOW_TOKEN_QUERY_PARAMfalseRe-enables ?token=<jwt> on the WebSocket endpoints. The browser client uses the one-time /ws/ticket flow instead; a token in a URL is captured by reverse-proxy access logs and browser history
security.require_email_verificationBB_SECURITY_REQUIRE_EMAIL_VERIFICATIONfalseRefuse password logins until the address is confirmed. Off by default because enabling it on an existing deployment locks out every account created beforehand. The check runs after the password, so it never reveals whether an address exists
security.enforce_sso_for_system_adminsBB_SECURITY_ENFORCE_SSO_FOR_SYSTEM_ADMINSfalseRequire SSO for accounts carrying is_system_admin. The org-level enforce_sso setting joins through org membership, so it never covers a system admin who belongs to no organisation — the account that can grant is_system_admin, transfer teams and read every audit trail. Enforced only once that admin has a linked SSO identity, so it cannot lock out the last administrator
KeyEnv VarDefaultDescription
auth_cookie.same_siteBB_AUTH_COOKIE_SAME_SITElaxlax, strict, or none. none forces Secure and therefore requires HTTPS — use it only when the frontend and API sit on unrelated domains.

Public Demo Inbox

Off by default. When enabled, logged-out visitors can create a real short-lived inbox from the landing page. See Demo Mode.

KeyEnv VarDefaultDescription
demo.enabledDEMO_ENABLEDfalseEnable the public "try it" inbox
demo.assignment_idDEMO_ASSIGNMENT_IDDomain assignment the demo user's team owns
demo.user_idDEMO_USER_IDDemo account that owns created inboxes
demo.ttlDEMO_TTL10mLifetime of each demo inbox

A malformed UUID in either ID logs a warning and leaves the demo disabled rather than failing the boot.

Config File Location

BB_CONFIG_PATH overrides the search path entirely and points at a single file. It is also where the first-run web installer writes, so reads and writes stay consistent. Without it, config.yaml is searched in . then /etc/burnerbyte/.