mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-01 14:56:30 +00:00
moved arch package routes to the same scope with other packages
This commit is contained in:
parent
b354f027ff
commit
af99efb0a0
@ -123,6 +123,10 @@ func CommonRoutes() *web.Route {
|
||||
})
|
||||
})
|
||||
}, reqPackageAccess(perm.AccessModeRead))
|
||||
r.Group("/arch", func() {
|
||||
r.Put("/push", arch.Push)
|
||||
r.Get("/{distro}/{arch}/{file}", arch.Get)
|
||||
})
|
||||
r.Group("/cargo", func() {
|
||||
r.Group("/api/v1/crates", func() {
|
||||
r.Get("", cargo.SearchPackages)
|
||||
@ -753,16 +757,3 @@ func ContainerRoutes() *web.Route {
|
||||
|
||||
return r
|
||||
}
|
||||
|
||||
// Routes for arch packages.
|
||||
func ArchRoutes() *web.Route {
|
||||
r := web.NewRoute()
|
||||
|
||||
r.Use(context.PackageContexter())
|
||||
|
||||
r.Put("/push", arch.Push)
|
||||
r.Get("/{distro}/{arch}/{owner}/{file}", arch.Get)
|
||||
r.Get("/{distro}/{arch}/{file}", arch.Get)
|
||||
|
||||
return r
|
||||
}
|
||||
|
@ -19,10 +19,10 @@ import (
|
||||
// Push new package to arch package registry.
|
||||
func Push(ctx *context.Context) {
|
||||
var (
|
||||
owner = ctx.Params("username")
|
||||
filename = ctx.Req.Header.Get("filename")
|
||||
email = ctx.Req.Header.Get("email")
|
||||
sign = ctx.Req.Header.Get("sign")
|
||||
owner = ctx.Req.Header.Get("owner")
|
||||
distro = ctx.Req.Header.Get("distro")
|
||||
)
|
||||
|
||||
|
@ -190,8 +190,6 @@ func NormalRoutes() *web.Route {
|
||||
r.Mount("/api/packages", packages_router.CommonRoutes())
|
||||
// This implements the OCI API (Note this is not preceded by /api but is instead /v2)
|
||||
r.Mount("/v2", packages_router.ContainerRoutes())
|
||||
// Arch package routes
|
||||
r.Mount("/api/packages/arch", packages_router.ArchRoutes())
|
||||
}
|
||||
|
||||
if setting.Actions.Enabled {
|
||||
|
Loading…
Reference in New Issue
Block a user