-
Notifications
You must be signed in to change notification settings - Fork 130
Expand file tree
/
Copy pathenv.example
More file actions
231 lines (185 loc) Β· 8.55 KB
/
Copy pathenv.example
File metadata and controls
231 lines (185 loc) Β· 8.55 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
# ============================================================
# StellarKraal β Environment Variables
# ============================================================
# Copy this file to .env and fill in values for local dev:
# cp .env.example .env
#
# Variables marked [Required] must be set before the service
# will start. Variables marked [Optional] have safe defaults.
#
# Variables marked [GitHub Secret: NAME] must also be stored
# as GitHub Actions repository secrets (Settings β Secrets
# and variables β Actions) so CI/CD workflows can inject them.
# Never commit real secrets to version control.
# ============================================================
# ------------------------------------------------------------
# SHARED β used by both frontend and backend
# ------------------------------------------------------------
# Stellar network to connect to.
# Format : "testnet" | "mainnet"
# Required. [GitHub Secret: NEXT_PUBLIC_NETWORK]
NEXT_PUBLIC_NETWORK=testnet
# Soroban JSON-RPC endpoint for the chosen network.
# Format : HTTPS URL
# Required. [GitHub Secret: RPC_URL]
RPC_URL=https://soroban-testnet.stellar.org
# Stellar Horizon API endpoint for the chosen network (fallback for account reads).
# Used as transparent fallback when Soroban RPC is unavailable for account balance queries.
# Format : HTTPS URL
# Optional. [GitHub Secret: HORIZON_URL]
# HORIZON_URL=https://horizon-testnet.stellar.org
# Deployed Soroban contract address (C... or G... format).
# Obtain this after running `stellar contract deploy`.
# Format : 56-character Stellar contract/account ID
# Required. [GitHub Secret: CONTRACT_ID]
CONTRACT_ID=CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM
# ------------------------------------------------------------
# FRONTEND β Next.js (NEXT_PUBLIC_* vars are bundled at build)
# ------------------------------------------------------------
# Base URL of the backend API, used by the Next.js frontend.
# Must be reachable from the browser in production.
# Format : HTTP(S) URL, no trailing slash
# Required. [GitHub Secret: NEXT_PUBLIC_API_URL]
NEXT_PUBLIC_API_URL=http://localhost:3001
# Public Soroban RPC URL exposed to browser-side SDK calls.
# Usually the same value as RPC_URL.
# Format : HTTPS URL
# Required. [GitHub Secret: NEXT_PUBLIC_RPC_URL]
NEXT_PUBLIC_RPC_URL=https://soroban-testnet.stellar.org
# ------------------------------------------------------------
# BACKEND β Node.js / Express API
# ------------------------------------------------------------
# TCP port the Express server listens on.
# Format : integer 1β65535
# Optional. Default: 3001
PORT=3001
# Node.js runtime environment. Controls logging verbosity,
# error detail, and certain security defaults.
# Format : "development" | "production" | "test"
# Optional. Default: development
NODE_ENV=development
# Application log level. Controls verbosity of application logs.
# Format : "debug" | "info" | "warn" | "error"
# Optional. Default: info
# LOG_LEVEL=info
# Log file rotation: maximum size per log file before creating a new one.
# Only applies in production. Examples: 10m, 100m, 1g
# Format : string with unit (b, kb, mb, gb)
# Optional. Default: 10m
# LOG_MAX_SIZE=10m
# Log file retention: number of log files to keep before automatic deletion.
# Only applies in production. Set to 7 for daily rotation = 7 days retention.
# Format : positive integer
# Optional. Default: 7
# LOG_MAX_FILES=7
# Allowed origin for CORS. Set to the frontend URL in
# production to prevent cross-origin requests from other hosts.
# Format : HTTP(S) URL, no trailing slash
# Optional (required in production). [GitHub Secret: FRONTEND_URL]
FRONTEND_URL=http://localhost:3000
# Comma-separated list of allowed CORS origins.
# Takes precedence over FRONTEND_URL when set.
# Wildcard "*" is only permitted in non-production environments.
# Format : comma-separated HTTP(S) URLs, e.g. https://app.example.com,https://staging.example.com
# Optional. [GitHub Secret: ALLOWED_ORIGINS]
# ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001
# JWT secret used to sign and verify access tokens.
# Must be at least 32 characters in production.
# Generate with: openssl rand -hex 32
# Format : arbitrary string, min 32 chars recommended
# Required in production. [GitHub Secret: JWT_SECRET]
JWT_SECRET=change-me-to-a-strong-jwt-secret-min-32-chars
# Access token TTL in milliseconds (default 15 minutes).
# Format : positive integer (milliseconds)
# Optional. Default: 900000
# ACCESS_TTL_MS=900000
# Refresh token TTL in milliseconds (default 7 days).
# Format : positive integer (milliseconds)
# Optional. Default: 604800000
# REFRESH_TTL_MS=604800000
# HMAC secret for verifying incoming webhook payloads.
# Must be at least 16 random bytes (32+ recommended).
# Generate with: openssl rand -hex 32
# Format : hex or arbitrary string, min 16 chars
# Optional (webhooks disabled if unset). [GitHub Secret: WEBHOOK_SECRET]
# WEBHOOK_SECRET=
# API key that grants access to /api/admin/* endpoints.
# Keep this secret; rotate immediately if compromised.
# Generate with: openssl rand -hex 16
# Format : arbitrary string, min 8 chars
# Optional (admin routes disabled if unset). [GitHub Secret: ADMIN_API_KEY]
# ADMIN_API_KEY=
# --- Rate limiting (requests per minute per IP) ---
# Global rate limit applied to every route.
# Format : positive integer
# Optional. Default: 60
RATE_LIMIT_GLOBAL=60
# Rate limit for authentication routes (/auth/*).
# Lower than global to slow brute-force attempts.
# Format : positive integer
# Optional. Default: 10
RATE_LIMIT_AUTH=10
# Rate limit for read-only routes (GET requests).
# Format : positive integer
# Optional. Default: 100
RATE_LIMIT_READ=100
# Rate limit for state-changing routes (POST/PUT/DELETE).
# Format : positive integer
# Optional. Default: 10
RATE_LIMIT_WRITE=10
# --- Request timeouts ---
# Maximum time in milliseconds for any request before the
# server responds with 408 Request Timeout.
# Format : positive integer (milliseconds)
# Optional. Default: 30000
TIMEOUT_GLOBAL_MS=30000
# Maximum time in milliseconds for write operations
# (loan origination, collateral updates, etc.).
# Format : positive integer (milliseconds)
# Optional. Default: 15000
TIMEOUT_WRITE_MS=15000
# --- RPC connection pool ---
# Minimum number of persistent RPC connections to maintain.
# Format : positive integer, must be β€ POOL_MAX
# Optional. Default: 2
POOL_MIN=2
# Maximum number of concurrent RPC connections allowed.
# Format : positive integer, must be β₯ POOL_MIN
# Optional. Default: 10
POOL_MAX=10
# --- Caching ---
# Time-to-live for cached collateral appraisal results.
# Increase to reduce RPC calls; decrease for fresher prices.
# Format : positive integer (milliseconds)
# Optional. Default: 300000 (5 minutes)
APPRAISAL_CACHE_TTL_MS=300000
# ------------------------------------------------------------
# ALERTING β Slack & PagerDuty (backend alert dispatcher)
# ------------------------------------------------------------
# Slack incoming webhook URL for deployment and alert messages.
# Create one at https://api.slack.com/messaging/webhooks
# Format : https://hooks.slack.com/services/T.../B.../...
# Optional (Slack alerts disabled if unset). [GitHub Secret: SLACK_WEBHOOK_URL]
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK
# PagerDuty Events API v2 routing key for critical-severity alerts.
# Find this in PagerDuty under Services β Integrations.
# Format : 32-character alphanumeric string
# Optional (PagerDuty alerts disabled if unset). [GitHub Secret: PAGERDUTY_ROUTING_KEY]
PAGERDUTY_ROUTING_KEY=your-pagerduty-routing-key
# Base URL prepended to runbook paths in alert messages.
# Format : HTTPS URL, no trailing slash
# Optional. Default shown below.
RUNBOOK_BASE_URL=https://github.com/teslims2/StellarKraal-/blob/main/docs/runbooks
# Database URL β omit for SQLite (dev), set to postgres:// for PostgreSQL (staging/prod)
# DATABASE_URL=postgresql://user:password@localhost:5432/stellarkraal
# ββ Health Factor Alert Thresholds ββββββββββββββββββββββββββββββββββββββββββββββ
# Warning threshold for health factor job (scaled by 10_000; default 1.3 β 13000).
# Fires a warning alert when a loan's health factor drops below this value.
# Format : positive integer (Γ10_000)
# Optional. Default: 13000
# HEALTH_FACTOR_WARN=13000
# Critical threshold for health factor job (scaled by 10_000; default 1.0 β 10000).
# Fires a critical alert when a loan's health factor drops below this value.
# Format : positive integer (Γ10_000)
# Optional. Default: 10000
# HEALTH_FACTOR_CRIT=10000