feat(log): 多源 clientIP 降级与去重 ip_chain

按 EO→XFF非回环→X-Real→RemoteAddr 选取 ip;访问日志附带去重 ip_chain;登录限流改用 clientIP。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-23 06:04:43 +08:00
parent 831a7f017a
commit 25faa93724
5 changed files with 189 additions and 19 deletions
+1 -1
View File
@@ -963,7 +963,7 @@ var TptProject = Proj{
},
"login": func(that *Context) {
// 限速:同一 IP 1分钟内最多尝试10次
ip := that.Req.Header.Get("X-Forwarded-For")
ip := clientIP(that.Req)
if ip == "" {
ip = that.Req.RemoteAddr
}