mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
Compare commits
3 commits
e629b5db47
...
d4237f0463
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d4237f0463 | ||
|
|
eb3bf16e06 | ||
|
|
933aeee518 |
8 changed files with 34 additions and 24 deletions
|
|
@ -1,5 +1,14 @@
|
|||
# 更新日志
|
||||
|
||||
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
|
||||
---
|
||||
- ADD: 加入基于`basic auth`的docker鉴权支持
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
4.1.0-rc.0
|
||||
4.1.2-rc.0
|
||||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
4.1.0
|
||||
4.1.2
|
||||
|
|
@ -245,7 +245,7 @@ func DefaultConfig() *Config {
|
|||
},
|
||||
Pages: PagesConfig{
|
||||
Mode: "internal",
|
||||
Theme: "bootstrap",
|
||||
Theme: "hub",
|
||||
StaticDir: "/data/www",
|
||||
},
|
||||
Log: LogConfig{
|
||||
|
|
@ -272,7 +272,6 @@ func DefaultConfig() *Config {
|
|||
},
|
||||
RateLimit: RateLimitConfig{
|
||||
Enabled: false,
|
||||
//RateMethod: "total",
|
||||
RatePerMinute: 100,
|
||||
Burst: 10,
|
||||
BandwidthLimit: BandwidthLimitConfig{
|
||||
|
|
@ -289,7 +288,11 @@ func DefaultConfig() *Config {
|
|||
},
|
||||
Docker: DockerConfig{
|
||||
Enabled: false,
|
||||
Target: "ghcr",
|
||||
Target: "dockerhub",
|
||||
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/record v0.0.3
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7
|
||||
github.com/infinite-iroha/touka v0.2.5
|
||||
github.com/infinite-iroha/touka v0.2.6
|
||||
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/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.2.5 h1:x7lcKk0MIHGrPb9TMmgC+nG57G4SeFGflwrta2Lz3jo=
|
||||
github.com/infinite-iroha/touka v0.2.5/go.mod h1:2MBPtsM+5ClIZ/E1mPEKx1Rb+KIndTwZlIa2CwRPV7A=
|
||||
github.com/infinite-iroha/touka v0.2.6 h1:Y2zJTklfJZYO70jF9LPKq261IMt1vV8L1JBKUquQKIk=
|
||||
github.com/infinite-iroha/touka v0.2.6/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/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||
github.com/wjqserver/modembed v0.0.1 h1:8ZDz7t9M5DLrUFlYgBUUmrMzxWsZPmHvOazkr/T2jEs=
|
||||
|
|
|
|||
9
main.go
9
main.go
|
|
@ -414,7 +414,11 @@ func main() {
|
|||
proxy.RoutingHandler(cfg)(c)
|
||||
})
|
||||
|
||||
r.GET("/v2/", r.UseIf(cfg.Docker.Auth, bauth.BasicAuthForStatic(cfg.Docker.Credentials, "GHProxy Docker Proxy")), func(c *touka.Context) {
|
||||
r.GET("/v2/",
|
||||
r.UseIf(cfg.Docker.Auth, func() touka.HandlerFunc {
|
||||
return bauth.BasicAuthForStatic(cfg.Docker.Credentials, "GHProxy Docker Proxy")
|
||||
}),
|
||||
func(c *touka.Context) {
|
||||
emptyJSON := "{}"
|
||||
c.Header("Content-Type", "application/json")
|
||||
c.Header("Content-Length", fmt.Sprint(len(emptyJSON)))
|
||||
|
|
@ -423,7 +427,8 @@ func main() {
|
|||
|
||||
c.Status(200)
|
||||
c.Writer.Write([]byte(emptyJSON))
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
r.GET("/v2", func(c *touka.Context) {
|
||||
// 重定向到 /v2/
|
||||
|
|
|
|||
|
|
@ -17,13 +17,6 @@ func GitReq(ctx context.Context, c *touka.Context, u string, cfg *config.Config,
|
|||
resp *http.Response
|
||||
)
|
||||
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if resp != nil && resp.Body != nil {
|
||||
resp.Body.Close()
|
||||
}
|
||||
}()
|
||||
|
||||
/*
|
||||
fullBody, err := c.GetReqBodyFull()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue