Environment reference

Every TheSpider server environment variable

All server config is env-driven. Source of truth: server/src/http/env.ts, storage.ts, ai-adjudicator.ts.

Deployment & database

VariableDefaultReq?Purpose
DEPLOYMENT_MODEsaasonprem (single-org, license-gated) or saas (multi-tenant).
DATABASE_URLdev localhostPostgres connection string. BYO or the bundled postgres service.
MIGRATE_ON_BOOT1Run Drizzle migrations at startup. 0 to skip.
PORT8080Listen port (baked into the image).

Licensing (on-prem)

VariableDefaultReq?Purpose
LICENSE_JWTon-premThe signed license JWT. Absent ⇒ read-only.
LICENSE_PUBLIC_KEYembeddedbase64url raw Ed25519 key overriding the embedded one (rotation).
LICENSE_JWKS_URLoffOpt-in JWKS rotation refresh. off/empty = fully air-gapped.
ONPREM_ORG_SLUGdefaultSlug of the single org created at first boot.
ONPREM_ORG_NAMEOn-PremDisplay name of that org.

Telemetry

VariableDefaultPurpose
TELEMETRYonDaily+boot POST of version/usage-rollups/error-counts (never findings). off = zero outbound.
TELEMETRY_URL…/v1/telemetryWhere telemetry is sent when on.

Auth & web

VariableDefaultReq?Purpose
BETTER_AUTH_SECRETdev secretSession signing secret. Set it (a warning is logged otherwise).
BETTER_AUTH_URLhttp://localhost:8080✔*Public URL (cookies / redirects / CSRF origin). Set to your real hostname.
BETTER_AUTH_TRUSTED_ORIGINSExtra comma-separated trusted origins.
WEB_ROOT/app/web (image)Static SPA dir served same-origin. Set by the image; unset ⇒ API only.

* required for any deployment users reach over a real hostname.

Storage

VariableDefaultPurpose
ARTIFACTS_DIR.artifactsOn-disk artifact store (used when S3_BUCKET is unset).
S3_BUCKETSet to use S3-compatible object storage (MinIO/R2/S3) for artifacts.
S3_ENDPOINT / S3_REGIONS3 endpoint / region.
S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEYS3 credentials.

AI dedupe

VariableDefaultPurpose
AI_DEDUPE_API_KEYBYO key enabling server-run AI dedupe (the paid lever). Unset ⇒ heuristics-only.
AI_DEDUPE_BASE_URLhttps://api.anthropic.comMessages endpoint.
AI_DEDUPE_MODELclaude-haiku-4-5Cheap classification model.
AI_DEDUPE_TIMEOUT_MS20000Per-request adjudication timeout; batched requests scale it with pair count.
AI_DEDUPE_THRESHOLD0.15Heuristic-confidence floor before an AI call fires.
AI_DEDUPE_DAILY_CAP500Per-org/day cap on AI-adjudicated pairs (a batched request meters its pair count).
AI_DEDUPE_BATCH_SIZE20Max candidate pairs per adjudication request (clamped 1–20; 1 disables batching; ingest evaluates at most 12 candidates per finding).
Upgrades that change adjudication prompt semantics bump an internal prompt version folded into the pair-decision cache key: previously cached pairs are re-adjudicated once, so expect temporarily elevated AI-dedupe usage after such an upgrade until the cache refills (bounded by AI_DEDUPE_DAILY_CAP).

Integrations & limits

VariableDefaultPurpose
GITHUB_WEBHOOK_SECRETOptional: enables POST /v1/webhooks/github (PR → incremental campaign).
RATE_LIMIT_CAPACITY120Per-org token-bucket default capacity.
RATE_LIMIT_REFILL_PER_SEC4Per-org token-bucket refill. (Per-bucket overrides: `RATE_LIMIT_<CLAIM

Next steps