-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy path.env.example
More file actions
266 lines (223 loc) · 8.34 KB
/
.env.example
File metadata and controls
266 lines (223 loc) · 8.34 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
PORT=3000
OTEL_DISABLED=false
OTEL_SERVICE_NAME=substream-protocol-backend
OTEL_SERVICE_VERSION=1.0.0
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318/v1/traces
OTEL_EXPORTER_OTLP_HEADERS=
OTEL_IGNORE_PATHS=/health,/metrics
OTEL_DIAG_LEVEL=error
# Creator auth configuration
CREATOR_AUTH_SECRET=replace-with-a-long-random-secret
CREATOR_AUTH_ISSUER=substream-backend
CREATOR_AUTH_AUDIENCE=substream-creators
# Local database configuration
DATABASE_FILENAME=./data/substream-protocol.sqlite
# Soroban Event Indexer Configuration
SOROBAN_RPC_URL=https://rpc.stellar.org
SOROBAN_NETWORK_PASSPHRASE=Public Network
SOROBAN_CONTRACT_ID=CAOUX2FZ65IDC4F2X7LJJ2SVF23A35CCTZB7KVVN475JCLKTTU4CEY6L
SOROBAN_MAX_RETRIES=5
SOROBAN_BASE_DELAY=1000
SOROBAN_MAX_DELAY=30000
SOROBAN_FAILURE_THRESHOLD=5
SOROBAN_RESET_TIMEOUT=60000
SOROBAN_REQUESTS_PER_SECOND=10
# Soroban Indexer Configuration
SOROBAN_PROCESSING_INTERVAL=5000
SOROBAN_EVENT_TYPES=SubscriptionBilled,TrialStarted,PaymentFailed
LOG_LEVEL=info
# ActivityPub Federation Configuration
ACTIVITYPUB_ENABLED=true
ACTIVITYPUB_BASE_URL=https://your-domain.com
ACTIVITYPUB_WORKER_INTERVAL=30000
ACTIVITYPUB_MAX_RETRIES=3
ACTIVITYPUB_SIGNING_SECRET=your-activitypub-signing-secret-key
# Engagement Leaderboard Configuration
LEADERBOARD_ENABLED=true
LEADERBOARD_CACHE_TTL=21600
LEADERBOARD_WORKER_INTERVAL=21600000
LEADERBOARD_BATCH_SIZE=10
LEADERBOARD_SEASON_LENGTH=monthly
LEADERBOARD_CACHE_PREFIX=leaderboard:cret
# CDN edge token configuration
CDN_BASE_URL=https://cdn.example.com/private
CDN_TOKEN_SECRET=replace-with-a-long-random-secret
CDN_TOKEN_TTL_SECONDS=300
CDN_TOKEN_ISSUER=substream-backend
CDN_TOKEN_AUDIENCE=substream-cdn
# Soroban view-call configuration
SOROBAN_RPC_URL=https://soroban-rpc.mainnet.stellar.gateway.fm
SOROBAN_NETWORK_PASSPHRASE=Public Global Stellar Network ; September 2015
SOROBAN_CONTRACT_ID=CAOUX2FZ65IDC4F2X7LJJ2SVF23A35CCTZB7KVVN475JCLKTTU4CEY6L
SOROBAN_SOURCE_SECRET=replace-with-a-funded-readonly-wallet-secret
SOROBAN_SUBSCRIPTION_METHOD=has_active_subscription
SOROBAN_SUBSCRIPTION_ARGUMENTS=address:walletAddress,address:creatorAddress
# Server Configuration
PORT=3000
NODE_ENV=development
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
# Stellar Configuration
STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
DOMAIN=substream-protocol.com
# Pinata Configuration
PINATA_API_KEY=your-pinata-api-key
PINATA_SECRET_KEY=your-pinata-secret-key
# Web3.Storage Configuration
WEB3STORAGE_API_KEY=your-web3-storage-api-key
# Infura IPFS Configuration
INFURA_API_KEY=your-infura-api-key
# Security Alert Configuration
SECURITY_ALERT_EMAIL=security@yourdomain.com
# Behavioral Biometric Fraud Detection Configuration
BEHAVIORAL_BIOMETRIC_ENABLED=false
# Behavioral Collection Settings
BEHAVIORAL_COLLECTION_ENABLED=true
BEHAVIORAL_SAMPLE_RATE=1.0
BEHAVIORAL_MAX_EVENTS_PER_SESSION=1000
BEHAVIORAL_SESSION_TIMEOUT=1800000
BEHAVIORAL_ANONYMIZE_IP=true
BEHAVIORAL_HASH_SALT=your-behavioral-hash-salt
# Behavioral Classifier Settings
BEHAVIORAL_CLASSIFIER_ENABLED=true
BEHAVIORAL_MODEL_TYPE=rule_based
BEHAVIORAL_CONFIDENCE_THRESHOLD=0.7
BEHAVIORAL_TRAINING_THRESHOLD=100
BEHAVIORAL_RETRAIN_INTERVAL=604800000
# Behavioral Risk Thresholds (0-1 scale)
BEHAVIORAL_BOT_SCORE_THRESHOLD=0.8
BEHAVIORAL_THROTTLING_THRESHOLD=0.6
BEHAVIORAL_WATCH_LIST_THRESHOLD=0.9
BEHAVIORAL_ANOMALY_THRESHOLD=0.75
# Behavioral Privacy Settings
BEHAVIORAL_DATA_RETENTION_DAYS=30
BEHAVIORAL_HASH_PERSONAL_DATA=true
BEHAVIORAL_EXCLUDE_PII=true
BEHAVIORAL_GDPR_COMPLIANT=true
# Database Configuration (for production)
# DATABASE_URL=postgresql://username:password@localhost:5432/substream
# Redis Configuration (for production caching)
# REDIS_URL=redis://localhost:6379
# Analytics Database (for production)
# INFLUXDB_URL=http://localhost:8086
# INFLUXDB_TOKEN=your-influxdb-token
# INFLUXDB_ORG=your-org
# INFLUXDB_BUCKET=substream-analytics
# Video Transcoding Configuration
FFMPEG_PATH=/usr/bin/ffmpeg
TRANSCODING_OUTPUT_DIR=./transcoded
MAX_CONCURRENT_TRANSCODINGS=3
# Redis Configuration (for job queue)
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
# S3 Configuration (for video storage)
S3_BUCKET=your-s3-bucket
S3_REGION=us-east-1
S3_ACCESS_KEY_ID=your-access-key
S3_SECRET_ACCESS_KEY=your-secret-key
# IPFS Configuration
IPFS_HOST=localhost
IPFS_PORT=5001
IPFS_PROTOCOL=http
# CDN Configuration for video streaming
CDN_BASE_URL=https://cdn.example.com/videos
# RabbitMQ Configuration (for asynchronous event processing)
RABBITMQ_URL=amqp://localhost:5672
RABBITMQ_HOST=localhost
RABBITMQ_PORT=5672
RABBITMQ_USERNAME=
RABBITMQ_PASSWORD=
RABBITMQ_VHOST=/
RABBITMQ_EVENT_EXCHANGE=substream_events
RABBITMQ_EVENT_QUEUE=substream_events_queue
RABBITMQ_NOTIFICATION_QUEUE=substream_notifications_queue
RABBITMQ_EMAIL_QUEUE=substream_emails_queue
RABBITMQ_LEADERBOARD_QUEUE=substream_leaderboard_queue
# Social Token Gating Configuration
SOCIAL_TOKEN_ENABLED=true
SOCIAL_TOKEN_CACHE_TTL=300
SOCIAL_TOKEN_REVERIFICATION_INTERVAL=60000
SOCIAL_TOKEN_CACHE_PREFIX=social_token:
STELLAR_MAX_RETRIES=3
STELLAR_RETRY_DELAY=1000
# Creator Collaboration Revenue Attribution Configuration
COLLABORATION_ENABLED=true
COLLABORATION_DEFAULT_SPLIT_RATIO=0.5
COLLABORATION_MIN_WATCH_TIME_SECONDS=30
COLLABORATION_CACHE_TTL=3600
COLLABORATION_CACHE_PREFIX=collaboration:
# Global Stats Caching Configuration
GLOBAL_STATS_REFRESH_INTERVAL=60000
GLOBAL_STATS_INITIAL_DELAY=5000
# Predictive Churn Analysis Configuration
CHURN_ANALYSIS_INTERVAL=3600000
# Global Engagement Leaderboard Configuration
LEADERBOARD_ENABLED=true
LEADERBOARD_CACHE_TTL=21600
LEADERBOARD_WORKER_INTERVAL=21600000
LEADERBOARD_BATCH_SIZE=10
LEADERBOARD_SEASON_LENGTH=monthly
LEADERBOARD_CACHE_PREFIX=leaderboard:
# Social Token Gating Configuration
SOCIAL_TOKEN_ENABLED=true
SOCIAL_TOKEN_CACHE_TTL=300
SOCIAL_TOKEN_REVERIFICATION_INTERVAL=60000
SOCIAL_TOKEN_CACHE_PREFIX=social_token:
STELLAR_MAX_RETRIES=3
STELLAR_RETRY_DELAY=1000
# PII Scrubbing Configuration (GDPR/CCPA Compliance)
PII_SCRUBBING_SALT=your-secure-random-salt-for-pii-hashing-min-32-bytes
INACTIVE_RETENTION_YEARS=3
PII_SCRUBBING_ENABLED=true
PII_SCRUBBING_CRON_SCHEDULE=0 2 * * 0 # Weekly on Sunday at 2 AM
# Isolated Soroban Subscription Worker Queues (Issue #230)
# These BullMQ queues run in isolation — each on-chain event type gets its own
# worker so that a billing spike cannot starve payment-failure dunning, etc.
SOROBAN_QUEUE_MAX_ATTEMPTS=5
SOROBAN_QUEUE_BACKOFF_DELAY_MS=2000
SOROBAN_QUEUE_DEFAULT_CONCURRENCY=5
SOROBAN_QUEUE_RETAIN_COMPLETED=200
SOROBAN_QUEUE_RETAIN_FAILED=100
# SubscriptionBilled queue
SOROBAN_QUEUE_BILLED_CONCURRENCY=10
SOROBAN_QUEUE_BILLED_MAX_ATTEMPTS=5
SOROBAN_QUEUE_BILLED_BACKOFF_MS=2000
SOROBAN_QUEUE_BILLED_RATE_MAX=100
SOROBAN_QUEUE_BILLED_RATE_WINDOW_MS=10000
# TrialStarted queue
SOROBAN_QUEUE_TRIAL_CONCURRENCY=8
SOROBAN_QUEUE_TRIAL_MAX_ATTEMPTS=5
SOROBAN_QUEUE_TRIAL_BACKOFF_MS=2000
SOROBAN_QUEUE_TRIAL_RATE_MAX=50
SOROBAN_QUEUE_TRIAL_RATE_WINDOW_MS=10000
# PaymentFailed queue (higher retries, slower backoff for dunning safety)
SOROBAN_QUEUE_PAYMENT_FAILED_CONCURRENCY=4
SOROBAN_QUEUE_PAYMENT_FAILED_MAX_ATTEMPTS=7
SOROBAN_QUEUE_PAYMENT_FAILED_BACKOFF_MS=5000
SOROBAN_QUEUE_PAYMENT_FAILED_RATE_MAX=30
SOROBAN_QUEUE_PAYMENT_FAILED_RATE_WINDOW_MS=10000
# PaymentFailedGracePeriodStarted queue
SOROBAN_QUEUE_GRACE_PERIOD_CONCURRENCY=4
SOROBAN_QUEUE_GRACE_PERIOD_MAX_ATTEMPTS=7
SOROBAN_QUEUE_GRACE_PERIOD_BACKOFF_MS=5000
SOROBAN_QUEUE_GRACE_PERIOD_RATE_MAX=30
SOROBAN_QUEUE_GRACE_PERIOD_RATE_WINDOW_MS=10000
# How often (ms) the subscription worker logs a queue stats snapshot
SOROBAN_WORKER_STATS_INTERVAL_MS=60000
# Set to 'false' to disable the subscription worker pool when running via worker.js
# (useful when running workers/sorobanSubscriptionWorker.js as a separate process)
SOROBAN_SUBSCRIPTION_WORKERS_ENABLED=true
# Sandbox Environment Configuration
SANDBOX_ENABLED=false
SANDBOX_MODE=testnet # testnet or mainnet
SANDBOX_DB_SCHEMA_PREFIX=sandbox_
SANDBOX_STELLAR_NETWORK_PASSPHRASE=Test SDF Network ; September 2015
SANDBOX_STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
SANDBOX_SOROBAN_RPC_URL=https://soroban-rpc.testnet.stellar.gateway.fm
SANDBOX_SOROBAN_CONTRACT_ID=CAOUX2FZ65IDC4F2X7LJJ2SVF23A35CCTZB7KVVN475JCLKTTU4CEY6L
SANDBOX_MOCK_PAYMENTS_ENABLED=true
SANDBOX_FAILURE_SIMULATION_ENABLED=true
SANDBOX_ZERO_VALUE_TOKENS_ENABLED=true