-
Notifications
You must be signed in to change notification settings - Fork 88
Expand file tree
/
Copy path.env.example
More file actions
136 lines (112 loc) · 8.09 KB
/
Copy path.env.example
File metadata and controls
136 lines (112 loc) · 8.09 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
# ─── Database ─────────────────────────────────────────────────────────────────
# PostgreSQL connection URL (used by Prisma) — REQUIRED
DATABASE_URL="postgresql://parashield:secret@localhost:5432/parashield_db?schema=public"
# Read replica URL (#439) — optional. When set, all read-only queries are
# routed to this instance via PrismaService.reader; writes and transactions
# always go to the primary DATABASE_URL. Use the same format as DATABASE_URL.
# DATABASE_REPLICA_URL="postgresql://parashield:secret@replica-host:5432/parashield_db?schema=public"
# Prisma connection pool tuning (#381) — optional.
# The backend applies these automatically to the datasource URL at runtime;
# values already present as DATABASE_URL query params (e.g. ?connection_limit=10)
# always take precedence. Defaults: connection_limit=10, pool_timeout=10, connect_timeout=5.
# DATABASE_CONNECTION_LIMIT=10 # max pool connections (seconds for the two below)
# DATABASE_POOL_TIMEOUT=10 # how long a query waits for a free connection before erroring
# DATABASE_CONNECT_TIMEOUT=5 # how long establishing a new connection may take
# Overrides for docker-compose.yml (defaults: parashield / parashield / parashield)
# POSTGRES_USER=parashield
# POSTGRES_PASSWORD=parashield
# POSTGRES_DB=parashield
# Redis password used by docker-compose.yml (default: redispass)
# REDIS_PASSWORD=redispass
# ─── Authentication ────────────────────────────────────────────────────────────
# Secret used to sign JWT tokens — REQUIRED. In production, this MUST be a cryptographically secure random string of at least 32 bytes (256 bits).
JWT_SECRET=
# Operator key for admin-only oracle fetch endpoints — REQUIRED.
# Send as x-api-key header when calling POST /api/v1/oracle/fetch/*.
# Use a cryptographically random string of at least 32 bytes.
ORACLE_OPERATOR_API_KEY=
# Admin API key — REQUIRED.
# Alternative to ORACLE_OPERATOR_API_KEY. If ORACLE_OPERATOR_API_KEY is not set,
# this key will be used. Send as x-admin-api-key or x-api-key header.
# Use a cryptographically random string of at least 32 bytes.
ADMIN_API_KEY=
# ─── API key rotation (#379) ──────────────────────────────────────────────────
# Optional zero-downtime rotation: move the outgoing key here and set the new
# key on ORACLE_OPERATOR_API_KEY / ADMIN_API_KEY, then restart. Both keys
# authenticate during the grace window; remove the *_PREVIOUS vars once all
# clients have migrated.
# ORACLE_OPERATOR_API_KEY_PREVIOUS=
# ADMIN_API_KEY_PREVIOUS=
# How long (minutes) the *_PREVIOUS keys stay valid after startup. Default: 1440 (24h).
# Set to 0 to disable previous keys immediately.
# API_KEY_ROTATION_GRACE_MINUTES=1440
# ─── Stellar / Soroban ─────────────────────────────────────────────────────────
# RPC endpoint for Soroban contract calls — REQUIRED
STELLAR_RPC_URL="https://soroban-testnet.stellar.org"
# Network: "testnet" or "mainnet"
STELLAR_NETWORK="testnet"
# Secret key for the keeper account that submits oracle data and triggers claims — REQUIRED
# This account must be funded on the network before the service can submit transactions.
#
# To generate and fund a testnet keypair:
# 1. Generate: stellar keys generate keeper --network testnet
# 2. Fund the account: Visit https://laboratory.stellar.org/#account-creator
# or use: curl "https://friendbot.stellar.org?addr=<PUBLIC_KEY>"
# 3. Verify balance: stellar account <PUBLIC_KEY> --network testnet
#
# The keeper account signs all oracle submissions and claim payouts. Without a valid
# funded keypair, all Soroban contract invocations will fail with "account not found".
KEEPER_SECRET_KEY="S..."
# Contract IDs for deployed Soroban contracts (set after deploy_testnet.sh)
#
# ORACLE_VERIFIER_CONTRACT — required for OracleWorker on-chain data submission.
# Without this value the worker fetches and persists oracle readings to the DB
# but skips the stellar.invokeContract('submit_data') call. Set it to the
# Soroban contract address returned by deploy_testnet.sh.
ORACLE_VERIFIER_CONTRACT="C..."
POLICY_ENGINE_CONTRACT="C..."
CLAIMS_PROCESSOR_CONTRACT="C..."
# Testnet USDC
USDC_CONTRACT="GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5"
# ─── External APIs ─────────────────────────────────────────────────────────────
# AviationStack API key (required only for flight delay insurance products)
# Sign up at https://aviationstack.com — free tier available
AVIATIONSTACK_API_KEY= # optional — leave blank to use mock data
# ─── Secrets Management (optional) ─────────────────────────────────────────────
# If all three are set, the server fetches a HashiCorp Vault KV secret before
# Nest bootstraps and merges the returned keys into process.env.
# VAULT_ADDR="https://vault.example.com"
# VAULT_TOKEN="s.xxxxxx"
# VAULT_KV_PATH="secret/data/parashield/backend"
# ─── OpenTelemetry (optional) ─────────────────────────────────────────────────
# OTEL_SERVICE_NAME="parashield-backend"
# OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318/v1/traces"
# OTEL_EXPORTER_OTLP_HEADERS="api-key=..."
# OTEL_SDK_DISABLED=false
# ─── Server ────────────────────────────────────────────────────────────────────
# Port the API server listens on
PORT=3001
# Environment: "development", "staging", or "production"
NODE_ENV="development"
# ─── Response compression ─────────────────────────────────────────────────────
# gzip/deflate compression is applied automatically to all responses above the
# threshold. Clients that do not send Accept-Encoding receive uncompressed responses.
# COMPRESSION_LEVEL=6 # zlib level 0 (no compression) – 9 (max). Default: 6
# COMPRESSION_THRESHOLD_BYTES=1024 # Minimum response size to compress. Default: 1024 (1 KB)
# ─── Database replication lag ─────────────────────────────────────────────────
# Maximum replication lag (bytes) before the health check flags the database as
# degraded. Queries pg_stat_replication / pg_last_wal_receive_lsn.
# DB_REPLICATION_LAG_WARN_BYTES=52428800 # 50 MB default
# ─── Database connection pool exhaustion (#471) ───────────────────────────────
# Percentage of DATABASE_CONNECTION_LIMIT's active connections above which the
# health check flags the database as degraded, so pool exhaustion is caught
# before queries start queuing or timing out.
# DB_POOL_EXHAUSTION_WARN_PERCENT=90 # 90% default
# ─── CORS (#382) ──────────────────────────────────────────────────────────────
# CORS allowed origin — REQUIRED. Set to your frontend URL in production.
# Accepts a single origin or a comma-separated list of origins.
CORS_ORIGIN="http://localhost:3000"
# Optional tuning (defaults shown). See README "CORS configuration".
# CORS_METHODS=GET,POST,PUT,DELETE,OPTIONS
# CORS_ALLOWED_HEADERS=Content-Type,Authorization,x-wallet-address,x-wallet-signature,x-wallet-message,x-api-key,x-admin-api-key,Idempotency-Key
# CORS_CREDENTIALS=false