forked from ApexChainx/ApexChainx-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
107 lines (93 loc) · 4.36 KB
/
Copy path.env.example
File metadata and controls
107 lines (93 loc) · 4.36 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
# ApexChainx Backend Environment Configuration
# Copy this file to .env and fill in your actual values
# NEVER commit .env to version control
#
# SECURITY GUIDANCE (BE-050):
# - Use strong, randomly-generated secrets for all *_SECRET_KEY values
# - Never use placeholder values in production environments
# - Rotate secrets regularly and after any suspected compromise
# - Use environment-specific secrets (dev/staging/prod must differ)
# - Consider using a secrets manager (AWS Secrets Manager, HashiCorp Vault) for production
# Project Configuration
PROJECT_NAME=ApexChainx API
VERSION=1.0.0
DEBUG=false
# Database Configuration
# SECURITY: Use strong passwords. Never use 'password' in production.
DATABASE_URL=postgresql://username:[STRONG_PASSWORD]@localhost:5432/apexchainx
# API Configuration
API_V1_PREFIX=/api/v1
ALLOWED_ORIGINS=["http://localhost:3000", "http://localhost:3001"]
# SECURITY: Generate a cryptographically secure random string (min 32 chars)
# Example: openssl rand -hex 32
SECRET_KEY=[GENERATE_SECURE_RANDOM_STRING]
# Authentication Configuration
# SECURITY: Generate a cryptographically secure random string (min 32 chars)
# This key signs JWT tokens - compromise allows token forgery
JWT_SECRET_KEY=[GENERATE_SECURE_RANDOM_STRING]
AUTH_MAX_FAILED_ATTEMPTS=5
AUTH_LOCKOUT_DURATION_MINUTES=15
AUTH_RATE_LIMIT_REQUESTS=10
AUTH_RATE_LIMIT_WINDOW_SECONDS=300
# Input Validation Limits
MAX_REQUEST_BODY_SIZE_BYTES=10485760
MAX_FILE_UPLOAD_SIZE_BYTES=10485760
MAX_BULK_OUTAGES_COUNT=1000
MAX_AFFECTED_SERVICES_COUNT=100
MAX_SITE_NAME_LENGTH=255
MAX_DESCRIPTION_LENGTH=5000
MAX_WEBHOOK_NAME_LENGTH=255
MAX_WEBHOOK_URL_LENGTH=2048
MAX_WEBHOOK_EVENTS_COUNT=50
# Celery Configuration (optional - required for background jobs)
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0
CELERY_TASK_ALWAYS_EAGER=true
# Stellar Blockchain Configuration (optional - required for blockchain features)
STELLAR_NETWORK=testnet
STELLAR_HORIZON_URL=https://horizon-testnet.stellar.org
STELLAR_SOROBAN_RPC_URL=https://soroban-testnet.stellar.org
# SECURITY: Only store PUBLIC keys in configuration files
STELLAR_POOL_PUBLIC_KEY=[YOUR_STELLAR_PUBLIC_KEY_STARTS_WITH_G]
#
# CRITICAL SECURITY WARNING:
# - NEVER put secret keys (starting with 'S') in this file or any file tracked by version control
# - Secret keys must be injected via environment variables or a secrets manager at runtime
# - If a secret key is compromised, immediately rotate it and revoke associated accounts
# - Use separate keys for testnet and mainnet - NEVER reuse
# STELLAR_POOL_SECRET_KEY=INJECT_VIA_ENVIRONMENT_OR_SECRETS_MANAGER_NOT_THIS_FILE
# Smart Contract Configuration (optional)
SLA_CONTRACT_ID=your-contract-id-here
USDC_TOKEN_ADDRESS=your-usdc-token-address-here
APEXCHAINX_TOKEN_ADDRESS=your-apexchainx-token-address-here
# Payment Configuration
# PAYMENT_ASSET_CODE: Stellar asset code used for SLA settlement payments.
# testnet: USDC (or a test token)
# staging: USDC
# production: USDC (or the agreed settlement asset)
PAYMENT_ASSET_CODE=USDC
# PAYMENT_FROM_ADDRESS: Stellar public key of the pool account that sends payments.
PAYMENT_FROM_ADDRESS=your-pool-address-here
# PAYMENT_TO_ADDRESS: Stellar public key of the settlement account that receives payments.
PAYMENT_TO_ADDRESS=your-settlement-address-here
# Wallet Configuration
WALLET_CACHE_TTL_SECONDS=60
# Reverse-proxy / trusted-proxy settings (#205)
# Set to the number of trusted proxy hops in front of this app.
# 0 = no proxy (use direct connection IP, ignore X-Forwarded-For).
# 1 = one load balancer / reverse proxy in front of the app.
# Prevents clients from spoofing their IP via X-Forwarded-For.
TRUSTED_PROXY_COUNT=0
# Webhook retry backoff policy (#236)
# Comma-separated base delay seconds for each retry attempt.
# The actual delay is base * 2^attempt, capped at WEBHOOK_RETRY_MAX_DELAY_SECONDS.
WEBHOOK_RETRY_BASE_DELAYS=30,120,600
WEBHOOK_RETRY_MAX_DELAY_SECONDS=3600
# Webhook Security (BE-050)
# PAYMENT_WEBHOOK_SECRET: HMAC secret for verifying webhook signature authenticity
# SECURITY: Generate a cryptographically secure random string (min 32 chars)
# This secret prevents unauthorized webhook injection attacks
PAYMENT_WEBHOOK_SECRET=[GENERATE_SECURE_RANDOM_STRING_FOR_WEBHOOK_SIG]
# External Service Configuration
# SECURITY: Use secrets manager for production API keys
# EXAMPLE_API_KEY=INJECT_VIA_ENVIRONMENT_OR_SECRETS_MANAGER