mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
25w03a
This commit is contained in:
parent
eddd37a59c
commit
5258046faa
4 changed files with 12 additions and 3 deletions
|
|
@ -1,5 +1,11 @@
|
|||
# 更新日志
|
||||
|
||||
25w03a
|
||||
---
|
||||
- PRE-RELEASE: 此版本是v1.8.2的候选预发布版本,请勿在生产环境中使用
|
||||
- FIX: 修复部分日志表述错误
|
||||
- CHANGE: 关闭`gin`框架的`fmt`日志打印, 在高并发场景下提升一定性能(go 打印终端日志性能较差,可能造成性能瓶颈)
|
||||
|
||||
1.8.1
|
||||
---
|
||||
- RELEASE: v1.8.1正式版发布; 此版本发布较为仓促, 用于修复caddy2.9.0导致的问题
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
25w02a
|
||||
25w03a
|
||||
5
main.go
5
main.go
|
|
@ -4,6 +4,7 @@ import (
|
|||
"embed"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"log"
|
||||
"net/http"
|
||||
|
|
@ -110,7 +111,9 @@ func init() {
|
|||
runMode = "release"
|
||||
}
|
||||
|
||||
router = gin.Default()
|
||||
gin.LoggerWithWriter(io.Discard)
|
||||
router := gin.New()
|
||||
router.Use(gin.Recovery())
|
||||
//H2C默认值为true,而后遵循cfg.Server.EnableH2C的设置
|
||||
if cfg.Server.EnableH2C == "on" {
|
||||
router.UseH2C = true
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ func NoRouteHandler(cfg *config.Config, limiter *rate.RateLimiter, iplimiter *ra
|
|||
if cfg.Blacklist.Enabled {
|
||||
blacklist := auth.CheckBlacklist(repouser, username, repo)
|
||||
if blacklist {
|
||||
logErrMsg := fmt.Sprintf("%s %s %s %s %s Whitelist Blocked repo: %s", c.ClientIP(), c.Request.Method, rawPath, c.Request.Header.Get("User-Agent"), c.Request.Proto, repouser)
|
||||
logErrMsg := fmt.Sprintf("%s %s %s %s %s Blacklist Blocked repo: %s", c.ClientIP(), c.Request.Method, rawPath, c.Request.Header.Get("User-Agent"), c.Request.Proto, repouser)
|
||||
errMsg := fmt.Sprintf("Blacklist Blocked repo: %s", repouser)
|
||||
c.JSON(http.StatusForbidden, gin.H{"error": errMsg})
|
||||
logWarning(logErrMsg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue