forgejo-aneksajo_auto_patch.../data/47/new_aneksajo.diff
2025-01-23 01:26:39 +01:00

45 lines
1.6 KiB
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
> }
> }
>
533c547
< m.Methods("GET, POST, OPTIONS", "/userinfo", optionsCorsHandler(), ignSignInAndCsrf, auth.InfoOAuth)
---
> m.Methods("GET, OPTIONS", "/userinfo", optionsCorsHandler(), ignSignInAndCsrf, auth.InfoOAuth)
661c675
< m.Get("/search_candidates", ignExploreSignIn, user.SearchCandidates)
---
> m.Get("/search", ignExploreSignIn, user.Search)
957a972,974
> m.Group("", func() {
> m.Methods("GET,POST", "/git-annex-p2phttp/git-annex/{uuid}/*", repo.AnnexP2PHTTP)
> }, ignSignInAndCsrf, annexEnabled, annexP2PHTTPEnabled)
1149d1165
< m.Get("/summary-card", repo.DrawIssueSummaryCard)
1152d1167
< m.Get("/-/summary-card", repo.DrawRepoSummaryCard)
1302d1316
< m.Get("/summary-card/*", repo.DrawReleaseSummaryCard)
1571,1574d1584
< m.Group("/commit/{sha:([a-f0-9]{4,64})$}/notes", func() {
< m.Post("", web.Bind(forms.CommitNotesForm{}), repo.SetCommitNotes)
< m.Post("/remove", repo.RemoveCommitNotes)
< }, reqSignIn, reqRepoCodeWriter)
1636a1647,1652
>
> 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())