Configuration Reference
- Deployment-Global Variables (no service prefix)
- Shared Configuration (8 Core Services)
- craig-intake (port 8008)
- craig-intake-keyring (port 8010)
- craig-security-issuer (port 8011)
- craig-web (port 8080)
- craig-portal (port 8080; devstack host 8081)
- Object Store (CRAIG_STORE__)
- craig-seed (fixture generator, tooling)
All CRAIG services are configured via environment variables using the pattern CRAIG_<SERVICE><FIELD> (double underscore separator).
The shared ServiceSettings loader parses these with try_parsing(true), so numeric and boolean values are converted from strings before serde sees them (its #[serde(flatten)] per-service extensions depend on it).
craig-web, craig-portal, craig-intake, craig-intake-keyring and the object-store (CRAIG_STORE) loader keep every value a string and let each typed field parse its own, so a digits-only secret stays byte-exact (#1868, #2265, #2266, #2267).
(Exception: craig-seed reads its variables via raw std::env::var with bespoke fail-closed handling — see its section.)
|
Audited 2026-08-08 (#1050): every row below was verified against the loading code
( |
Deployment-Global Variables (no service prefix)
Read by multiple services (or the whole fleet) under a bare CRAIG_/standard name — set these once per deployment.
A deployment’s jurisdiction and its reference data come from CRAIG_CONFIG_SOURCE alone: the jurisdiction layer’s manifest names the jurisdiction, and its bundle/ directory carries the reference data (the bundle/ file map). CRAIGACTIVE_STATE_BUNDLES and CRAIG_<SVC>JURISDICTION are not read: one left set in a deployment is ignored. The jurisdiction prefixes rule-set names ({jurisdiction}-{function}) and selects the business calendar: business dates resolve through craig_common::BusinessClock on the zone the bundle’s settings.toml declares (business_timezone), and a jurisdiction that declares none runs on UTC.
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
CRAIG_PEER_JWKS_JSON / CRAIG_PEER_JWKS_JSON_FILE |
String (JSON array) |
empty registry |
Effectively yes for S2S actor flows |
Plan E peer-verifier registry: |
CRAIGREQUEST_CLAIMSWINDOW_DAYS |
u32 |
|
No |
ADR-062 §B: |
CRAIGBACKGROUND_JOBSWINDOW_DAYS |
u32 |
|
No |
#1933 (plan |
CRAIG_IDENTITY_SERVICE_ROLE_PREFIX |
String |
|
No |
Role prefix marking service-principal callers in claims ( |
CRAIG_IDENTITY_ROLES_CLAIM_PATH |
String (dot-separated claim names) |
|
No |
#2684: where tokens carry their roles (Okta/authentik |
CRAIG_FIELD_ENCRYPTION_KEY |
String |
— |
cases |
32-byte base64 field key shared by craig-cases + craig-seed — see the craig-cases extras row and the craig-seed section for the (deliberately different) failure semantics. Ciphertext envelope format v2 since #1007 (the storage context is bound as AAD): a keyed database seeded under v1 must reseed. Also read by the |
CRAIG_REPORTING_FIELD_ENCRYPTION_KEY |
String |
— |
reporting |
#2138 (plan |
CRAIG_CONFIG_SOURCE |
String (comma-separated |
— |
Yes: every service that loads configuration, and |
ADR-087 (#2952): the configuration layers, lowest precedence first — |
CRAIG_CONFIG_ALLOW_UNVERIFIED |
|
|
No |
ADR-087 (#2952): the working-copy escape hatch. An explicit |
CRAIG_CONFIG_ROOT |
Path |
— |
With a |
ADR-087 (#2955): where |
RUST_LOG |
String |
— |
No |
Standard tracing env filter. When set AND parseable it fully OVERRIDES the per-service |
OTEL_EXPORTER_OTLP_ENDPOINT |
String |
— |
No |
When set enables OTLP trace export + Prometheus metrics with the service name as the OTel resource; unset ⇒ JSON logging only. A credential header ( |
OTEL_EXPORTER_OTLP_HEADERS |
String (comma-separated |
— |
No |
Auth/metadata headers (e.g. |
OTEL_RESOURCE_ATTRIBUTES |
String (comma-separated |
— |
No |
Extra OTel resource attributes (e.g. |
Shared Configuration (8 Core Services)
Services: craig-rules, craig-cases, craig-placement, craig-exchange, craig-financial, craig-reporting, craig-security, craig-composition.
Prefix: CRAIG_<SERVICE> (e.g., CRAIG_RULESPORT=8001)
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
PORT |
u16 |
— |
Yes |
Service listening port. The bind address is hardcoded |
DATABASE_URL |
String |
— |
Yes |
PostgreSQL connection URL. Also read directly by the same-image |
RABBITMQ_URL |
String |
— |
Yes |
RabbitMQ AMQP connection URL. #1202: each service connects as its OWN least-privilege broker account ( |
OIDC_ISSUER |
String |
— |
Yes |
Keycloak realm issuer URL (JWT |
OIDC_INTERNAL_URL |
String |
— |
No |
Internal Keycloak URL for JWKS discovery (falls back to issuer) |
CLIENT_ID |
String |
— |
Yes under |
OIDC |
CLIENT_SECRET |
String |
— |
paired with CLIENT_ID |
Secret for the service principal |
SIGNING_JWK / SIGNING_JWK_FILE |
String (inline ES256 private JWK / secret-mount path) |
— |
No (as a set) |
Plan E actor-identity keypair: with SIGNING_KID it wires the |
SIGNING_KID |
String |
— |
iff a JWK source is set |
|
TOKEN_VALIDATION_MODE |
|
|
No |
ADR-029 token-validation dispatch. |
INTROSPECTION_CACHE_TTL_SECONDS |
u64 |
|
No |
Introspection verdict cache TTL |
INTROSPECTION_CACHE_MAX_ENTRIES |
usize |
|
No |
Introspection cache size bound |
INTROSPECTION_SERVE_ON_OUTAGE |
bool |
|
No |
Serve cached verdicts during an introspection outage. Default fail-closed |
INTROSPECTION_ENDPOINT |
String |
discovery |
No |
Explicit introspection endpoint override (discovery wins when unset) |
INTROSPECTION_AUTH_METHOD |
|
|
No |
How the service authenticates to the introspection endpoint |
SUBJECT_CLIENTS |
String (comma list) |
`` (empty) |
No |
ADR-076 D2: the public OIDC client ids ( |
PORTAL_PATHS |
String (comma list) |
`` (empty) |
No |
ADR-076 D3: the |
LOG_LEVEL |
String |
|
No |
Logging level (debug, info, warn, error). A set-and-parseable |
CORS_ORIGINS |
String |
empty (same-origin only) |
No |
Comma-separated allowed CORS origins, or |
BODY_LIMIT |
usize |
|
No |
Maximum request body size in bytes — the GLOBAL cap on every route (#974: attachment routes carry the separate cap below; nothing raises this one for uploads any more) |
ATTACHMENT_BODY_LIMIT |
usize |
unset → |
No |
#974: whole-request cap for the ATTACHMENT-ACCEPTING routes only — craig-cases (contact / report / court-order attachments), craig-placement (home documents), craig-exchange (ICPC attachments); parsed by every service, consumed by those three. Per-route inner |
RATE_LIMIT_RPM |
u32 |
|
No |
Per-IP request cap per MINUTE; |
TRUSTED_PROXIES |
String |
empty (no proxies trusted) |
No |
#766: comma-separated CIDRs of trusted upstream proxies (LBs, ingress, the BFF) for the rate limiter’s client-IP extraction — the craig-intake Plan C §D5 design, now fleet-wide via |
DB_MAX_CONNECTIONS |
u32 |
|
No |
Database connection pool size. Size against the server’s |
DB_IDLE_TIMEOUT_SECS |
u64 |
|
No |
Database connection idle timeout in seconds |
DB_STATEMENT_TIMEOUT_MS |
u64 |
|
No |
F-019: Postgres |
ADMIN_UNIT_LABEL |
String |
— |
Yes |
Display label for the admin-unit concept (County, Region, Chapter, etc.; Plan A §12 removed the silent |
CASES_BASE_URL |
String |
No (but craig-placement is a 503 without it) |
#1776: craig-cases base URL — a SHARED-CORE leaf, not an extension field, because exchange (ICPC), placement (the placement-facts read behind every matching search / activating transition) and reporting (the |
|
PLACEMENT_BASE_URL |
String |
No (but craig-financial’s eligibility and portal reads are 503 without it) |
#2118: craig-placement base URL — a SHARED-CORE leaf since #2118 (LIFTED from |
|
FINANCIAL_BASE_URL |
String |
No |
#2140: craig-financial base URL — a SHARED-CORE leaf ( |
|
SECURITY_BASE_URL |
String |
No (but a ruleset that consults |
#1903 / ADR-077 D4: craig-security base URL — a SHARED-CORE leaf since #1903 (LIFTED from |
|
ADMIN_UNITS__MAX_AGE_SECS |
u64 |
|
No |
#1903 / ADR-077 D4: how old an installed admin-units snapshot may be before the engine’s units source answers |
AUTHZ_REQUIRE_FULL_COVERAGE |
bool |
|
No |
Boot-bail when the jurisdiction×resource-type authz matrix has uncovered tuples |
AUTHZ_POLICY_TTL_SECONDS |
u64 |
|
No |
Authz ruleset-cache TTL fallback for missed invalidation events |
AUTHZ_EVAL_TIMEOUT_MS |
u64 |
|
No |
Per-authz-decision eval budget; elapsing returns a typed 503 (#1126). Valid |
AUTHZ_FUNCTION_TIMEOUT_MS |
u64 |
|
No |
JS function-node interrupt bound published into zen’s PROCESS-GLOBAL config at boot (#1328); explicit values must sit in |
EVENT_OUTBOX_RETENTION_DAYS |
u32 |
|
No |
#965/#1129 (ADR-058): |
EVENT_INBOX_RETENTION_DAYS |
u32 |
|
No |
#965/#1129 (ADR-058): |
RETENTION_ARCHIVE__ENABLED |
bool |
|
No |
#1129 (ADR-058 D11): consent to archive-then-prune audit-class rows. Consumed by craig-security + craig-rules; gates the scheduled worker AND security’s |
RETENTION_ARCHIVE__HOT_WINDOW_DAYS |
u32 |
|
No |
#1129: archive-eligibility age (1..=3650, load-validated even while disabled). craig-exchange additionally floors it at ≥365 (#1466 B5 — the SSA screening quiescence horizon; the devstack compose sets it). Operational knob, NOT the DFCS records-retention schedule (⁂ #1073) |
RETENTION_ARCHIVE__INTERVAL_SECONDS |
u64 |
|
No |
#1129: scheduled archive-pass cadence; |
RETENTION_ARCHIVE__BATCH_SIZE |
u32 |
|
No |
#1129: rows per archive batch (1..=10000); one batch = one object + one crash-atomic prune transaction |
RETENTION_ARCHIVE__MAX_BATCH_BYTES |
usize |
|
No |
#1129: byte cap per archive object (>= 4096; boot-validated ⇐ the store’s MAX_UPLOAD_BYTES); a single row exceeding it alone quarantines loudly (D13) |
Service-Specific Extras
Since 998 the single-service knobs of the shared ServiceSettings live in per-service extension structs (crates/craig-common/src/settings.rs), flattened into the shared struct with [serde(flatten)] so that every variable name is unchanged (CRAIG_<SVC><FIELD>; nested groups still nest on ). Which struct owns which:
-
CasesSettings(settings.cases) —JWS_REPLAY_TTL_HOURS,JWS_REPLAY_CLEANUP_INTERVAL_SECONDS,EXCHANGE_BASE_URL.ENCRYPTION_MODEis a shared-core leaf since #2138 (settings.encryption_mode, lifted fromCasesSettings; env names unchanged): craig-cases and craig-reporting each read it under their own prefix -
ExchangeSettings(settings.exchange) —ICPC_DEADLINE_DAYS,PARTNER_AUTH_PLAIN_HTTP_HOSTS(#2427), theSSA_SCREENING*group, theTRIGGERS*,COLLECTIONS*(#3188) andPERSON_INDEX*(#3192) consent groups, and theRETURNS*group (#3193), which holds the return listener’s four settings beside its own per-interface consents. Each consent group is a map from interface to itsENABLEDknob (TRIGGERS<INTERFACE>ENABLED, #3196): there is no field per partner, an interface with no variable is off, and a variable naming an interface the deployment’s partner set has no leg of that kind for stops craig-exchange at boot.CASES_BASE_URLis NOT an extension field since #1776 — it is a shared-core leaf (settings.cases_base_url):CRAIG_EXCHANGE,CRAIG_PLACEMENTandCRAIG_REPORTINGCASES_BASE_URLall reach it (a per-service twin would be handed to the first flattened struct and silently keep its default). craig-placement REQUIRES it in practice: the default ishttp://localhost:8002, and with it unset every matching search and every activating transition is a 503 (the placement-facts read behind them fails closed) -
FinancialSettings(settings.financial) —PAYMENT_PERIOD,SUBSIDY_GENERATOR_INTERVAL_SECONDS, theSUBSIDY_REVIEW_SWEEP*/SUBSIDY_ERR*/SUBSIDY_SG*/SUBSIDY_IMPORT*/SUBSIDY_CAREGIVER_CHECK__*groups.PLACEMENT_BASE_URLis NOT an extension field since #2118 — it is a shared-core leaf (settings.placement_base_url, lifted fromFinancialSettings; env name unchanged) -
SecuritySettings(settings.security) —ADMIN_UNIT_LABEL(still required by every service, as before: the move added no default) -
PlacementSettings(settings.placement, #1641) —RULES_ENGINE_URL(the eligibility consult’s base URL; the only service whose copy is a settings field), theEXPIRY_SWEEP__*group,ENROLLMENT_RATE_LIMIT_RPM(#1848);RULESETS_DIR(#634) was retired by #2955 — the field-owner map comes from the config layers (CRAIG_CONFIG_SOURCE).SECURITY_BASE_URLis NOT an extension field since #1903 — it is a shared-core leaf (settings.security_base_url, lifted fromPlacementSettings; every engine-bearing service reads it for the admin-units snapshot, placement also for the #1851 display-name read; env names unchanged)
The split is a code-ownership boundary, not an environment one: every service still parses all five groups and ignores the ones it does not own, and RETENTION_ARCHIVE__* stays in the shared core above because security, rules AND exchange consume it (likewise CASES_BASE_URL — exchange, placement and reporting, #1776 / #2118 — PLACEMENT_BASE_URL — craig-financial today, craig-reporting’s AFCARS export client, #2140 — FINANCIAL_BASE_URL — craig-reporting, #2140 — and SECURITY_BASE_URL — every engine-bearing service, #1903). Variables in this table that are not ServiceSettings fields (RULES_ENGINE_URL outside craig-placement, EVAL_TIMEOUT_MS, FUNCTION_TIMEOUT_MS, DECISION_REFRESH_SECONDS, CASES_URL, DETECTION_INTERVAL_SECS, AUDIT_BATCH_MAX — #2765) are read by their service directly from the environment. One corner case of the flatten path: a value for one of the moved String leaves that parses as a bare number or boolean (e.g. ADMIN_UNIT_LABEL=123) is refused at boot with a typed error rather than accepted as text; real labels and URLs are unaffected. Relatedly, an unparsable value for a moved leaf (e.g. ICPC_DEADLINE_DAYS=abc) still fails boot with a typed error, but the message names only the offending value and the expected type (invalid type: string "abc", expected i64) — not the key, which the shared-core leaves still report (… for key `icpc_deadline_days in the environment`); match the quoted value against this table to find the variable.
| Service | Variable | Default | Description |
|---|---|---|---|
all except craig-rules |
RULES_ENGINE_URL |
craig-rules base URL, read per-service ( |
|
craig-rules |
RULE_SET_AUTHORITY |
|
Who owns the deployment’s rule sets (ADR-087 § Amendment — #2956). |
craig-rules |
EVAL_TIMEOUT_MS |
|
Budget for one rules evaluation dispatch (queue wait + evaluation), milliseconds; elapsing returns 503 on |
craig-rules |
FUNCTION_TIMEOUT_MS |
|
Per-NODE interrupt bound for JDM JS function nodes, milliseconds (#1046 / ADR-006 §Amendment #1046) — published into zen-engine’s process-global config at boot, replacing the silently-inherited upstream 5s default. An explicit value must sit in |
craig-rules |
DECISION_REFRESH_SECONDS |
|
Decision-cache sweep interval, seconds (#1188 / the ADR-006 #1188 amendment). Valid |
craig-cases |
ENCRYPTION_MODE |
|
Field-encryption posture (ADR-020 / ADR-048): |
craig-cases |
|
— |
32-byte base64 field key, shared with craig-seed so seeded rows match service-written ones. In |
craig-cases |
JWS_REPLAY_TTL_HOURS |
|
TTL (hours) for |
craig-cases |
JWS_REPLAY_CLEANUP_INTERVAL_SECONDS |
|
Poll interval for the |
craig-exchange |
ICPC_DEADLINE_DAYS |
|
ICPC home-study deadline in calendar days, stamped as |
craig-exchange |
PARTNER_AUTH_PLAIN_HTTP_HOSTS |
empty |
#2427 (TP-2 D1): comma-separated exact hosts (trimmed, empties dropped) that a partner whose |
craig-exchange |
COLLECTIONSDOE_SLDSENABLED |
|
#3188: consent to collect the education agency’s weekly student file ( |
craig-exchange |
PERSON_INDEX<INTERFACE>ENABLED |
|
#3192: consent to ask the deployment’s person index, the partner that answers who a person is across agencies, about a person: to find candidates, to register a person and to tell it the agency holds one ( |
craig-exchange |
RETURNS<INTERFACE>ENABLED |
|
#3193 (ADR-091): consent to take the calls of the partner of that interface on the return listener. A separate consent from |
craig-exchange |
RETURNS__PORT |
unset |
#3193: the port the partner-return listener binds, on every address of the host, apart from the API port. Required once an interface consents to returns: craig-exchange refuses to start without it. The listener serves |
craig-exchange |
RETURNSTLS_CERT_FILE, RETURNSTLS_KEY_FILE |
unset |
#3193: the listener’s own certificate chain and its private key, PEM files. Required once an interface consents; a file that is unset, unreadable, holds no certificate, or a key that is not the certificate’s, refuses the start. Read once at start: a renewed certificate takes effect at the next start |
craig-exchange |
RETURNS__CLIENT_CA_FILE |
unset |
#3193: the certificate authorities whose client certificates may complete the listener’s handshake, a PEM bundle. Required once an interface consents; a bundle with no certificate refuses the start. A certificate that chains to one of them still admits nobody until it is registered and approved against a partner in craig-security ( |
craig-exchange |
COLLECTION_SCHEDULE__INTERVAL_SECONDS |
|
#3190: the least time, in seconds, between two runs of one collection by the |
craig-exchange |
PLACEMENT_BASE_URL |
#3188: the shared-core leaf ( |
|
craig-financial |
CASES_URL |
craig-cases URL — placement-activation billing resolves the child’s DOB from cases at event time (#979) |
|
craig-financial |
PLACEMENT_BASE_URL |
Shared-core leaf since #2118 ( |
|
craig-financial |
PAYMENT_PERIOD |
|
Payment-period boundary policy for per-diem billing rollups: |
craig-financial |
SUBSIDY_GENERATOR_INTERVAL_SECONDS |
|
#1068/ADR-053: monthly subsidy generation scheduler interval. 0 = disabled — enabling automated money generation is explicit deployment consent. Also requires the deployment’s bundle to declare |
craig-financial |
SUBSIDY_REVIEW_SWEEP__INTERVAL_SECONDS |
|
#1096/ADR-054 U4: review-sweep scheduler tick. 0 = no scheduler — sweep enforcement MUTATES agreement status, so the tick is explicit deployment consent (deliberate asymmetry with the always-on devstack generator). Also requires the deployment’s bundle to declare |
craig-financial |
SUBSIDY_REVIEW_SWEEP__MATERIALIZE |
|
#1096: scheduled sweeps materialize missing first review slots from term anchors |
craig-financial |
SUBSIDY_REVIEW_SWEEP__AUTO_SUSPEND |
|
#1096: enforce leg 1 — suspend agreements whose open review is past due + 30-day grace; recorded |
craig-financial |
SUBSIDY_REVIEW_SWEEP__AUTO_TERMINATE |
|
#1096: enforce leg 2 — terminate agreements suspended three months or more ( |
craig-financial |
SUBSIDY_REVIEW_SWEEP__AUTO_PER_DIEM_HANDOFF |
|
#1069 M3/ADR-055: enforce leg 3 — terminate an ERR agreement whose caregiver’s foster per diem began on the agreement’s own placement (reason |
craig-financial |
SUBSIDY_ERR__ENABLED |
|
#1069 M2 (F4): the one-shot ERR creation gate, nested as |
craig-financial |
SUBSIDY_SG__ENABLED |
|
#1070 (U4): the SG/NRSG guardianship ENROLLMENT-consent gate, nested as |
craig-financial |
SUBSIDY_IMPORT__ENABLED |
|
#1071/ADR-057 (D12): the closed-cohort conversion-import gate, nested as |
craig-financial |
SUBSIDY_BACKPAY__ENABLED |
|
#1115 (plan backpay-import-path; G-B ruling 2026-10-08 on #1115): the below-floor backpay consent gate, nested as |
craig-financial |
SUBSIDY_CAREGIVER_CHECK__ENABLED |
|
#1852 (plan |
craig-placement |
EXPIRY_SWEEP__INTERVAL_SECONDS |
|
#1641: the foster-home expiry notice sweep tick, nested as |
craig-placement |
EXPIRY_SWEEP__LEAD_DAYS |
|
#1641 / #1642: days ahead of a license or training-certificate expiry the |
craig-placement |
ENROLLMENT_RATE_LIMIT_RPM |
|
#1848 / ADR-076 D3: the quota on |
craig-reporting |
CASES_BASE_URL |
craig-cases URL — the shared-core |
|
craig-reporting |
PLACEMENT_BASE_URL |
#2140 (plan |
|
craig-reporting |
FINANCIAL_BASE_URL |
#2140 (plan |
|
craig-reporting |
ENCRYPTION_MODE |
|
#2138: the column-key posture for craig-reporting, read as |
craig-reporting |
|
— |
#2138: the craig-reporting column key (global row above). In |
craig-security |
DETECTION_INTERVAL_SECS |
|
Periodic detection-scan interval, seconds (note the |
craig-security |
AUDIT_BATCH_MAX |
|
2765 (plan |
craig-intake (port 8008)
Prefix: CRAIG_INTAKE__
The intake service is a stateless edge in both modes (ADR-017): it owns no database and consumes no message queue — partner identity lives in craig-security, reports live in craig-cases, and every submission is forwarded over HTTP. There are therefore no DATABASE_URL/RABBITMQ_URL/DB_* variables for this service (#1211). Intake also requires the deployment-global CRAIG_CONFIG_SOURCE (its jurisdiction and the theme of its embedded public UI come from the configuration layers — boot fails without it). The MODE variable selects how partner credentials are validated:
-
Integrated (default): full CRAIG deployment — partner keys validated via craig-security, submissions forwarded to craig-cases
-
Standalone: air-gapped edge — partner keys read from a local JSON file; forwards to a remote cases service, or with
BACKEND_PROFILE=shinesdrops each conformed SHINESCpsRequestinto an S3 bucket (GA SHINES ingests by bucket drop) + verifies signatures against the keyring sidecar (ADR-042 § "Amendment 2026-08-31")
Values reach each field as strings: a digits-only CLIENT_ID, CLIENT_SECRET, IP_HASH_SECRET or BOT_PROTECTION__SECRET is used byte for byte (#2265).
Integer and bool fields parse their own string form, so an integer written in float or exponent form (1.1e7, 5.0) refuses boot instead of being rounded, and SELF_SIGNED_TLS must be true/false/1/0/on/off/yes/no (any case).
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
PORT |
u16 |
— |
Yes |
Service listening port |
MODE |
IntakeMode |
|
No |
Operating mode: |
BACKEND_PROFILE |
BackendProfile |
|
No |
ADR-042 durable-backend selection: |
OIDC_ISSUER |
String |
— |
Yes |
OIDC issuer URL (both modes — intake mints |
OIDC_INTERNAL_URL |
String |
— |
No |
Internal OIDC URL for split-DNS deployments (falls back to issuer) |
CLIENT_ID |
String |
— |
Yes |
OIDC |
CLIENT_SECRET |
String |
— |
Yes |
Secret for the service principal |
LOG_LEVEL |
String |
|
No |
Logging level |
CORS_ORIGINS |
String |
|
No |
Allowed CORS origins ( |
BODY_LIMIT |
usize |
|
No |
Max request size (accommodates 10 MiB file upload + overhead) |
CASES_URL |
String |
— |
Unless SHINES |
craig-cases base URL — required in every cases-backed configuration (both modes); only the standalone-SHINES backend omits it |
S3_KEY_PREFIX |
String |
|
No |
Object-key prefix for the standalone-SHINES drop ( |
KEYRING_URL |
String |
— |
SHINES |
|
SECURITY_URL |
String |
— |
Integrated |
craig-security base URL (partner verification + signer-key lookup); ignored in standalone |
IP_HASH_SECRET |
String |
— |
Yes |
Per-deployment HMAC secret for |
TRUSTED_PROXIES |
String (CSV CIDRs) |
empty |
No |
CIDRs whose X-Forwarded-For/Forwarded headers are trusted for client-IP resolution (rate limiting + audit hashing) |
BOT_PROTECTION__MODE |
String |
|
No |
ADR-069 seam posture: |
BOT_PROTECTION__VERIFY_URL |
String |
— |
remote_verify |
Verifier endpoint (HTTPS required; any siteverify-shaped endpoint — hosted vendor or self-hosted) |
BOT_PROTECTION__SECRET |
String |
— |
remote_verify |
Verifier secret (reference the ADR-064 store, never inline) |
BOT_PROTECTION__SITEKEY |
String |
— |
remote_verify |
Public sitekey rendered into the widget container |
BOT_PROTECTION__WIDGET_SCRIPT_SRC |
String |
— |
remote_verify |
Vendor widget script URL (HTTPS; its origin joins script-src) |
BOT_PROTECTION__WIDGET_CLASS |
String |
— |
remote_verify |
Widget container class the vendor JS scans for |
BOT_PROTECTION__TOKEN_FIELD |
String |
— |
remote_verify |
Hidden-input name the vendor JS populates (report-form.js copies it into |
BOT_PROTECTION__EXPECTED_HOSTNAME |
String |
— |
No |
When set, the verifier’s |
BOT_PROTECTION__CSP_FRAME_SRC |
list |
empty |
No |
Extra frame-src hosts the widget needs (explicit, recorded CSP loosening) |
BOT_PROTECTION__CSP_CONNECT_SRC |
list |
empty |
No |
Extra connect-src hosts the widget needs |
PUBLIC_RATE_LIMIT |
u32 |
|
No |
Maximum public submissions per IP per hour. |
SIGNED_RATE_LIMIT |
u32 |
|
No |
Requests per IP per hour on the standalone-SHINES signed nest |
PARTNER_RATE_LIMIT |
u32 |
|
No |
#3083: requests per IP per hour on the partner API nest |
SIGNED_MAX_FILE_BYTES |
usize |
|
No |
Per-file cap for signed-path multipart attachments (ADR-042 §D9) |
SIGNED_BODY_LIMIT |
usize |
|
No |
Whole-request body cap for the signed nest (overrides |
PUBLIC_MAX_FILE_BYTES |
usize |
|
No |
#1324: per-file cap for public/partner attachment uploads, enforced AT THE EDGE while buffering — the reporter gets intake’s own 400 naming the limit, never the redacted downstream generic. Boot-validated ≤ |
CASES_MAX_UPLOAD_BYTES |
usize |
|
No |
#1324: the operator’s DECLARATION of cases' |
PARTNER_KEYS_FILE |
String |
— |
No |
Path to JSON file with partner API keys (standalone; absent ⇒ the partner API rejects all requests, warned at boot) |
TLS_CERT_FILE / TLS_KEY_FILE |
String |
— |
No |
ADR-046 optional in-process TLS — PEM cert/key paths, both-or-neither; default is plain HTTP behind an ingress terminator |
SELF_SIGNED_TLS |
bool |
|
No |
ADR-046 dev/test-only ephemeral self-signed cert; requires the |
DEBUG_EMIT_CPS_REQUEST |
String |
— |
No |
#713 dev/integration only — debug CpsRequest panel gate. Active ONLY when set to the exact value |
craig-intake-keyring (port 8010)
Prefix: CRAIG_INTAKE_KEYRING__
The keyring is the standalone-SHINES-only sidecar (ADR-042 §D8): the signer-key registry, JWS replay dedup and signing receipts, in its own Postgres database (craig_intake_keyring, ADR-042 § Amendment 2026-08-26), applied by the craig-intake-keyring-migrate gate. No message queue, no OIDC — it consumes none of the shared variables. Admin lifecycle routes fail closed when ADMIN_TOKEN is unset. It also owns the WebAuthn (passkey) policy, which both SHINES intake instances fetch from GET /webauthn/config at boot and refuse to start without (ADR-082 D2).
Values reach each field as strings: a digits-only ADMIN_TOKEN is the bearer byte for byte, so a 32-zero token authenticates only as those 32 bytes, never as 0 (#2266).
Integer and bool fields parse their own string form, so an integer written in float or exponent form (1e4, 86400.0) refuses boot instead of being rounded, and ENABLE_KEY_LIST must be true/false/1/0/on/off/yes/no (any case).
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
PORT |
u16 |
— |
Yes |
TCP listen port (ADR-042 §D8 convention: 8010); |
LOG_LEVEL |
String |
|
No |
Tracing level |
DATABASE_URL |
String |
— |
Yes |
Postgres URL of the |
ADMIN_TOKEN |
String |
— |
No |
Bearer token gating the approve/revoke lifecycle routes. Absent ⇒ those routes fail-closed reject everything (boot warn names this var); set-but-blank is a load error so an empty value can never authorize. Debug-redacted |
REPLAY_RETENTION_SECS |
u64 |
|
No |
JWS replay-record retention: records with |
MAX_KEYS |
usize |
|
No |
Cap on stored signer keys; |
ENABLE_KEY_LIST |
bool |
|
No |
#714: mounts the metadata-only |
WEBAUTHN_RP_ID |
String |
— |
Yes |
ADR-082 D2: the WebAuthn relying-party ID passkeys are scoped to — a bare host ( |
WEBAUTHN_ALLOWED_ORIGINS |
String |
— |
Yes |
Comma-separated origins a passkey ceremony may come from: |
WEBAUTHN_REQUIRE_DEVICE_BOUND |
bool |
|
No |
ADR-082 D7: refuse backup-eligible (syncable) passkeys at registration and at assertion, for deployments that provision hardware keys. Not enforced yet: served from |
WEBAUTHN_MAX_ACTIVE_PER_IDENTITY |
u32 |
|
No |
ADR-082 D5: active passkeys one identity may hold before an added device waits for an admin; at least 1. Not enforced yet: validated today; the self-service add-device operation (U7, #2198) enforces it |
craig-security-issuer (port 8011)
Prefix: CRAIG_SECURITY__
The internal token issuer (ADR-085 D2, #2741) is craig-security’s
image run as craig-security issuer (the compose service craig-security-issuer). It reads only the variables
below, validated at boot (a missing, unparseable or out-of-bounds value refuses startup, never defaulted): none of
the shared variables, no RabbitMQ, rules-engine or object-store setting, and never CRAIG_SECURITY__DATABASE_URL
(the app login’s). Not yet trusted: no service validates its tokens until the switch (ADR-085 D15).
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
IDENTITY_PORT |
u16 |
— |
Yes |
TCP listen port for |
IDENTITY_DATABASE_URL |
String |
— |
Yes |
Postgres URL of |
IDENTITY_DB_MAX_CONNECTIONS |
u32 |
|
No |
The issuer pool’s size, 12–64 (ADR-085 D17: six background connections, the rest for requests). The issuance-log writer holds one more connection of its own |
IDENTITY_ISSUER |
String |
— |
Yes |
The issuer identifier (#2743): every token’s |
IDENTITY_CLIENT_KEYS_FILE |
path |
— |
Yes |
The client-key registry (ADR-085 D11, D17), read once at boot: |
IDENTITY_TOKEN_RATE_LIMIT_RPM |
u32 |
|
No |
The per-IP limit on |
TRUSTED_PROXIES |
String |
empty |
No |
Comma-separated CIDRs whose |
Logging follows RUST_LOG (default info); OTEL_EXPORTER_OTLP_ENDPOINT enables the OTLP exporter as for every
service.
craig-web (port 8080)
Prefix: CRAIG_WEB__
The web service is a BFF (Backend-For-Frontend) that proxies requests to backend services and renders HTML via Askama templates. It also requires the deployment-global CRAIG_CONFIG_SOURCE: its theme and terminology come from the jurisdiction layer’s bundle/.
Values reach each field as strings: a digits-only SESSION_SECRET or CLIENT_SECRET is used byte for byte (#1868).
Integer and bool fields parse their own string form, so an integer written in float or exponent form (1e7, 1800.0) refuses boot instead of being rounded, and a bool knob must be true/false/1/0/on/off/yes/no (any case).
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
PORT |
u16 |
— |
Yes |
Web UI listening port |
OIDC_ISSUER |
String |
— |
Yes |
Keycloak issuer URL for JWT validation |
OIDC_INTERNAL_URL |
String |
— |
No |
Internal Keycloak URL for OIDC discovery |
KEYCLOAK_CLIENT_ID |
String |
— |
Yes |
Keycloak client ID for the user-facing code-flow login (e.g., |
KEYCLOAK_REDIRECT_URI |
String |
— |
Yes |
OAuth redirect URI |
CLIENT_ID |
String |
— |
Yes under |
craig-web’s OWN confidential client (Plan E §9 / ADR-028) — distinct from KEYCLOAK_CLIENT_ID: the |
CLIENT_SECRET |
String |
— |
paired |
Secret for CLIENT_ID; both must be non-empty to wire the service-token source and the introspection principal |
TOKEN_VALIDATION_MODE |
|
|
No |
#2686: how the BFF validates the login access token — the services' ADR-029 dispatch (a JWS through JWKS, an opaque / JWE token through RFC 7662 introspection, |
SIGNING_JWK / SIGNING_JWK_FILE / SIGNING_KID |
String |
— |
No (as a set) |
The BFF’s actor-issuer keypair ( |
RULES_URL |
String |
— |
Yes |
craig-rules service URL |
CASES_URL |
String |
— |
Yes |
craig-cases service URL |
PLACEMENT_URL |
String |
— |
Yes |
craig-placement service URL |
EXCHANGE_URL |
String |
— |
Yes |
craig-exchange service URL |
FINANCIAL_URL |
String |
— |
Yes |
craig-financial service URL |
REPORTING_URL |
String |
— |
Yes |
craig-reporting service URL |
SECURITY_URL |
String |
— |
Yes |
craig-security service URL |
COMPOSITION_URL |
String |
— |
Yes |
craig-composition backend base URL (Plan X / ADR-035 composed surfaces) |
SESSION_SECRET |
String |
— |
Yes |
AES-GCM master key for the stateless session cookie ( |
SESSION_MAX_AGE_SECS |
i64 |
|
No |
Session cookie lifetime in seconds (default: 30 minutes). Increase for longer idle timeouts; decrease for stricter security. |
SESSION_SECURE |
bool |
|
No |
Emit the |
LOG_LEVEL |
String |
|
No |
Logging level |
DEFAULT_LOCALE |
String |
|
No |
Default i18n locale, and the reference a second language is measured against: craig-web offers a locale only when it carries every message this one does (#1487). Only |
THEME |
String |
— |
Yes |
UI theme name (CSS theme identifier; Plan A §12 removed the silent |
BRANDING_AGENCY |
String |
— |
Yes |
Agency name for branding (Plan A §12 removed the silent default) |
BRANDING_APP_NAME |
String |
|
No |
Application name for branding |
BRANDING_LOGO_URL |
String |
— |
No |
Custom logo URL (defaults to theme logo) |
PLUGIN_ALLOWED_HOSTS |
CSV list |
empty (deny ALL plugin fetches) |
No |
Fail-closed SSRF allow-list for plugin outbound fetches (ADR-033 §6). Entries are trimmed; empty entries are dropped. Never list loopback/metadata hosts |
TRUSTED_PROXIES |
String |
empty (no proxies trusted) |
No |
#1569: CIDRs of the proxies in FRONT of craig-web (ingress/LB), for deriving the browser client’s IP via the shared #766 walk. The BFF relays the derived IP on every S2S call as an RFC 7239 |
UPLOAD_BODY_LIMIT |
usize |
|
No |
Max multipart request-body size (bytes) for the two BFF upload routes (case-contact attachments, placement home documents). axum’s built-in 2 MiB default otherwise rejects routine multi-MB scans / photos at the edge (#970). Applied per-route — every other BFF route keeps the 2 MiB default. Must be ≤ each storing backend’s |
|
A file upload traverses up to four request-body caps — ingress/reverse-proxy → BFF ( |
craig-portal (port 8080; devstack host 8081)
Prefix: CRAIG_PORTAL__
The caregiver self-service portal (plan portals U5, ADR-076 D6): a second BFF on the shared
crates/craig-bff substrate. It loads no configuration layers — its theme is the shipped
Foundation palette (craig_state_bundle::foundation_palette(), ruling R3; not the product default, which
stays Simple Statehouse for craig-web) and its copy ships en + es (portal.ftl). The full variable table lives
in the deployment guide § craig-portal; the shape that differs from craig-web:
-
REDIRECT_URImust end with/callback;CLIENT_ID/CLIENT_SECRETare REQUIRED (the SubjectToken channel has no bearer fallback); onlyPLACEMENT_URLandFINANCIAL_URLexist (never craig-cases). -
TOKEN_VALIDATION_MODE(jws/introspect/auto, defaultauto; #2686) selects how the login access token is validated, exactly as craig-web’s: a JWS through JWKS, an opaque / JWE token through RFC 7662 introspection as theCLIENT_IDconfidential client,azp=KEYCLOAK_CLIENT_IDon both. -
LOGIN_RATE_LIMIT_RPM(default30,0disables) fronts/loginwith the shared per-IP limiter (problem+json). -
U10 (#1853) adds two HTML-shaped per-client-IP limiters — the same
RetainingIpLimiter, but a refusal is a flash + 303 back to the page the caregiver came from, never problem+json:ENROLLMENT_RATE_LIMIT_RPM(default10,0disables) onPOST /enrol(the "too many tries, wait one minute" flash — the same one a placement 429 fromCRAIG_PLACEMENTENROLLMENT_RATE_LIMIT_RPM, default 5 per IP AND per subject, answers) andUPLOAD_RATE_LIMIT_RPM(default30,0disables) on the certificate uploadPOST /units/{unit}/documents. Every per-IP axis — the portal’s three limiters AND placement’s enrollment quota — keys on the caregiver’s browser only when each service’s trusted-proxy list names the hop in front of it: the ingress CIDR inCRAIG_PORTALTRUSTED_PROXIES, the portal’s CIDR inCRAIG_PLACEMENT__TRUSTED_PROXIES(the BFF relays the derived IP asForwarded: for=); otherwise every caregiver shares ONE bucket. -
U11 (#634) adds a third HTML-shaped per-client-IP limiter of the same shape,
PROPOSAL_RATE_LIMIT_RPM(default30,0disables), onPOST /units/{unit}/proposals— the "Ask to change" form; a refusal is the same flash + 303 back to the unit page the request came from (the target is derived from the request path, since a unit id cannot be baked at router build). The trusted-proxy rule above applies to it unchanged. -
UPLOAD_BODY_LIMIT(default11534336, 11 MiB; the craig-web precedent) is the whole-body cap on the certificate upload route ONLY — the EFFECTIVE cap a caregiver meets, since placement’s per-file 50 MiB sits above it; the form’s helper text names 10 MB. An over-limit body surfaces as the portal’s "too big, or the upload stopped" flash (the limit is enforced lazily inside the multipart stream), never a BFF 413. Every other route keeps axum’s 2 MiB default. -
Every protected response — and the signed-in
/welcome(the connect page) — carriesCache-Control: no-store. -
Cookies are
portal_session/portal_pkce/portal_flash/portal_session-idt/portal_session-rt/portal_locale; any refresh failure ends the session (RefreshFailure::Drop). The session cookie’sMax-Age(SESSION_MAX_AGE_SECS, 1800 s) is the 30-minute idle limit; the realm SSO session outlives it (the committed realm: SSO idle 3600 s against thecraig-portal-uiclient’s 1800 s), so after 30 idle minutes the next request is routed through/loginand is USUALLY a silent SSO re-entry — the sign-in form appears only once the IdP session has lapsed too. A backend 403 (no current binding, or a revoked identity) does NOT end the session:/unitsrenders the not-connected state with the enrol form and every other page redirects there with a neutral flash (ADR-076 U10 note). -
The env source does NOT coerce digits-only values (a numeric-looking secret stays a string; craig-web’s loader has the same shape since #1868).
Object Store (CRAIG_STORE__)
Prefix: CRAIG_STORE__
Consumed by craig-cases, craig-exchange, craig-placement (home documents), craig-reporting (AFCARS/NCANDS exports), and craig-security — plus craig-rules when RETENTION_ARCHIVE__ENABLED=true, and the craig-manage archive-fetch tooling. The retention D10 boot probe refuses the local backend when archiving is enabled.
Values reach each field as strings: a digits-only BUCKET, S3_ACCESS_KEY or S3_SECRET_KEY is used byte for byte (#2267).
The integer knobs (MAX_UPLOAD_BYTES, REQUEST_TIMEOUT_SECS) parse their own string form, so a float or exponent form (5e7, 30.0) refuses boot instead of being rounded.
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
BACKEND |
enum |
|
No |
Backend type: |
BUCKET |
String |
— |
S3 |
S3 bucket name (enforced when the S3 client is built, not at config load) |
LOCAL_ROOT |
String |
|
No |
Root directory for local filesystem backend (created on startup) |
S3_ENDPOINT |
String |
— |
S3 |
S3 endpoint URL (e.g., |
S3_REGION |
String |
|
No |
S3 region |
S3_ACCESS_KEY |
String |
— |
S3 |
S3 access key (Debug-redacted) |
S3_SECRET_KEY |
String |
— |
S3 |
S3 secret key (Debug-redacted) |
MAX_UPLOAD_BYTES |
usize |
|
No |
Maximum upload file size. Boot-validated ≥ |
|
Path-style addressing and |
craig-seed (fixture generator, tooling)
The craig-seed generator (invoked by cargo xtask dev) is a pure SQL-file generator: no database
connection, no HTTP. It reads its variables via raw std::env::var, fail-closed on malformed values,
rather than through the config crate. Since C7 activation
(#987) the devstack mounts the shared
devstack/field-key.env into it and runs it required, so every devstack seed writes genuine
ciphertext (verified by cargo xtask verify-seed --expect keyed).
Where the key comes from differs by environment. Locally it is ADOPTED from the repo-committed
encrypted store (secrets/dev.yaml, ADR-064) when the developer’s age identity is a store recipient,
with a generate-once fallback for identity-less contributors. In CI,
cargo xtask secrets write-field-key materializes it by decrypting that same store with the
masked+protected CRAIG_CI_AGE_KEY CI/CD project variable inside the pinned devtools container
(ADR-048 §D5 as amended by ADR-064 U7,
#1385). An unset variable is a hard
error, and CRAIG_CI_AGE_KEY is a CI pipeline variable, never a service env var.
| Variable | Type | Default | Required | Description |
|---|---|---|---|---|
CRAIG_CONFIG_SOURCE |
String |
— |
Yes |
The configuration layers the seed takes its jurisdiction and rate schedule from (the jurisdiction layer’s |
CRAIG_SEED__ENCRYPTION_MODE |
String |
|
No |
Accepts only |
CRAIG_FIELD_ENCRYPTION_KEY |
String |
— |
In |
32-byte base64 field key, shared with craig-cases so seeded rows match service-written ones. Absent ⇒ plaintext seed (optional mode only); a malformed/wrong-length key is fatal in both modes (never silently seeds plaintext under a broken key). Writes envelope format v2 (#1007): every cell is bound to its |