Skip to content

Commit ca3d0cb

Browse files
committed
docs: update .env.example with improved descriptions and security focus
- Restructure and group configuration sections for clarity - Add detailed comments for HTTPS, CORS, and security-related settings - Update placeholder values and improve formatting for readability
1 parent 847e5eb commit ca3d0cb

File tree

2 files changed

+39
-24
lines changed

2 files changed

+39
-24
lines changed

.env.example

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,46 @@
1-
HOST=0.0.0.0
1+
# DevBin Backend Environment Configuration
2+
3+
# Server Configuration
24
APP_PORT=8000
5+
APP_HOST=0.0.0.0
6+
APP_WORKERS=1
7+
APP_RELOAD=false
8+
APP_DEBUG=false
9+
10+
# Database Configuration
11+
APP_DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/devbin
12+
13+
# Security - HTTPS
14+
# Set to true to redirect HTTP to HTTPS
15+
# Only enable if your deployment terminates SSL directly
16+
# Keep false if using reverse proxy (nginx, traefik, caddy, etc.)
17+
APP_ENFORCE_HTTPS=false
18+
19+
# Security - CORS
20+
# For development (allows all origins):
21+
APP_CORS_DOMAINS=["*"]
22+
APP_ALLOW_CORS_WILDCARD=true
23+
24+
# For production (specify exact domains):
25+
# APP_CORS_DOMAINS=["https://devbin.example.com","https://app.devbin.example.com"]
26+
# APP_ALLOW_CORS_WILDCARD=false
327

4-
# Database configuration
5-
POSTGRES_USER=postgres
6-
POSTGRES_PASSWORD=postgres
7-
POSTGRES_DB=devbin
28+
# Trusted Hosts (for X-Forwarded-For header)
29+
APP_TRUSTED_HOSTS=["127.0.0.1"]
830

9-
# Application configuration
10-
APP_DATABASE_URL=postgresql://postgres:postgres@devbin_db:5432/devbin
31+
# Paste Configuration
1132
APP_MAX_CONTENT_LENGTH=10000
1233
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"]'
18-
APP_CACHE_TTL=300
19-
APP_CACHE_SIZE_LIMIT=1000
2034
APP_MIN_STORAGE_MB=1024
21-
APP_TRUSTED_HOSTS='["127.0.0.1", 'devbin_frontend']'
22-
APP_KEEP_DELETED_PASTES_TIME_HOURS=336 # 2 Weeks
35+
APP_KEEP_DELETED_PASTES_TIME_HOURS=336
2336

24-
# Debug / Development settings
25-
APP_SQLALCHEMY_ECHO=false
26-
APP_DEBUG=true
27-
APP_RELOAD=false
37+
# Caching
38+
APP_CACHE_SIZE_LIMIT=1000
39+
APP_CACHE_TTL=300
40+
41+
# Privacy Settings
42+
APP_SAVE_USER_AGENT=false
43+
APP_SAVE_IP_ADDRESS=false
2844

29-
# Frontend configurations
30-
API_BASE_URL=http://devden:8000
31-
PORT=3000
45+
# Optional: Rate limit bypass token for trusted apps
46+
# APP_BYPASS_TOKEN=your_secret_bypass_token_here

backend/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ APP_CACHE_TTL=300
4242
APP_SAVE_USER_AGENT=false
4343
APP_SAVE_IP_ADDRESS=false
4444

45-
# Optional: Rate limit bypass token for testing
45+
# Optional: Rate limit bypass token for trusted apps
4646
# APP_BYPASS_TOKEN=your_secret_bypass_token_here

0 commit comments

Comments
 (0)