mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 16:21:11 +08:00
Compare commits
No commits in common. "d4237f0463dd16c3f7099b279d4a0512585ff1f1" and "e629b5db47a3f484baa71fb12c9bddfe475d9702" have entirely different histories.
d4237f0463
...
e629b5db47
8 changed files with 24 additions and 34 deletions
|
|
@ -1,14 +1,5 @@
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
4.1.2-rc.0 - 2025-06-17
|
|
||||||
---
|
|
||||||
- PRE-RELEASE: 此版本是v4.1.2预发布版本,请勿在生产环境中使用;
|
|
||||||
- CHANGE: 更新`design`主题, 更新默认配置生成
|
|
||||||
|
|
||||||
4.1.1 - 2025-06-18
|
|
||||||
---
|
|
||||||
- CHANGE: 更新touka框架到v0.2.6, 解决MidwareX的一些状态问题
|
|
||||||
|
|
||||||
4.1.0 - 2025-06-17
|
4.1.0 - 2025-06-17
|
||||||
---
|
---
|
||||||
- ADD: 加入基于`basic auth`的docker鉴权支持
|
- ADD: 加入基于`basic auth`的docker鉴权支持
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
4.1.2-rc.0
|
4.1.0-rc.0
|
||||||
|
|
|
||||||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
4.1.2
|
4.1.0
|
||||||
|
|
@ -245,7 +245,7 @@ func DefaultConfig() *Config {
|
||||||
},
|
},
|
||||||
Pages: PagesConfig{
|
Pages: PagesConfig{
|
||||||
Mode: "internal",
|
Mode: "internal",
|
||||||
Theme: "hub",
|
Theme: "bootstrap",
|
||||||
StaticDir: "/data/www",
|
StaticDir: "/data/www",
|
||||||
},
|
},
|
||||||
Log: LogConfig{
|
Log: LogConfig{
|
||||||
|
|
@ -272,6 +272,7 @@ func DefaultConfig() *Config {
|
||||||
},
|
},
|
||||||
RateLimit: RateLimitConfig{
|
RateLimit: RateLimitConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
|
//RateMethod: "total",
|
||||||
RatePerMinute: 100,
|
RatePerMinute: 100,
|
||||||
Burst: 10,
|
Burst: 10,
|
||||||
BandwidthLimit: BandwidthLimitConfig{
|
BandwidthLimit: BandwidthLimitConfig{
|
||||||
|
|
@ -288,11 +289,7 @@ func DefaultConfig() *Config {
|
||||||
},
|
},
|
||||||
Docker: DockerConfig{
|
Docker: DockerConfig{
|
||||||
Enabled: false,
|
Enabled: false,
|
||||||
Target: "dockerhub",
|
Target: "ghcr",
|
||||||
Auth: false,
|
|
||||||
Credentials: map[string]string{
|
|
||||||
"testpass": "test123",
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -16,7 +16,7 @@ require (
|
||||||
github.com/fenthope/reco v0.0.3
|
github.com/fenthope/reco v0.0.3
|
||||||
github.com/fenthope/record v0.0.3
|
github.com/fenthope/record v0.0.3
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||||
github.com/infinite-iroha/touka v0.2.6
|
github.com/infinite-iroha/touka v0.2.5
|
||||||
github.com/wjqserver/modembed v0.0.1
|
github.com/wjqserver/modembed v0.0.1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
4
go.sum
4
go.sum
|
|
@ -18,8 +18,8 @@ github.com/go-json-experiment/json v0.0.0-20250517221953-25912455fbc8 h1:o8UqXPI
|
||||||
github.com/go-json-experiment/json v0.0.0-20250517221953-25912455fbc8/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M=
|
github.com/go-json-experiment/json v0.0.0-20250517221953-25912455fbc8/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 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
|
||||||
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
|
||||||
github.com/infinite-iroha/touka v0.2.6 h1:Y2zJTklfJZYO70jF9LPKq261IMt1vV8L1JBKUquQKIk=
|
github.com/infinite-iroha/touka v0.2.5 h1:x7lcKk0MIHGrPb9TMmgC+nG57G4SeFGflwrta2Lz3jo=
|
||||||
github.com/infinite-iroha/touka v0.2.6/go.mod h1:2MBPtsM+5ClIZ/E1mPEKx1Rb+KIndTwZlIa2CwRPV7A=
|
github.com/infinite-iroha/touka v0.2.5/go.mod h1:2MBPtsM+5ClIZ/E1mPEKx1Rb+KIndTwZlIa2CwRPV7A=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
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/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
github.com/wjqserver/modembed v0.0.1 h1:8ZDz7t9M5DLrUFlYgBUUmrMzxWsZPmHvOazkr/T2jEs=
|
github.com/wjqserver/modembed v0.0.1 h1:8ZDz7t9M5DLrUFlYgBUUmrMzxWsZPmHvOazkr/T2jEs=
|
||||||
|
|
|
||||||
9
main.go
9
main.go
|
|
@ -414,11 +414,7 @@ func main() {
|
||||||
proxy.RoutingHandler(cfg)(c)
|
proxy.RoutingHandler(cfg)(c)
|
||||||
})
|
})
|
||||||
|
|
||||||
r.GET("/v2/",
|
r.GET("/v2/", r.UseIf(cfg.Docker.Auth, bauth.BasicAuthForStatic(cfg.Docker.Credentials, "GHProxy Docker Proxy")), func(c *touka.Context) {
|
||||||
r.UseIf(cfg.Docker.Auth, func() touka.HandlerFunc {
|
|
||||||
return bauth.BasicAuthForStatic(cfg.Docker.Credentials, "GHProxy Docker Proxy")
|
|
||||||
}),
|
|
||||||
func(c *touka.Context) {
|
|
||||||
emptyJSON := "{}"
|
emptyJSON := "{}"
|
||||||
c.Header("Content-Type", "application/json")
|
c.Header("Content-Type", "application/json")
|
||||||
c.Header("Content-Length", fmt.Sprint(len(emptyJSON)))
|
c.Header("Content-Length", fmt.Sprint(len(emptyJSON)))
|
||||||
|
|
@ -427,8 +423,7 @@ func main() {
|
||||||
|
|
||||||
c.Status(200)
|
c.Status(200)
|
||||||
c.Writer.Write([]byte(emptyJSON))
|
c.Writer.Write([]byte(emptyJSON))
|
||||||
},
|
})
|
||||||
)
|
|
||||||
|
|
||||||
r.GET("/v2", func(c *touka.Context) {
|
r.GET("/v2", func(c *touka.Context) {
|
||||||
// 重定向到 /v2/
|
// 重定向到 /v2/
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,13 @@ func GitReq(ctx context.Context, c *touka.Context, u string, cfg *config.Config,
|
||||||
resp *http.Response
|
resp *http.Response
|
||||||
)
|
)
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
<-ctx.Done()
|
||||||
|
if resp != nil && resp.Body != nil {
|
||||||
|
resp.Body.Close()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
fullBody, err := c.GetReqBodyFull()
|
fullBody, err := c.GetReqBodyFull()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue