Updated View as Markdown

Configuration

Every runtime value is read from the environment. .env.example is the authoritative list; the groups below mirror it.

Application

VarDefaultPurpose
APP_HOST0.0.0.0Bind interface for the api. Keep 0.0.0.0 inside Docker.
APP_PORT8080Listen port for the api.
LOG_LEVELinfoOne of trace, debug, info, warn, error.

Database

VarDefaultPurpose
DATABASE_URLnone (required)Postgres connection URL. Example: postgresql://dmarc_reporter:PASSWORD@db:5432/dmarc_reporter.

Security

VarDefaultPurpose
ENCRYPTION_KEYnone (required)32 bytes, Base64 encoded. Encrypts data_sources.encrypted_password and data_sources.oauth_refresh_token_enc. Changing the value invalidates every ciphertext; there is no online rotation path.
AUTH_PROVIDERShosting-profile default (Bunyip enabled)Comma-separated priority list of authentication providers this process answers through.
TRUSTED_PROXY_CIDRSempty (trust nothing)Comma-separated CIDRs and bare IPs whose X-Forwarded-For, X-Real-IP, and X-IPCountry headers the api believes. Unset means the socket peer is the only non-forgeable input; the rate limiter and geolocation attribution key off it.

Job scheduling

Cron fields are sec min hour day-of-month month day-of-week year (7 fields).

VarDefaultPurpose
SCHEDULE_INCOMING_QUEUE0 0 */12 * * * *How often to poll data sources and process new emails.
SCHEDULE_FAILED_QUEUE0 0 */12 * * * *How often to reattempt emails sitting in the failed folder.
RETRY_COUNT5Attempts per email inside one incoming-queue run before it moves to the failed folder.
MAX_EMAILS_PER_RUN100Soft cap on emails processed per incoming-queue run, per source.
MAX_EMAILS_PER_RUN_LIMIT2000Hard ceiling. MAX_EMAILS_PER_RUN is clamped to this value.
SHUTDOWN_TIMEOUT300Seconds the api waits for in-flight jobs to finish during a graceful shutdown.

Geolocation

VarDefaultPurpose
IP2LOCATION_DB_PATHunsetAbsolute path to an IP2Location LITE DB11 binary file. Unset disables geolocation enrichment entirely; the job does not run and no dataset is required.

Alert SMTP

VarDefaultPurpose
SMTP_HOSTsmtp.example.comOutbound relay for alert emails.
SMTP_PORT587
SMTP_SECURITYstarttlsOne of starttls, tls, none.
SMTP_USERNAMEalerts@example.com
SMTP_PASSWORDnone
SMTP_FROM_ADDRESSDMARC Reporter <alerts@example.com>RFC 5321 address shown in the From header.
ADMIN_EMAILadmin@example.comRecipient for alert emails.
TRANSACTIONAL_OUTBOX_DIRtmp/outboxDirectory the api writes alert emails to instead of sending, when the recipient domain is non-routable (example.com, .invalid, .localhost, .test).

Alert thresholds

VarDefaultPurpose
ALERT_AUTH_FAILURE_RATE10.0Percentage. Triggers the HighAuthFailureRate alert when exceeded.
ALERT_VOLUME_SPIKE_RATE50.0Percentage. Triggers the EmailVolumeSpike alert when traffic grows by more than this over the previous period.

Weekly report

VarDefaultPurpose
WEEKLY_REPORT_ENABLEDfalseOpt in to a weekly summary email.
SCHEDULE_WEEKLY_REPORT0 0 8 * * 1 *Mondays at 08:00 by default. Only read when enabled.

Frontend and reverse proxy

VarDefaultPurpose
DOMAINdmarc.example.comPublic hostname served by Caddy.
FRONTEND_URLhttps://dmarc.example.comPublic URL of the SPA. Used as the post-OIDC return redirect.
CORS_ORIGINhttps://dmarc.example.comAllowed browser origin for the api’s CORS middleware. Falls back to FRONTEND_URL when unset.
API_PUBLIC_URLhttps://drillmark-api.example.comPublic URL of the api. Used to derive OAUTH_REDIRECT_URI when unset.
OAUTH_REDIRECT_URIderived from API_PUBLIC_URLExplicit callback URL; set only to override the derived value.

OIDC and Bunyip (required)

The api refuses to boot without the five OIDC values set.

VarDefaultPurpose
OIDC_ISSUERnone (required)URL of the mokosh-server OIDC OP.
OIDC_AUDIENCEnone (required)Expected aud claim on access tokens.
OIDC_JWKS_URLderived from issuerSigning key endpoint.
OIDC_CLIENT_IDnone (required)UUID of Drillmark’s oauth_clients row at mokosh-server.
OIDC_SCOPESopenid email offline_access mokosh:readScopes requested on the authorize URL.
MOKOSH_API_URLnoneMokosh REST surface for org sync (/v1/orgs). Usually the same host as OIDC_ISSUER.
BUNYIP_URLnoneOrigin of the Bunyip hub. Surfaced to the SPA as the post-logout target and the “manage your account” link. No trailing slash.
BUNYIP_STATUS_CLIENT_IDunsetMachine credential client id for Bunyip’s provider-status aggregator.
BUNYIP_STATUS_CLIENT_SECRETunsetPaired secret. Set both to enable the machine-credential path; either unset falls back to RequireAdminAccess alone.

Tenancy and invites

VarDefaultPurpose
DRILLMARK_DEFAULT_TENANT_IDfirst tenant rowTenant UUID new JIT-provisioned users land in.
INVITE_EXPIRY_DAYS7How long an invite link stays valid.
FEATURE_LOCAL_USER_MANAGEMENTfalseWhen off, the local user / org / invitation endpoints return 410 Gone. Flip on only once per-RP tenant claims through Bunyip are in place.

Back to top