This commit is contained in:
wjqserver
2025-08-04 12:12:32 +08:00
parent 97ee25b65d
commit 8dca51b897
5 changed files with 16 additions and 5 deletions

View File

@@ -1,5 +1,10 @@
# 更新日志
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: 修正匹配器

View File

@@ -1 +1 @@
4.2.6
4.2.7

2
go.mod
View File

@@ -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.4
github.com/infinite-iroha/touka v0.3.6
github.com/wjqserver/modembed v0.0.1
)

4
go.sum
View File

@@ -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.4 h1:vYDjfXTkjpTe7tasSVbPeVAPSXzd/wS1T2tkiMx/Wwk=
github.com/infinite-iroha/touka v0.3.4/go.mod h1:xOKkEKTWYLHIBW6qbL2O6nSAO0RyDLsVXPtJxFYg/YM=
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/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=

View File

@@ -58,7 +58,13 @@ 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
}
// 上游请求的路径是主机名之后的部分
requestPath = fmt.Sprintf("%s/%s%s", reqImageUser, reqImageName, reqFilePath)
// 用于认证的镜像名是 user/repo