-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy path.env.example
More file actions
108 lines (77 loc) · 4.92 KB
/
Copy path.env.example
File metadata and controls
108 lines (77 loc) · 4.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# ──────────────────────────────────────────────────────────────────────────────
# predictify-backend — environment variables
#
# Copy this file to .env and fill in every "required" value before starting.
# Keys marked "(required)" have no default and MUST be set.
# Keys with a default shown are optional — the value here is what you get.
#
# Every key here mirrors the zod schema in src/config/env-schema.ts exactly.
# Run `npm run check-env` at any time to validate your .env without starting
# the server.
# ──────────────────────────────────────────────────────────────────────────────
# ── Application ──────────────────────────────────────────────────────────────
# Runtime mode: development | test | production (default: development)
NODE_ENV=development
# Port the HTTP server binds to (default: 3001)
PORT=3001
# Pino log level: fatal | error | warn | info | debug | trace (default: info)
LOG_LEVEL=info
# ── Database ─────────────────────────────────────────────────────────────────
# PostgreSQL connection string (required)
DATABASE_URL=postgres://postgres:postgres@localhost:5432/predictify
PG_POOL_MAX=10
PG_STATEMENT_TIMEOUT_MS=5000
# ── JWT ──────────────────────────────────────────────────────────────────────
# Random secret ≥ 32 characters (required)
# Generate one with: openssl rand -hex 32
JWT_SECRET=replace-with-at-least-32-character-random-secret-here
# Token issuer claim (iss) (default: predictify)
JWT_ISSUER=predictify
# Token audience claim (aud) (default: predictify-app)
JWT_AUDIENCE=predictify-app
# Token lifetime in seconds (default: 3600 = 1 hour)
JWT_TTL_SECONDS=3600
# Minimum internal interval between worker heartbeats; JWT_TTL_SECONDS must be >= this * 2
WORKER_HEARTBEAT_SECONDS=30
# Additional signing/verification keys for rotation (optional).
# Comma-separated "kid:secret" pairs; each secret >= 32 chars. JWT_SECRET
# above is always loaded too, under the reserved kid "default".
# See docs/jwt-rotation.md and the rotation script: npm run jwt:rotate
# JWT_KEYS=2026-07-01:7f3c9c2c4f0c4d5a8e9b1a2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6
# kid used to sign *new* tokens (default: "default", i.e. JWT_SECRET)
# JWT_ACTIVE_KID=2026-07-01
# Webhooks
WEBHOOK_SIGNING_SECRET=replace-with-16+byte-random-string
# ── Stellar / Soroban ────────────────────────────────────────────────────────
# Network to connect to: testnet | mainnet (default: testnet)
STELLAR_NETWORK=testnet
# Observability
METRICS_AUTH_TOKEN=
# Shared secret for internal job-trigger endpoints under /api/internal/jobs
# (e.g. POST /api/internal/jobs/cleanup-idempotency-keys). Leave unset to
# disable those endpoints entirely (they return 404).
INTERNAL_JOB_TOKEN=
# Indexer
INDEXER_POLL_INTERVAL_MS=5000
# Ledger sequence number to start indexing from (default: 0 = latest tip)
INDEXER_START_LEDGER=0
# Lag alert threshold in ledgers; probe warns when (chain tip − cursor) exceeds this (default: 200)
INDEXER_LAG_ALERT_THRESHOLD=200
# Admin Allowlist (comma separated stellar addresses)
ADMIN_ALLOWLIST=
# ── Anonymous rate limiting ──────────────────────────────────────────────────
# Sliding window for anonymous /api/markets and /api/leaderboard traffic (ms)
ANON_RATE_LIMIT_WINDOW_MS=60000
# Max anonymous requests per IP per window
ANON_RATE_LIMIT_MAX=60
# Set true when running behind a trusted reverse proxy (honours X-Forwarded-For)
TRUST_PROXY=false
# ── Backup verification (src/workers/backupVerifier.ts) ─────────────────────
# Absolute path to the pg_dump file to restore (required by backupVerifier)
# BACKUP_DUMP_PATH=/backups/predictify_latest.dump
# Connection string for the throwaway ephemeral database (required by backupVerifier)
# BACKUP_EPHEMERAL_DB_URL=postgres://postgres:postgres@localhost:5433/predictify_verify
# Slack Incoming Webhook URL for backup-verification notifications (optional)
# BACKUP_SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T000/B000/XXXX
# Smoke-test query timeout in milliseconds (default: 15000)
# BACKUP_SMOKE_TIMEOUT_MS=15000