diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d07c91..cb0a95f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # 更新日志 +3.3.1 - 2025-05-16 +- CHANGE: 为`target`放宽限制, 支持自定义 +- CHANGE: 更新`hertz`, `0.9.7`=>`0.10.0` + +25w37a - 2025-05-16 +--- +- PRE-RELEASE: 此版本是v3.3.1预发布版本,请勿在生产环境中使用; +- CHANGE: 为`target`放宽限制, 支持自定义 +- CHANGE: 更新`hertz`, `0.9.7`=>`0.10.0` + 3.3.0 - 2025-05-15 --- - CHANGE: 为`httpc`加入`request builder`的`withcontext`选项 diff --git a/DEV-VERSION b/DEV-VERSION index c9f9483..cd31a95 100644 --- a/DEV-VERSION +++ b/DEV-VERSION @@ -1 +1 @@ -25w36d \ No newline at end of file +25w37a \ No newline at end of file diff --git a/VERSION b/VERSION index 0fa4ae4..712bd5a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.3.0 \ No newline at end of file +3.3.1 \ No newline at end of file diff --git a/go.mod b/go.mod index d20e90a..e798fb1 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/BurntSushi/toml v1.5.0 github.com/WJQSERVER-STUDIO/httpc v0.5.1 github.com/WJQSERVER-STUDIO/logger v1.6.0 - github.com/cloudwego/hertz v0.9.7 + github.com/cloudwego/hertz v0.10.0 github.com/hertz-contrib/http2 v0.1.8 golang.org/x/net v0.40.0 golang.org/x/time v0.11.0 diff --git a/go.sum b/go.sum index d906a16..68f4222 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,8 @@ github.com/cloudwego/base64x v0.1.5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCy github.com/cloudwego/base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= github.com/cloudwego/gopkg v0.1.4 h1:EoQiCG4sTonTPHxOGE0VlQs+sQR+Hsi2uN0qqwu8O50= github.com/cloudwego/gopkg v0.1.4/go.mod h1:FQuXsRWRsSqJLsMVd5SYzp8/Z1y5gXKnVvRrWUOsCMI= -github.com/cloudwego/hertz v0.9.7 h1:tAVaiO+vTf+ZkQhvNhKbDJ0hmC4oJ7bzwDi1KhvhHy4= -github.com/cloudwego/hertz v0.9.7/go.mod h1:t6d7NcoQxPmETvzPMMIVPHMn5C5QzpqIiFsaavoLJYQ= +github.com/cloudwego/hertz v0.10.0 h1:V0vmBaLdQPlgL6w2TA6PZL1g6SGgQznFx6vqxWdCcKw= +github.com/cloudwego/hertz v0.10.0/go.mod h1:lRBohmcDkGx5TLK6QKFGdzJ6n3IXqGueHsOiXcYgXA4= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cloudwego/netpoll v0.7.0 h1:bDrxQaNfijRI1zyGgXHQoE/nYegL0nr+ijO1Norelc4= github.com/cloudwego/netpoll v0.7.0/go.mod h1:PI+YrmyS7cIr0+SD4seJz3Eo3ckkXdu2ZVKBLhURLNU= diff --git a/proxy/docker.go b/proxy/docker.go index 696de84..cdfc743 100644 --- a/proxy/docker.go +++ b/proxy/docker.go @@ -18,10 +18,15 @@ func GhcrRouting(cfg *config.Config) app.HandlerFunc { GhcrRequest(ctx, c, "https://ghcr.io"+string(c.Request.RequestURI()), cfg, "ghcr") } else if cfg.Docker.Target == "dockerhub" { GhcrRequest(ctx, c, "https://registry-1.docker.io"+string(c.Request.RequestURI()), cfg, "dockerhub") + } else if cfg.Docker.Target != "" { + // 自定义taget + GhcrRequest(ctx, c, "https://"+cfg.Docker.Target+string(c.Request.RequestURI()), cfg, "custom") } else { - ErrorPage(c, NewErrorWithStatusLookup(403, "Docker Target is not Allowed")) + // 配置为空 + ErrorPage(c, NewErrorWithStatusLookup(403, "Docker Target is not set")) return } + } else { ErrorPage(c, NewErrorWithStatusLookup(403, "Docker is not Allowed")) return