games_app/backend/.env.example
2026-11-01 20:02:00 +02:00

126 lines
4.5 KiB
Plaintext

# Server
NODE_ENV=development
PORT=4000
API_PREFIX=/api/v1
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/crypto_wallet
# JWT
JWT_SECRET=your-super-secret-jwt-key-min-32-chars
# One-time first-admin setup (production). Min. 16 chars; use 32+ random characters.
# INITIAL_SETUP_TOKEN=your-random-setup-token-min-32-chars
# Emergency Super Admin 2FA reset (CLI only). Min 32 chars; leave empty to disable.
# BREAK_GLASS_TOKEN=
JWT_ACCESS_EXPIRY=15m
JWT_REFRESH_EXPIRY=7d
# Encryption (AES-256) - 32 bytes hex
ENCRYPTION_KEY=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
# HD Wallet - platform mnemonic (24 words). Keep secret; used to derive user deposit addresses and hot wallet.
PLATFORM_MNEMONIC=word1 word2 ... word24
# Blockchain
TRON_NODE_URL=https://api.trongrid.io
TRON_API_KEY=
POLYGON_RPC_URL=https://polygon-rpc.com
USDC_POLYGON_CONTRACT=0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359
# Leave empty in production (uses mainnet USDT from DB). Shasta contract is rejected at boot when NODE_ENV=production.
USDT_TRC20_CONTRACT=
# BSC mainnet for USDT BEP20 (parallel to TRC20)
BSC_RPC_URL=https://bsc-dataseed.binance.org
# Leave empty to use official USDT BEP20 from DB
USDT_BEP20_CONTRACT=
BSC_GETLOGS_BLOCK_RANGE=2000
# Safety (recommended for testing)
# NETWORK_MODE=testnet # default behavior in non-production is testnet safety
# ALLOW_WITHDRAWALS=false # withdrawals are disabled unless set to true
# Deposit confirmations
TRON_CONFIRMATIONS=20
BSC_CONFIRMATIONS=15
POLYGON_CONFIRMATIONS=64
# Rate limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX=100
LOGIN_RATE_LIMIT_MAX=5
# Withdrawal
DAILY_WITHDRAWAL_LIMIT_USD=10000
LARGE_WITHDRAWAL_THRESHOLD_USD=1000
# Countries catalog (optional — without a key, sync uses ISO 3166 from GitHub)
# REST_COUNTRIES_API_KEY=
# App URLs (verification links in emails)
# SMTP settings can live here or in the repo root .env (root wins for mail vars).
APP_PUBLIC_URL=http://localhost:5173
# Admin SSL expiry page (live TLS probes). Defaults: APP_PUBLIC_URL host + www on :443.
# SSL_STATUS_HOSTS=tloto.net,www.tloto.net
# SSL_STATUS_WARN_DAYS=30
# SSL_STATUS_CRITICAL_DAYS=7
# SSL_STATUS_TIMEOUT_MS=8000
# Admin VPS monitor (Prometheus internal URL — never expose :9090 publicly)
# PROMETHEUS_URL=http://prometheus:9090
# VPS_MONITOR_TIMEOUT_MS=8000
# EMAIL_TRANSPORT=console # omit or set smtp when SMTP_* vars are configured
VERIFY_EMAIL_PATH=/verify-email
RESET_PASSWORD_PATH=/reset-password
PASSWORD_RESET_EXPIRY_HOURS=1
# SMTP (required when EMAIL_TRANSPORT=smtp). Prefer repo-root .env on VPS (Compose injects these).
# Tloto production = Microsoft 365 / GoDaddy only (not Gmail):
# EMAIL_TRANSPORT=smtp
# SMTP_HOST=smtp.office365.com
# SMTP_PORT=587
# SMTP_SECURE=false
# SMTP_USER=admin@tloto.net
# SMTP_PASS=your-mailbox-password-or-app-password
# EMAIL_FROM="Tloto <info@tloto.net>"
# EMAIL_REPLY_TO=info@tloto.net
# Candle Predict engine (performance tuning for production scale)
# CANDLE_PREDICT_ENGINE_TICK_MS=3000 # main loop interval (ms)
# CANDLE_PREDICT_BACKFILL_MAX_PER_TICK=2 # candles per interval per backfill run
# CANDLE_PREDICT_BACKFILL_INTERVAL_MS=60000 # min delay between backfill runs (ms)
# CANDLE_PREDICT_BACKFILL_SEED_MAX=15 # initial chart history per interval
# Phase B — Redis + realtime (optional in local dev)
# Prefer password auth. Docker Compose injects redis://:${REDIS_PASSWORD}@redis:6379.
# Local (only if Redis is published on the host):
REDIS_URL=redis://:change-me-to-a-long-random-hex-secret@localhost:6379
REDIS_ENABLED=true
REDIS_ROUND_CACHE=true
BET_ASYNC=true
ENGINE_ENABLED=false
WS_ENABLED=false
WS_PORT=4001
WS_PATH=/ws/v1/games/candle-predict
WS_SUPPORT_PATH=/ws/v1/support
WS_SECURITY_PATH=/ws/v1/security
WORKER_ID=worker-1
# Observability (optional)
# SENTRY_DSN=https://...@sentry.io/...
# SENTRY_TRACES_SAMPLE_RATE=0.1
# ClamAV virus scan on uploads (optional — requires clamd)
# CLAMAV_ENABLED=false
# CLAMAV_HOST=127.0.0.1
# CLAMAV_PORT=3310
# CLAMAV_TIMEOUT_MS=30000
# Mobile APK releases (see docs/MOBILE_APP_RELEASES.md)
# ANDROID_APK_EXPECTED_CERT_SHA256=
# ANDROID_APK_EXPECTED_PACKAGE=com.prediqo.mobile
# APK_MAX_UPLOAD_BYTES=125829120
# APK_DOWNLOAD_TOKEN_TTL_SECONDS=3600
# Slack alerts (optional — create one Incoming Webhook per channel in Slack)
# SLACK_SECURITY_WEBHOOK_URL=https://hooks.slack.com/services/... # #security
# SLACK_REFERRAL_WEBHOOK_URL=https://hooks.slack.com/services/... # #referral-fraud
# SLACK_WEBHOOK_URL=https://hooks.slack.com/services/... # legacy fallback for both