add support for disabling git clone proxying

このコミットが含まれているのは:
Arya Kiran 2023-06-03 12:54:52 +08:00
コミット 30a0fd5b41
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 842D12BDA50DF120
1個のファイルの変更7行の追加2行の削除

ファイルの表示

@ -142,8 +142,13 @@ func Serve(port string) {
} }
}) })
app.Post("/:user/:repo/git-upload-pack", func(c *fiber.Ctx) error { app.Post("/:user/:repo/git-upload-pack", func(c *fiber.Ctx) error {
if proxying == "true" {
utils.ProxyRequest(c, "https://github.com/"+c.Params("user")+"/"+c.Params("repo")+".git/git-upload-pack") utils.ProxyRequest(c, "https://github.com/"+c.Params("user")+"/"+c.Params("repo")+".git/git-upload-pack")
return nil return nil
} else {
c.Redirect("https://github.com/" + c.Params("user") + "/" + c.Params("repo") + ".git/git-upload-pack")
return nil
}
}) })
app.Get("/:user/:repo/blob/:branch/+", pages.FileView) app.Get("/:user/:repo/blob/:branch/+", pages.FileView)
app.Get("/:user/:repo/tree/:branch/+", pages.DirView) app.Get("/:user/:repo/tree/:branch/+", pages.DirView)