fix: 过滤入口拒绝日志并强化鉴权边界

This commit is contained in:
benjamin
2026-07-18 00:11:18 +08:00
parent 57914967cb
commit b92bbf0299
101 changed files with 5872 additions and 828 deletions
+29
View File
@@ -27,6 +27,15 @@ server:
# 用于生成邮件中的外部链接(例如:重置密码链接)的前端基础地址
# Example: "https://example.com"
frontend_url: ""
# Maximum time to receive complete request headers. Does not limit response streams.
# 完整读取请求头的最大时间;不限制响应流持续时间。
read_header_timeout: 10
# Request header limit in bytes (64 KiB); also bounds the HTTP/2 header list.
# 请求头上限(字节,默认 64 KiB);同时约束 HTTP/2 header list。
max_header_bytes: 65536
# Keep-alive idle timeout in seconds.
# Keep-Alive 空闲连接超时(秒)。
idle_timeout: 120
# Trusted proxies for X-Forwarded-For parsing (CIDR/IP). Empty disables trusted proxies.
# 信任的代理地址(CIDR/IP 格式),用于解析 X-Forwarded-For 头。留空则禁用代理信任。
trusted_proxies: []
@@ -167,6 +176,9 @@ gateway:
# Max request body size in bytes (default: 256MB)
# 请求体最大字节数(默认 256MB)
max_body_size: 268435456
# Pure-text endpoint body limit (embeddings and alpha/search), default 32 MiB.
# 纯文本端点请求体上限(embeddings、alpha/search),默认 32 MiB。
text_max_body_size: 33554432
# Max bytes to read for non-stream upstream responses (default: 8MB)
# 非流式上游响应体读取上限(默认 8MB)
upstream_response_read_max_bytes: 8388608
@@ -708,6 +720,23 @@ api_key_auth_cache:
# Enable singleflight for cache misses
# 缓存未命中时启用 singleflight 合并回源
singleflight: true
# Maximum concurrent database lookups for authentication cache misses
# 认证缓存未命中时允许并发回源数据库的最大数量
lookup_concurrency: 64
# Process-local invalid-auth abuse protection. Counts only missing, malformed,
# deprecated-query, and confirmed invalid credentials; valid requests and
# Redis/DB failures do not consume the budget.
# 本机无效鉴权防护:仅统计缺失、格式错误、废弃 query 及确认无效的凭据。
invalid_abuse:
enabled: true
# Invalid attempts per trusted client IP (IPv6 grouped by /64) per window.
# 每个可信客户端 IP(IPv6 按 /64 聚合)在窗口内允许的无效次数。
threshold: 120
window_seconds: 60
block_seconds: 60
# Maximum tracked client identities per process; memory remains bounded.
# 每进程最多跟踪的客户端身份数量,确保内存有界。
capacity: 16384
# =============================================================================
# Dashboard Cache Configuration