mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
25w44a
This commit is contained in:
parent
1370617f5b
commit
6be6e1ba2c
14 changed files with 49 additions and 60 deletions
|
|
@ -35,35 +35,6 @@ func InitWeakCache() *weakcache.Cache[string] {
|
|||
return cache
|
||||
}
|
||||
|
||||
/*
|
||||
func GhcrRouting(cfg *config.Config) app.HandlerFunc {
|
||||
return func(ctx context.Context, c *app.RequestContext) {
|
||||
|
||||
charToFind := '.'
|
||||
reqTarget := c.Param("target")
|
||||
path := ""
|
||||
target := ""
|
||||
|
||||
if strings.ContainsRune(reqTarget, charToFind) {
|
||||
|
||||
path = c.Param("filepath")
|
||||
if reqTarget == "docker.io" {
|
||||
target = dockerhubTarget
|
||||
} else if reqTarget == "ghcr.io" {
|
||||
target = ghcrTarget
|
||||
} else {
|
||||
target = reqTarget
|
||||
}
|
||||
} else {
|
||||
path = string(c.Request.RequestURI())
|
||||
}
|
||||
|
||||
GhcrToTarget(ctx, c, cfg, target, path, nil)
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
func GhcrWithImageRouting(cfg *config.Config) app.HandlerFunc {
|
||||
return func(ctx context.Context, c *app.RequestContext) {
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ import (
|
|||
)
|
||||
|
||||
func listCheck(cfg *config.Config, c *app.RequestContext, user string, repo string, rawPath string) bool {
|
||||
|
||||
if cfg.Auth.ForceAllowApi && cfg.Auth.ForceAllowApiPassList {
|
||||
return false
|
||||
}
|
||||
// 白名单检查
|
||||
if cfg.Whitelist.Enabled {
|
||||
whitelist := auth.CheckWhitelist(user, repo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue