|
1 | | -HOST=0.0.0.0 |
2 | | -PORT=8000 |
| 1 | +# DevBin Backend Environment Configuration |
3 | 2 |
|
4 | | -# Database configuration |
5 | | -POSTGRES_USER: postgres |
6 | | -POSTGRES_PASSWORD: postgres |
7 | | -POSTGRES_DB: devbin |
| 3 | +# Environment (dev, staging, prod) |
| 4 | +APP_ENVIRONMENT=dev |
8 | 5 |
|
9 | | -# Application configuration |
10 | | -APP_DATABASE_URL=postgresql://postgres:postgres@devbin_db:5432/devbin |
| 6 | +# Server Configuration |
| 7 | +APP_PORT=8000 |
| 8 | +APP_HOST=0.0.0.0 |
| 9 | +APP_WORKERS=1 |
| 10 | +APP_RELOAD=false |
| 11 | +APP_DEBUG=false |
| 12 | + |
| 13 | +# Logging Configuration |
| 14 | +# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL |
| 15 | +APP_LOG_LEVEL=INFO |
| 16 | +# Log format: text (human-readable) or json (structured, for log aggregation) |
| 17 | +APP_LOG_FORMAT=text |
| 18 | + |
| 19 | +# Database Configuration |
| 20 | +APP_DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/devbin |
| 21 | + |
| 22 | +# Security - HTTPS |
| 23 | +# Set to true to redirect HTTP to HTTPS |
| 24 | +# Only enable if your deployment terminates SSL directly |
| 25 | +# Keep false if using reverse proxy (nginx, traefik, caddy, etc.) |
| 26 | +APP_ENFORCE_HTTPS=false |
| 27 | + |
| 28 | +# Security - CORS |
| 29 | +# For development (allows all origins): |
| 30 | +APP_CORS_DOMAINS=["*"] |
| 31 | +APP_ALLOW_CORS_WILDCARD=true |
| 32 | + |
| 33 | +# For production (specify exact domains): |
| 34 | +# APP_CORS_DOMAINS=["https://devbin.example.com","https://app.devbin.example.com"] |
| 35 | +# APP_ALLOW_CORS_WILDCARD=false |
| 36 | + |
| 37 | +# Trusted Hosts (for X-Forwarded-For header) |
| 38 | +APP_TRUSTED_HOSTS=["127.0.0.1"] |
| 39 | + |
| 40 | +# Paste Configuration |
11 | 41 | APP_MAX_CONTENT_LENGTH=10000 |
12 | 42 | APP_BASE_FOLDER_PATH=./files |
13 | | -# 1-9999999 or True for "os.cpu_count" ( how many cpu threads the machine has ) |
14 | | -# WARNING: Rate Limit / Cache is PER worker. e.g. expect 2x memore as both will cache different/doubles. |
15 | | -APP_WORKERS=1 |
16 | | -APP_BYPASS_TOKEN= # Bypasses Rate limits |
17 | | -APP_CORS_DOMAINS='["http://localhost:3000", "https://yourdomain.com"]' |
18 | | -APP_CACHE_TTL=300 |
19 | | -APP_CACHE_SIZE_LIMIT=1000 |
20 | 43 | APP_MIN_STORAGE_MB=1024 |
| 44 | +APP_KEEP_DELETED_PASTES_TIME_HOURS=336 |
21 | 45 |
|
22 | | -# Debug / Development settings |
23 | | -APP_SQLALCHEMY_ECHO=false |
24 | | -APP_DEBUG=false |
25 | | -RELOAD=false |
| 46 | +# Storage Configuration |
| 47 | +# Storage backend: local, s3, or minio (default: local) |
| 48 | +APP_STORAGE_TYPE=local |
| 49 | + |
| 50 | +# S3 Configuration (when STORAGE_TYPE=s3) |
| 51 | +# APP_S3_BUCKET_NAME=devbin-pastes |
| 52 | +# APP_S3_REGION=us-east-1 |
| 53 | +# APP_S3_ACCESS_KEY=your_access_key |
| 54 | +# APP_S3_SECRET_KEY=your_secret_key |
| 55 | +# APP_S3_ENDPOINT_URL= # Optional: custom S3 endpoint URL |
| 56 | + |
| 57 | +# MinIO Configuration (when STORAGE_TYPE=minio) |
| 58 | +# APP_S3_BUCKET_NAME=devbin-pastes |
| 59 | +# APP_MINIO_ENDPOINT=minio:9000 |
| 60 | +# APP_MINIO_ACCESS_KEY=minioadmin |
| 61 | +# APP_MINIO_SECRET_KEY=minioadmin |
| 62 | +# APP_MINIO_SECURE=true |
| 63 | + |
| 64 | +# Compression settings |
| 65 | +# Compression is most effective for content >= 2KB (achieves 30-40% compression ratio) |
| 66 | +# Smaller content compresses poorly and wastes CPU cycles |
| 67 | +APP_COMPRESSION_ENABLED=true |
| 68 | +APP_COMPRESSION_THRESHOLD_BYTES=2048 |
| 69 | +APP_COMPRESSION_LEVEL=6 |
| 70 | + |
| 71 | +# Caching |
| 72 | +# Cache backend: memory (default) or redis |
| 73 | +APP_CACHE_TYPE=memory |
| 74 | +APP_CACHE_SIZE_LIMIT=1000 |
| 75 | +APP_CACHE_TTL=300 |
| 76 | + |
| 77 | +# Redis Configuration (when CACHE_TYPE=redis or LOCK_TYPE=redis) |
| 78 | +# APP_REDIS_HOST=localhost |
| 79 | +# APP_REDIS_PORT=6379 |
| 80 | +# APP_REDIS_DB=0 |
| 81 | +# APP_REDIS_PASSWORD= # Optional password |
| 82 | + |
| 83 | +# Distributed Locking |
| 84 | +# Lock backend: file (default) or redis |
| 85 | +APP_LOCK_TYPE=file |
| 86 | + |
| 87 | +# Privacy Settings |
| 88 | +APP_SAVE_USER_AGENT=false |
| 89 | +APP_SAVE_IP_ADDRESS=false |
| 90 | + |
| 91 | +# Optional: Rate limit bypass token for trusted apps |
| 92 | +# APP_BYPASS_TOKEN=your_secret_bypass_token_here |
| 93 | + |
| 94 | +# Metrics Authentication |
| 95 | +# Optional: Secure the Prometheus /metrics endpoint with Bearer token authentication |
| 96 | +# If not set, metrics endpoint remains publicly accessible |
| 97 | +# Production deployments should set this to a strong random token |
| 98 | +# APP_METRICS_TOKEN=your_secure_random_token_here |
| 99 | +# Example generation: openssl rand -hex 32 |
26 | 100 |
|
27 | 101 | # Frontend configurations |
28 | | -API_BASE_URL=http://backend_container_name:port |
| 102 | +API_BASE_URL=http://devbin:8000 |
29 | 103 | PORT=3000 |
30 | 104 | ORIGIN=http://localhost:3000 # prevent cross-site post req forbidden from frontend because node can't resolve it's origin |
0 commit comments