# Copy to .env at the repo root, then fill in JWT_SECRET. # cp .env.example .env # node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))" NODE_ENV=development # ── Backend ─────────────────────────────────────────────────────────── PORT=4000 DATABASE_URL=postgresql://prism_user:prism_password@localhost:5432/prism_db REDIS_URL=redis://localhost:6379 # ── WebAuthn ────────────────────────────────────────────────────────── # RP ID is bound to a hostname. Changing it invalidates every registered # passkey, so settle it before anyone registers one. WEBAUTHN_RP_ID=localhost WEBAUTHN_RP_NAME=PRISM Secure Payments # Comma-separated list is accepted — add a LAN/HTTPS origin (see # docs/LAN_DEMO_SETUP.md) alongside localhost for the 3-laptop demo mode: # WEBAUTHN_EXPECTED_ORIGIN=http://localhost:5173,https://prism.local:5173 WEBAUTHN_EXPECTED_ORIGIN=http://localhost:5173 # Optional: serve the backend over HTTPS using an mkcert-issued cert (needed # for real WebAuthn on a LAN — see docs/LAN_DEMO_SETUP.md). Leave both empty # for ordinary plain-HTTP local dev. TLS_CERT_PATH= TLS_KEY_PATH= # ── Keys (read ONLY by modules/keys/keyManager.ts) ──────────────────── # Session cookie signing secret. Required. JWT_SECRET= # Ed25519 private key (PKCS#8 PEM) for signing dynamic QR tokens. # Leave empty in development: an ephemeral keypair is generated at boot and # the key id is logged. Production would use an HSM — see README limitations. QR_SIGNING_KEY= # ── Demo only ───────────────────────────────────────────────────────── # Switch controls off to show the "before" half of attack-then-defend. # Ignored entirely when NODE_ENV=production. # PRISM_DISABLE=intentLock,replayGuard,expiryGuard,qrSignature,riskEngine PRISM_DISABLE= # ── Attack Simulation Dashboard ────────────────────────────────────── # Shared operator token required as the X-Attack-Token header on every # /api/v1/attacks/* route. The dashboard has no admin/cross-user session # system, so this is what gates it. Unset = the attack routes refuse all # requests with 503. ATTACK_ADMIN_TOKEN= # Demo-only: lets a signed-in device reveal its OWN session cookie so an # operator can paste it into the Attack Lab (a real stolen-cookie # demonstration against a real live transaction). Requires BOTH this AND # NODE_ENV != production — hard-disabled otherwise, off by default. ATTACK_LAB_DEMO_ENABLED= # ── Frontend ────────────────────────────────────────────────────────── VITE_API_URL=http://localhost:4000 # Shown to the operator once so they don't have to remember it; NOT sent # anywhere except as the X-Attack-Token header to the backend above. VITE_ATTACK_ADMIN_TOKEN= # Root secret for the authorization-chain MAC keys and the Ed25519 receipt key # (all HKDF-derived from it). Optional: falls back to JWT_SECRET, which is sound # but ties the two lifetimes together. Generate: node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))" PRISM_ATTESTATION_ROOT=