Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
282 lines (245 loc) · 13.3 KB
/
Copy path.env.example
File metadata and controls
282 lines (245 loc) · 13.3 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# ==============================================================================
# ENVIRONMENT TEMPLATE - Copy to .env and fill in your values
# ==============================================================================
# IMPORTANT: Never commit .env to git. It is already in .gitignore.
# This file contains PLACEHOLDER VALUES ONLY for local development.
# For production, use your cloud provider's secrets manager (AWS Secrets Manager, etc).
# See ENV_VARS.md for detailed documentation and security guidelines.
# ==============================================================================
# -- Docker Compose service credentials (AX-017) ------------------------------
# docker-compose.yml no longer ships default passwords. The stack fails fast
# if these are unset, so you MUST provide explicit values in .env before
# running `docker compose up`. Use strong, unique values - never reuse the
# placeholders below in any shared or production environment.
POSTGRES_USER=acbu_user
POSTGRES_PASSWORD=change-me-postgres-password
POSTGRES_DB=acbu_db
MONGO_INITDB_ROOT_USERNAME=acbu
MONGO_INITDB_ROOT_PASSWORD=change-me-mongo-password
RABBITMQ_DEFAULT_USER=acbu
RABBITMQ_DEFAULT_PASS=change-me-rabbitmq-password
NODE_ENV="development"
# -- Frontend (frontend/) ----------------------------------------------------
# Keep these values beside the backend settings so local setup has one source
# of truth. Frontend-only secrets must remain unprefixed and stay out of git.
NEXT_PUBLIC_API_BASE_URL="http://localhost:5000/api/v1"
# Legacy alias supported by the frontend when NEXT_PUBLIC_API_BASE_URL is unset.
# NEXT_PUBLIC_API_URL="http://localhost:5000/api/v1"
NEXT_PUBLIC_API_TIMEOUT=30000
NEXT_PUBLIC_BILLS_ENABLED=false
NEXT_PUBLIC_STELLAR_NETWORK=TESTNET
NEXT_PUBLIC_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
# NEXT_PUBLIC_SOROBAN_RPC_URL=
# NEXT_PUBLIC_SUPPORT_INTAKE_URL=
# NEXT_PUBLIC_ACBU_ASSET_CODE=ACBU
# NEXT_PUBLIC_ACBU_ASSET_ISSUER=
# SUPPORT_INTAKE_URL=
# -- Smart-contract deployment ------------------------------------------------
# Set these only when deploying or integrating contracts; never commit secrets.
# CONTRACT_ORACLE=
# CONTRACT_RESERVE_TRACKER=
# CONTRACT_MINTING=
# CONTRACT_BURNING=
# CONTRACT_SAVINGS_VAULT=
# CONTRACT_LENDING_POOL=
# CONTRACT_ESCROW=
PORT=5000
API_VERSION="v1"
# ── Docker Compose — local service credentials (required) ────────────────────
# docker-compose.yml has no default passwords. You MUST set these before
# running `docker compose up`. Generate strong random values, e.g.:
# node -e "console.log(require('crypto').randomBytes(16).toString('hex'))"
POSTGRES_PASSWORD=change-me
MONGO_PASSWORD=change-me
RABBITMQ_PASSWORD=change-me
DATABASE_URL="postgresql://acbu_user:acbu_pass@localhost:5432/acbu_db"
# Shadow database used by Prisma Migrate for schema drift detection and shadow-DB verification
SHADOW_DATABASE_URL="postgresql://acbu_user:acbu_pass@localhost:5432/acbu_shadow?schema=public"
# Optional: Read-replica for database operations
# DATABASE_URL_REPLICA="postgresql://acbu_user:acbu_pass@localhost:5433/acbu_db"
# Optional: Prisma Accelerate URL for runtime connection pooling (prisma:// protocol).
# Leave unset for local dev. Never use this for prisma migrate - it requires DATABASE_URL above.
# PRISMA_ACCELERATE_URL="prisma://accelerate.prisma-data.net/?api_key=..."
MONGODB_URI="mongodb://localhost:27017/acbu_db"
RABBITMQ_URL="amqp://guest:guest@localhost:5672"
JWT_SECRET="dev-jwt-secret-change-me-min-32-characters-long"
# Required explicitly in production - do not let this fall back to JWT_SECRET,
# they must be distinct trust boundaries. Generate a separate random value.
# CHALLENGE_TOKEN_SECRET=dev-challenge-token-secret-change-me-32chars
JWT_EXPIRES_IN="7d"
JWT_CLOCK_TOLERANCE_SECONDS=30
API_KEY_SALT=""
# ADMIN_API_KEY="secret-admin-key"
# ADMIN_API_KEYS="admin1:key1,admin2:key2"
# BE-001: HMAC secret for the /v1/webhooks/bills/:provider endpoint. Required
# in production once a real bills provider (not simulatedBillsPartner) is wired in.
# BILLS_WEBHOOK_SECRET=change-me-in-production
# CORS - comma-separated exact origins (no *; required in production).
# Unset in development defaults to http://localhost:3000
CORS_ORIGIN="http://localhost:3000"
# CDN_URL="https://cdn.example.com"
# B-058 / AB-024: PII field-level encryption key (AES-256-GCM).
# REQUIRED in production — the server will refuse to start without it.
# Must be a 64-character hex string (32 bytes / 256 bits).
# Generate: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
PII_ENCRYPTION_KEY=
# B-063: OpenAI integration (used for KYC document analysis)
# OPENAI_API_KEY=sk-...
# OPENAI_ORG_MONTHLY_BUDGET_USD=50
# OPENAI_MAX_TOKENS_PER_REQUEST=2000
# OpenAI Fail-Open Controls (AB-025: defaults to false — fail closed for security/KYC compliance)
# OPENAI_FAIL_OPEN_ENABLED=false
# OPENAI_FAIL_OPEN_TIMEOUT_MS=2000
# OPENAI_FAIL_OPEN_MAX_RETRIES=2
# OPENAI_FAIL_OPEN_RETRY_BASE_MS=500
LOG_LEVEL="info"
# LOG_LEVEL_CONSOLE="info"
# LOG_LEVEL_FILE="info"
# -- Memory / heap (#436) -----------------------------------------------------
# Cap the V8 heap so OOM kills happen predictably rather than at OS limit.
# Set to ~75% of the container/instance memory. Omit to rely on V8 default (~1.4 GB).
# NODE_OPTIONS=--max-old-space-size=512
# Heap usage percentage (of heap_size_limit) at which a WARNING is logged (default 85).
# MEMORY_LEAK_THRESHOLD_PCT=85
# How often the memory monitor samples heap usage, in milliseconds (default 30000).
# MEMORY_CHECK_INTERVAL_MS=30000
# Directory where .heapsnapshot files are written when heap pressure turns CRITICAL (default ./heapdumps).
# Ensure this path is writable and excluded from your Docker image or .gitignore.
# HEAP_DUMP_DIR=./heapdumps
# Rate Limiting
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX_REQUESTS=100
AUTH_RATE_LIMIT_WINDOW_MS=900000
AUTH_RATE_LIMIT_MAX_REQUESTS=10
ADMIN_RATE_LIMIT_WINDOW_MS=60000
ADMIN_RATE_LIMIT_MAX_REQUESTS=30
# Rate Limiting Fallback (during cache/MongoDB outages)
# Stricter limits applied when cache is unavailable (fail-safe, not fail-open)
RATE_LIMIT_FALLBACK_MAX_REQUESTS=20
RATE_LIMIT_CIRCUIT_BREAKER_THRESHOLD=5
RATE_LIMIT_CIRCUIT_BREAKER_COOLDOWN_MS=60000
MAX_SIGNIN_ATTEMPTS=5
SIGNIN_LOCKOUT_DURATION_MS=900000
# Business calendar timezone for salary schedules and withdrawal windows (#408)
# BUSINESS_TIMEZONE=Africa/Lagos
# -- Redis cache (not currently used - reserved for future use) ----------------
# NOTE: Redis is NOT included in docker-compose.yml and is not used by the
# active cache layer (src/utils/cache.ts uses MongoDB). These variables are
# reserved for a future Redis-backed cache. Do NOT add a Redis service to
# docker-compose unless the codebase is migrated to use it.
# REDIS_URL=redis://localhost:6379
# REDIS_SENTINELS=127.0.0.1:26379,127.0.0.1:26380
# REDIS_SENTINEL_NAME=mymaster
# REDIS_PASSWORD=
# REDIS_MAX_RETRIES_PER_REQUEST=3
# REDIS_READONLY_RETRY_ATTEMPTS=3
# REDIS_READONLY_RETRY_DELAY_MS=100
# Stellar / USDC swap
STELLAR_NETWORK=testnet
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
# Optional; defaults to https://soroban-testnet.stellar.org (or mainnet). Set if DNS to default RPC fails.
# STELLAR_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
# Local/testnet development only: NEVER place mainnet or production issuer, distribution, or
# treasury secret seeds (S...) in developer .env files. Production signing must use an HSM or
# multi-sig custodial service (see docs/security/STELLAR_KEY_ROTATION_RUNBOOK.md).
STELLAR_SECRET_KEY=your-stellar-secret-key-here
# Five distinct public validator accounts used when initializing the oracle.
# The updater signs only as the validator matching STELLAR_SECRET_KEY; other
# validator keys must remain with independent signers.
# ORACLE_VALIDATOR_ADDRESSES=G...1,G...2,G...3,G...4,G...5
# Classic payment fee handling (AB-052)
# STELLAR_BASE_FEE_STROOPS=100
# STELLAR_USE_DYNAMIC_FEES=true # read the live base fee from Horizon per payment
# STELLAR_FEE_SURGE_BUFFER_BPS=2000 # +20% on the live base fee (0-10000 bps)
# STELLAR_MAX_PAYMENT_FEE_STROOPS=1000000 # fail with STELLAR_FEE_SURGE above this
# STELLAR_SOROBAN_MIN_FEE_STROOPS=5000
# STELLAR_SOROBAN_MAX_FEE_STROOPS=10000000
# Circle USDC issuer - defaults are the well-known Circle addresses; override for a custom testnet asset (e.g. DemoUSDC)
USDC_ISSUER_TESTNET=GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5
USDC_ISSUER_MAINNET=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN
# Stellar asset code for the swap asset (default USDC). For testnet DemoUSDC: set issuer above and e.g. USDC_ASSET_CODE_TESTNET=DemoUSDC
# USDC_ASSET_CODE_TESTNET=DemoUSDC
# USDC_ASSET_CODE_MAINNET=USDC
# Slippage tolerance for USDC->XLM DEX swap (basis points; 50 = 0.5%)
USDC_XLM_SLIPPAGE_BPS=50
# Bulk transfer CSV chunk size (rows per transaction chunk; default 100)
# BULK_TRANSFER_CHUNK_SIZE=100
# Bulk transfer upload limit in bytes (default 10485760 = 10 MiB)
# BULK_TRANSFER_MAX_FILE_SIZE_BYTES=10485760
# Bulk transfer maximum data rows per CSV (default 5000); larger files are rejected before a job is created
# BULK_TRANSFER_MAX_ROWS=5000
# -- S3 / KYC document storage (B-062, W11-AUD-014) ---------------------------
# S3 bucket for KYC document uploads (must be private - no public access)
# S3_BUCKET=acbu-kyc-documents
# AWS region for S3 (defaults to AWS_REGION if set)
# AWS_REGION=us-east-1
# S3_REGION=us-east-1
# Explicit credentials - omit to use IAM role / instance profile in production
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
# Optional: S3-compatible endpoint for local dev (e.g. MinIO)
# S3_ENDPOINT=http://localhost:9000
# Presigned URL TTLs (seconds). Defaults: 900 upload, 300 download
# S3_UPLOAD_URL_TTL_SECONDS=900
# S3_DOWNLOAD_URL_TTL_SECONDS=300
# W11-AUD-014: KMS key ARN for server-side encryption of KYC documents.
# REQUIRED in production — set to your AWS KMS CMK ARN to enforce aws:kms
# encryption on every PutObject. Omit only for local/MinIO environments
# where KMS is unavailable (AES256 fallback applies automatically).
# Generate: create a CMK in AWS KMS → copy the key ARN here.
# S3_KMS_KEY_ID=arn:aws:kms:us-east-1:123456789012:key/your-cmk-id
# HMAC-SHA256 secret for virus-scan webhook authentication (required in production)
S3_SCAN_WEBHOOK_SECRET=change-me-in-production
# #381: WAL / continuous backup guard.
# Set to "true" once WAL archiving is enabled on the database host
# (e.g. pgBackRest, Barman, AWS RDS automated backups, Supabase PITR).
# The app refuses to start in production until this is explicitly set to true.
# PG_WAL_BACKUP_CONFIGURED=true
# PG_WAL_BACKUP_PROVIDER=pgbackrest
# #383: Prisma migration history replicated guard.
# PRISMA_MIGRATION_HISTORY_REPLICATED=false
# #402: DB Connect Retry
# DB_CONNECT_MAX_RETRIES=8
# DB_CONNECT_BASE_BACKOFF_MS=250
# DB_CONNECT_MAX_BACKOFF_MS=10000
# -- Reserve rebalancing (#627) -----------------------------------------------
# Percentage drift threshold above which a currency is considered over/underweight
# and rebalancing instructions are generated. Default: 1 (meaning 1%).
# Raise to reduce rebalancing frequency; lower for tighter peg tracking.
# RESERVE_DRIFT_THRESHOLD_PCT=1
# -- Travel Rule / AML Compliance (#1142) --------------------------------------
# Amount threshold in ACBU above which Travel Rule compliance is required. Default: 1000.
# Adjust based on regulatory requirements for your jurisdiction.
# TRAVEL_RULE_THRESHOLD_ACBU=1000
# When true, enforces Travel Rule compliance for P2P transfers above threshold.
# When false (default), logs warnings only for monitoring purposes.
# TRAVEL_RULE_ENFORCE=false
# Compliance mode: "strict" (reject non-compliant) or "allowlist" (only allow VASP/allowlisted recipients).
# TRAVEL_RULE_MODE=strict
# -- Jurisdiction Licensing (#1143) ---------------------------------------------
# Comma-separated list of ISO 3166-1 alpha-3 country codes where ACBU holds KYC/AML licensing.
# Default: RWA (Rwanda). Add more codes as licenses are obtained (e.g., "RWA,NGA,KEN").
# LICENSED_JURISDICTIONS=RWA
# When true, enforces jurisdiction licensing checks for KYC operations.
# When false (default), logs warnings only for monitoring purposes.
# JURISDICTION_ENFORCE=false
# Operating model: "direct" (ACBU operates KYC directly) or "partner" (KYC handled by licensed partners).
# Use "partner" if KYC is performed by licensed third-party providers in each jurisdiction.
# KYC_OPERATING_MODEL=direct
# -- Notifications (email / SMS) -----------------------------------------------
# NOTIFICATION_EMAIL_PROVIDER=log # log | smtp | sendgrid | ses
# NOTIFICATION_FROM_EMAIL=noreply@acbu.io
# NOTIFICATION_SMS_PROVIDER=log # log | twilio | africas_talking
# NOTIFICATION_ALERT_EMAIL=ops@example.com
# Twilio (SMS)
# TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# TWILIO_AUTH_TOKEN=your-twilio-auth-token
# TWILIO_FROM_NUMBER=+15551234567
# AfricasTalking (SMS)
# To enable: set NOTIFICATION_SMS_PROVIDER=africas_talking and supply both of:
# AFRICAS_TALKING_USERNAME=sandbox # use "sandbox" for the AT sandbox; your registered username in production
# AFRICAS_TALKING_API_KEY=your-api-key # from https://account.africastalking.com → Settings → API Key
# CAPTCHA (Cloudflare Turnstile)
CAPTCHA_SECRET=
# off | optional | strict (default: optional)
CAPTCHA_ENFORCEMENT=optional