- Separate /uploads and /api/upload routes from Dioxus app to avoid IncrementalRenderer intercepting non-page requests - Remove broken SmartIpKeyExtractor-based general_limit() that failed under Dioxus dev server proxy (Unable To Extract Key) - Move rate limiting into handlers using governor::RateLimiter directly - Add IMAGE_LIMITER for /uploads/* serving - Make all rate limits configurable via environment variables - Add rate limit config to .env.example with sensible defaults
13 lines
396 B
Plaintext
13 lines
396 B
Plaintext
DATABASE_URL=postgres://postgres:postgres@localhost:5432/yggdrasil
|
||
RUST_LOG=info
|
||
|
||
# Rate Limit — 严格限流(登录、注册)
|
||
RATE_LIMIT_STRICT_PER_SEC=1
|
||
RATE_LIMIT_STRICT_BURST=5
|
||
# Rate Limit — 上传限流(图片上传)
|
||
RATE_LIMIT_UPLOAD_PER_SEC=2
|
||
RATE_LIMIT_UPLOAD_BURST=15
|
||
# Rate Limit — 图片访问限流(/uploads/*)
|
||
RATE_LIMIT_IMAGE_PER_SEC=10
|
||
RATE_LIMIT_IMAGE_BURST=50
|