增加镜像搜索功能

This commit is contained in:
NewName
2025-05-20 15:40:57 +08:00
parent c97faffb27
commit ef69112af1
5 changed files with 521 additions and 14 deletions

View File

@@ -71,7 +71,7 @@ func main() {
}
}()
// 初始化Skopeo相关路由 - 必须在任何通配符路由之前注册
// 初始化Skopeo相关路由 - 在任何通配符路由之前注册
initSkopeoRoutes(router)
// 单独处理根路径请求,避免冲突
@@ -82,7 +82,7 @@ func main() {
// 指定具体的静态文件路径,避免使用通配符
router.Static("/public", "./public")
// 对于.html等特定文件也直接注册
// 对于.html等特定文件注册
router.GET("/skopeo.html", func(c *gin.Context) {
c.File("./public/skopeo.html")
})
@@ -95,7 +95,8 @@ func main() {
router.GET("/bj.svg", func(c *gin.Context) {
c.File("./public/bj.svg")
})
// 注册dockerhub搜索路由
dockerhub.RegisterSearchRoute(router)
// 创建GitHub文件下载专用的限流器
githubLimiter := NewIPRateLimiter()