-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
47 lines (35 loc) · 1.38 KB
/
.env.example
File metadata and controls
47 lines (35 loc) · 1.38 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
# define environment variables
# interface and port for the server to listen on
HOST=0.0.0.0
PORT=8000
# Security Configuration
# IMPORTANT: Change this to a secure random string!
# Generate with: python -c "import secrets; print(secrets.token_urlsafe(32))"
ADMIN_API_KEY=CHANGE_ME_TO_SECURE_RANDOM_STRING
# Rate Limiting Configuration
# Maximum requests per minute from a single IP
RATE_LIMIT_REQUESTS_PER_MINUTE=60
# Maximum requests per second from a single IP (burst protection)
RATE_LIMIT_REQUESTS_PER_SECOND=10
# Ban Durations (in seconds)
# Duration for rate limit violations
BAN_DURATION_RATE_LIMIT=3600
# Duration for suspicious request patterns (/.env, /*.php, etc)
BAN_DURATION_SUSPICIOUS=86400
# File Paths for Persistent Storage
BANNED_IPS_FILE=data/banned_ips.json
GEO_RULES_FILE=data/geo_rules.json
# Background Job Configuration
# How often to clean up expired bans (seconds)
CLEANUP_INTERVAL_SECONDS=300
# How often to clean up old rate limit records (seconds)
RATE_LIMIT_CLEANUP_INTERVAL=60
# Geographic Blocking Configuration (Optional)
# Mode: disabled, allowlist, or blocklist
# GEO_MODE=disabled
# Comma-separated country codes to block (ISO 3166-1 alpha-2)
# GEO_BLOCKED_COUNTRIES=CN,RU,KP,IR
# Comma-separated country codes to allow (only used in allowlist mode)
# GEO_ALLOWED_COUNTRIES=US,CA,GB,DE,JP
# Block IPs from unknown/unresolved countries
# GEO_BLOCK_UNKNOWN=false