forked from JSE-ORG/trust-link-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
138 lines (119 loc) · 6.36 KB
/
Copy path.env.example
File metadata and controls
138 lines (119 loc) · 6.36 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
# =============================================================================
# Trust-Link Backend – Environment Variable Reference
#
# Copy this file to .env and fill in the values for your environment.
# Never commit real secrets to version control.
# =============================================================================
# -----------------------------------------------------------------------------
# Database
# -----------------------------------------------------------------------------
# PostgreSQL connection string (required).
# Format: postgresql://<user>:<password>@<host>:<port>/<database>
# For Docker Compose local dev use: postgresql://postgres:postgres@localhost:5432/trustlink_db
DATABASE_URL="postgresql://username:password@localhost:5432/trustlink_db"
# Connection pool tuning (issue #105).
# DB_POOL_CONNECTION_LIMIT – maximum number of simultaneous database connections
# Prisma holds in its pool. Increase for high-throughput production workloads.
# Recommended: leave unset in development (Prisma default = 10).
# Production guideline: set to (num_cpu_cores * 2) + 1, e.g. 25 for 12 cores.
# Too high a value can exhaust PostgreSQL's max_connections limit.
# DB_POOL_TIMEOUT_MS – milliseconds a query waits for a free connection before
# Prisma throws a P2024 timeout error. Defaults to 10 000 ms (10 s).
# Reduce to fail fast under heavy load; increase for batch-heavy workloads.
DB_POOL_CONNECTION_LIMIT=10
DB_POOL_TIMEOUT_MS=10000
# -----------------------------------------------------------------------------
# Server
# -----------------------------------------------------------------------------
# Port the HTTP server listens on.
# Default: 3000
PORT=3000
# Runtime environment – controls CORS policy, logging verbosity defaults, etc.
# Valid values: development | production | test
# Default: development
NODE_ENV=development
AUTH_CHALLENGE_LIMIT=10
AUTH_CHALLENGE_WINDOW=60000
PUBLIC_LIMIT=60
PUBLIC_WINDOW=60000
REFRESH_TOKEN_TTL=604800
NONCE_TTL=900
# -----------------------------------------------------------------------------
# Authentication & Security
# -----------------------------------------------------------------------------
# Secret used to sign SEP-10 JWT tokens (required).
# Must be at least 32 characters. Use a cryptographically random string in production.
SEP10_JWT_SECRET="your-super-secure-jwt-secret-at-least-32-characters-long"
# Stellar public key of the platform admin account (required).
# Used to authorise admin-only endpoints (stats, dispute resolution).
# Format: G... (56-character Stellar public key)
ADMIN_ADDRESS="GXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# -----------------------------------------------------------------------------
# Stellar / Blockchain
# -----------------------------------------------------------------------------
# Which Stellar network to connect to.
# Valid values: TESTNET | MAINNET
# Default: TESTNET
STELLAR_NETWORK=TESTNET
# Frontend network indicator (Next.js client-side env var).
# Exposed to the browser bundle via the NEXT_PUBLIC_ prefix convention.
# Controls the header status dot (green = Mainnet, yellow = Testnet) and
# the Testnet warning banner: "You are on Testnet — funds have no real value".
# Valid values: TESTNET | MAINNET
# Default: TESTNET (fail-safe — unrecognised values fall back to TESTNET)
NEXT_PUBLIC_STELLAR_NETWORK=TESTNET
# Stellar Horizon base URL.
# Default for TESTNET: https://horizon-testnet.stellar.org
# Default for MAINNET: https://horizon.stellar.org
STELLAR_HORIZON_URL="https://horizon-testnet.stellar.org"
# HMAC-SHA256 secret for verifying Stellar Horizon webhook payloads (issue #76).
# Must match the secret configured in your Horizon callback settings.
# If unset, signature verification is skipped – safe for local dev only.
STELLAR_WEBHOOK_SECRET="your-stellar-webhook-hmac-secret"
# -----------------------------------------------------------------------------
# Redis (optional)
# -----------------------------------------------------------------------------
# Redis connection URL used for response caching (issue #103).
# When omitted, caching is disabled and all reads hit PostgreSQL directly.
# Format: redis://[:<password>@]<host>:<port>[/<db>]
# Example: redis://localhost:6379
REDIS_URL="redis://localhost:6379"
# -----------------------------------------------------------------------------
# CORS
# -----------------------------------------------------------------------------
# Comma-separated list of allowed frontend origins (issue #85).
# Requests from any origin not in this list are rejected with 403.
# Leave empty to allow all origins in development, block all in production.
# Example: ALLOWED_ORIGINS="https://app.trust-link.io,https://staging.trust-link.io"
ALLOWED_ORIGINS="http://localhost:3000,http://localhost:3001"
# -----------------------------------------------------------------------------
# Notifications (optional)
# -----------------------------------------------------------------------------
# SendGrid API key for sending transactional emails.
# Omit or leave blank to disable email notifications.
SENDGRID_API_KEY="your-sendgrid-api-key"
# Twilio credentials for sending SMS notifications.
# Both SID and token must be set to enable SMS; either can be omitted to disable.
TWILIO_ACCOUNT_SID="your-twilio-account-sid"
TWILIO_AUTH_TOKEN="your-twilio-auth-token"
# -----------------------------------------------------------------------------
# Logging
# -----------------------------------------------------------------------------
# Minimum log level emitted by the structured JSON logger (issue #81).
# Valid values: trace | debug | info | warn | error | fatal
# Default: info
LOG_LEVEL=info
# -----------------------------------------------------------------------------
# Distributed Tracing (issue #79)
# -----------------------------------------------------------------------------
# Enable OpenTelemetry tracing. Set to false to disable entirely.
# Default: true (disabled automatically when NODE_ENV=test)
OTEL_ENABLED=true
# Service name and version reported to the trace collector.
OTEL_SERVICE_NAME=trustlink-backend
OTEL_SERVICE_VERSION=1.0.0
# OTLP HTTP endpoint for trace export (Jaeger, Grafana Tempo, Datadog Agent, etc.).
# Local Docker Compose: http://localhost:4318
# Omit to run with auto-instrumentation only (spans not exported).
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
CONTACT_ENCRYPTION_KEY="<64-hex-char-random-string>"