diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a9638b..a0c8786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,5 @@ # 更新日志 -4.2.7 - 2025-08-04 ---- -- CHANGE: 在OCI镜像(docker)代理部分增加特殊处理, 保证可用性 参看[#159](https://github.com/WJQSERVER-STUDIO/ghproxy/issues/159) -- CHANGE: 更新Touka框架, 同步解决部分日志过多问题 - 4.2.6 - 2025-08-01 --- - CHANGE: 修正匹配器 diff --git a/VERSION b/VERSION index c30a815..0ce756d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.7 \ No newline at end of file +4.2.6 \ No newline at end of file diff --git a/go.mod b/go.mod index a267aaf..2635310 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/fenthope/record v0.0.4 github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 github.com/hashicorp/golang-lru/v2 v2.0.7 - github.com/infinite-iroha/touka v0.3.6 + github.com/infinite-iroha/touka v0.3.4 github.com/wjqserver/modembed v0.0.1 ) diff --git a/go.sum b/go.sum index d84ed19..f6f4f93 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 h1:iizUGZ9 github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/infinite-iroha/touka v0.3.6 h1:SkpM/VFGCWOFQP3RRuoWdX/Q4zafPngG1VMwkrLwtkw= -github.com/infinite-iroha/touka v0.3.6/go.mod h1:XW7a3fpLAjJfylSmdNuDQ8wGKkKmLVi9V/89sT1d7uw= +github.com/infinite-iroha/touka v0.3.4 h1:vYDjfXTkjpTe7tasSVbPeVAPSXzd/wS1T2tkiMx/Wwk= +github.com/infinite-iroha/touka v0.3.4/go.mod h1:xOKkEKTWYLHIBW6qbL2O6nSAO0RyDLsVXPtJxFYg/YM= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/wjqserver/modembed v0.0.1 h1:8ZDz7t9M5DLrUFlYgBUUmrMzxWsZPmHvOazkr/T2jEs= diff --git a/proxy/docker.go b/proxy/docker.go index 955f7e0..3287342 100644 --- a/proxy/docker.go +++ b/proxy/docker.go @@ -58,13 +58,7 @@ func GhcrWithImageRouting(cfg *config.Config) touka.HandlerFunc { if strings.Contains(reqTarget, ".") || strings.Contains(reqTarget, ":") { // 情况 A: reqTarget 是一个显式指定的主机名 (例如 "ghcr.io", "my-registry.com", "127.0.0.1:5000") c.Debugf("Request target '%s' identified as an explicit hostname.", reqTarget) - - // https://github.com/WJQSERVER-STUDIO/ghproxy/issues/159 - if reqTarget == "docker.io" { - upstreamTarget = dockerhubTarget - } else { - upstreamTarget = reqTarget - } + upstreamTarget = reqTarget // 上游请求的路径是主机名之后的部分 requestPath = fmt.Sprintf("%s/%s%s", reqImageUser, reqImageName, reqFilePath) // 用于认证的镜像名是 user/repo