26 lines
855 B
Diff
26 lines
855 B
Diff
358a359,372
|
|
> annexEnabled := func(ctx *context.Context) {
|
|
> if !setting.Annex.Enabled {
|
|
> ctx.Error(http.StatusNotFound)
|
|
> return
|
|
> }
|
|
> }
|
|
>
|
|
> annexP2PHTTPEnabled := func(ctx *context.Context) {
|
|
> if setting.Annex.DisableP2PHTTP {
|
|
> ctx.Error(http.StatusNotFound)
|
|
> return
|
|
> }
|
|
> }
|
|
>
|
|
957a972,974
|
|
> m.Group("", func() {
|
|
> m.Methods("GET,POST", "/git-annex-p2phttp/git-annex/{uuid}/*", repo.AnnexP2PHTTP)
|
|
> }, ignSignInAndCsrf, annexEnabled, annexP2PHTTPEnabled)
|
|
1636a1654,1659
|
|
>
|
|
> m.Group("", func() {
|
|
> // for git-annex
|
|
> m.Methods("GET,OPTIONS", "/config", repo.GetConfig) // needed by clients reading annex.uuid during `git annex initremote`
|
|
> m.Methods("GET,OPTIONS", "/annex/objects/{hash1}/{hash2}/{keyDir}/{key}", repo.GetAnnexObject)
|
|
> }, ignSignInAndCsrf, annexEnabled, context.UserAssignmentWeb())
|