-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.env.example
More file actions
291 lines (265 loc) · 10.7 KB
/
.env.example
File metadata and controls
291 lines (265 loc) · 10.7 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
283
284
285
286
287
288
289
290
291
# ============================================
# Pulse - WhatsApp Web.js Prototype
# ============================================
# This is the configuration for the WhatsApp Web.js prototype branch.
# This branch uses WhatsApp Web automation for development/testing only.
#
# ⚠️ WARNING: WhatsApp may ban numbers using automation. Use a test number!
# ============================================
# Application Configuration
NODE_ENV=development
PORT=3000
# ============================================
# Redis Configuration (Required)
# ============================================
# Redis is used for session management and caching
# To start Redis locally: docker compose up -d redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=flash_redis_secure_pass
# ============================================
# RabbitMQ Configuration (Required)
# ============================================
# RabbitMQ is used for event messaging between services
# To start RabbitMQ locally: docker compose up -d rabbitmq
RABBITMQ_URL=amqp://flash:flash_secure_pass@localhost:5672
# ============================================
# Flash API Configuration (Optional)
# ============================================
# The Flash GraphQL API endpoint for account operations
# Leave empty to disable Flash API integration during development
# To get these values:
# 1. Contact the Flash API team for sandbox credentials
# 2. Or leave empty to test without account linking features
FLASH_API_URL=https://api.flashapp.me/graphql
FLASH_API_KEY=
# ============================================
# Google Gemini AI Configuration (Optional)
# ============================================
# Gemini AI provides intelligent responses for customer queries
# To get an API key:
# 1. Go to https://makersuite.google.com/app/apikey
# 2. Click "Create API Key"
# 3. Copy the generated key here
# Leave empty to disable AI responses (will use basic FAQ responses)
GEMINI_API_KEY=
# ============================================
# Telegram Bot Configuration (Optional)
# ============================================
# Telegram bot for Pulse messaging
# To set up:
# 1. Message @BotFather on Telegram
# 2. Use /newbot command to create a new bot
# 3. Choose a name (e.g., "Pulse Flash Wallet")
# 4. Choose a username (e.g., "pulse_flash_bot")
# 5. Copy the token provided by BotFather
# Leave empty to disable Telegram bot
TELEGRAM_BOT_TOKEN=
# ============================================
# WhatsApp Web.js Configuration
# ============================================
# Multi-Instance Support:
# Configure multiple WhatsApp numbers to run simultaneously
# Each instance runs in an isolated Chrome profile
#
# Format: Comma-separated phone numbers (without + prefix)
# Example: WHATSAPP_INSTANCES=18001234567,18007654321
# Leave empty for single instance mode
WHATSAPP_INSTANCES=
#
# Single Instance Mode (backward compatibility):
# If WHATSAPP_INSTANCES is empty, you can specify a single default phone
# WHATSAPP_DEFAULT_PHONE=18001234567
#
# Chrome Configuration:
# Starting port for Chrome debugging (each instance uses a different port)
# CHROME_DEBUG_PORT_START=9222
#
# Session Configuration:
# Directory for WhatsApp session data
# WHATSAPP_SESSION_PATH=./whatsapp-sessions
#
# Auto-reconnect Configuration:
# WHATSAPP_AUTO_RECONNECT=true
# WHATSAPP_MAX_RECONNECT_ATTEMPTS=5
#
# Optional: Disable WhatsApp Web initialization (for testing APIs only)
# DISABLE_WHATSAPP_WEB=false
# ============================================
# Security Configuration (REQUIRED in production)
# ============================================
# JWT Configuration
JWT_SECRET=your_jwt_secret_here_min_32_chars_required_in_production
JWT_EXPIRES_IN=24h
JWT_REFRESH_EXPIRES_IN=7d
# Encryption Keys (REQUIRED - generate secure random strings)
# Generate with: openssl rand -hex 32
ENCRYPTION_KEY=your_encryption_key_here_min_32_chars_required
ENCRYPTION_SALT=your_encryption_salt_here_min_16_chars
HASH_SALT=your_hash_salt_here_min_16_chars
# Session Configuration
SESSION_SECRET=your_session_secret_here_min_32_chars
SESSION_EXPIRES_IN=86400
SESSION_ROTATION_INTERVAL=3600
# Webhook Security
WEBHOOK_SECRET=your_webhook_secret_here_min_32_chars
WEBHOOK_TOLERANCE=300
# MFA/OTP Configuration
OTP_LENGTH=6
OTP_EXPIRES_IN=300
OTP_MAX_ATTEMPTS=3
MFA_TIMEOUT_SECONDS=300
# ============================================
# CORS Configuration
# ============================================
# Comma-separated list of allowed origins for CORS
# In production, specify exact origins (e.g., https://app.flashapp.me,https://admin.flashapp.me)
# Leave empty to deny all cross-origin requests
CORS_ALLOWED_ORIGINS=
# ============================================
# Rate Limiting
# ============================================
# Prevent abuse by limiting requests per user
# RATE_LIMIT_WINDOW_MS: Time window in milliseconds
# RATE_LIMIT_MAX_REQUESTS: Maximum requests per time window
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX_REQUESTS=100
# ============================================
# Request Size Limits
# ============================================
# Limit request body sizes to prevent DoS attacks
# Supports formats like: 100kb, 1mb, 10mb
MAX_REQUEST_SIZE=10mb
MAX_JSON_SIZE=1mb
MAX_URL_ENCODED_SIZE=1mb
# ============================================
# Cache Configuration
# ============================================
# TTL (Time To Live) for various caches in seconds
# These control how long data is cached before refreshing
BALANCE_CACHE_TTL=300 # User balance cache (default: 5 minutes)
PRICE_CACHE_TTL=900 # Bitcoin price cache (default: 15 minutes)
USERNAME_CACHE_TTL=3600 # Username cache (default: 1 hour)
EXCHANGE_RATE_CACHE_TTL=1800 # Exchange rate cache (default: 30 minutes)
TRANSACTION_CACHE_TTL=86400 # Transaction cache (default: 24 hours)
SESSION_CACHE_TTL=1800 # Session cache (default: 30 minutes)
# Cache Warming Configuration
CACHE_WARMUP_ENABLED=true # Enable cache warming
CACHE_WARMUP_ON_STARTUP=true # Warm cache on startup
CACHE_WARMUP_SCHEDULE=0 * * * * # Cron schedule (default: every hour)
CACHE_WARMUP_PRICE=true # Warm price cache
CACHE_WARMUP_SESSION=true # Warm session cache
CACHE_WARMUP_CURRENCIES=USD,JMD # Comma-separated list of currencies to warm (default: USD,JMD)
# Redis Connection Pool Configuration
REDIS_POOL_ENABLED=true # Enable connection pooling
REDIS_POOL_MIN=2 # Minimum connections in pool
REDIS_POOL_MAX=10 # Maximum connections in pool
REDIS_POOL_ACQUIRE_TIMEOUT=3000 # Timeout to acquire connection (ms)
REDIS_POOL_IDLE_TIMEOUT=30000 # Idle connection timeout (ms)
REDIS_POOL_CONNECTION_NAME=pulse-pool # Connection name prefix
REDIS_ENABLE_READ_REPLICAS=false # Enable read replicas
# ============================================
# Logging
# ============================================
# Log level: error, warn, info, debug, verbose
LOG_LEVEL=info
# ============================================
# Nostr Configuration (Optional)
# ============================================
# Nostr integration for content sharing and zap forwarding
# The Pulse bot posts content on behalf of users to earn sats
# To set up:
# 1. Generate a new Nostr private key for Pulse
# 2. Add the nsec (private key) below
# 3. Configure relay servers (comma-separated)
# Leave empty to disable vybz/content sharing features
NOSTR_PRIVATE_KEY=
NOSTR_RELAYS=wss://relay.damus.io,wss://nos.lol,wss://relay.nostr.band,wss://relay.flashapp.me,wss://relay.primal.net,wss://nos.lol
# Optional: Your Pulse bot's npub (public key) for reference
NOSTR_PULSE_NPUB=
# ============================================
# Payment Notifications Configuration
# ============================================
# Enable/disable payment polling when Flash API is unavailable
# Set to false to disable the connection timeout errors
ENABLE_INTRALEDGER_POLLING=true
ENABLE_WEBSOCKET_NOTIFICATIONS=true
# Polling interval in milliseconds (default: 10000 = 10 seconds)
PAYMENT_POLLING_INTERVAL=10000
# ============================================
# Admin Configuration
# ============================================
# Comma-separated list of phone numbers that can use admin commands
# Example: ADMIN_PHONE_NUMBERS=13059244435,18765551234
ADMIN_PHONE_NUMBERS=13059244435,18764250250
# ============================================
# Support Configuration
# ============================================
# Phone number for Flash support agent (without + prefix)
# When users request human support, messages will be routed to this number
SUPPORT_PHONE_NUMBER=18762909250
# ============================================
# Google Cloud Voice Services (Optional)
# ============================================
# Enables both Text-to-Speech and Speech-to-Text features
#
# Text-to-Speech: Premium voice responses with Chirp3-HD voices
# Speech-to-Text: Process voice messages from users
#
# To enable:
# 1. Create a Google Cloud project
# 2. Enable BOTH APIs:
# - Cloud Text-to-Speech API
# - Cloud Speech-to-Text API
# 3. Create a service account with permissions for both APIs
# 4. Download JSON key file and set path below
#
# Without configuration:
# - TTS falls back to free google-tts-api (200 char limit)
# - Voice messages won't be processed (unless Whisper is configured)
#
# Option 1: Specify key file path
GOOGLE_CLOUD_KEYFILE=/path/to/your/service-account-key.json
#
# Option 2: Use environment variable (if already configured)
# GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/service-account-key.json
# ============================================
# OpenAI Whisper Configuration (Optional)
# ============================================
# Alternative speech-to-text using OpenAI's Whisper model
# Works as primary or fallback to Google Cloud Speech
#
# To enable:
# 1. Get an OpenAI API key from https://platform.openai.com/api-keys
# 2. Add the key below
#
# Features:
# - More accurate for conversational speech
# - Better handling of accents and dialects
# - Works with all WhatsApp voice message formats
#
OPENAI_API_KEY=
# Set to true to prefer Whisper over Google Cloud Speech
PREFER_WHISPER=false
# Temporary directory for audio file processing (default: /tmp)
TEMP_DIR=/tmp
# ============================================
# ElevenLabs Configuration (Optional)
# ============================================
# Ultra-realistic AI voice synthesis for voice-only mode
# Provides the most natural-sounding voice responses
#
# To enable:
# 1. Sign up at https://elevenlabs.io
# 2. Get your API key from the profile settings
# 3. Add the key below
#
# Features:
# - Ultra-realistic AI voices
# - Automatic activation for voice-only mode users
# - Falls back to Google Cloud TTS if unavailable
#
ELEVENLABS_API_KEY=
# Optional: Specify a voice ID (default: Sarah voice)
# Find voice IDs at https://elevenlabs.io/voice-library
ELEVENLABS_VOICE_ID=EXAVITQu4vr4xnSDxMaL