Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Let instance admins read every repository

381d6aac38ab785d879fa82a6b8397ce6f543bab · Keenan Nemetz · 14d ago · parent 074ae160

Let instance admins read every repository

An instance administrator can already rewrite any repository's ACL, so hiding its content only hides what they govern. Raise them to at least read in the web and SSH paths, preserving any higher explicit role, and enforce the read rule on SSH upload-pack, where any authenticated key could previously clone a private repository by name. Anonymous HTTP clone still answers 404 because it carries no identity.

Group the admin surface into Repositories and Users tabs with a shared header, and teach Page.Section to mark the active tab.

server/web/web.go +8−4

@@ -185,8 +185,10 @@ func pageSection(path string) string {
185 185 return "runners"
186 186 case strings.HasPrefix(path, "/activity"):
187 187 return "activity"
188 case strings.HasPrefix(path, "/admin"):
189 return "admin"
188 case path == "/admin" || strings.HasPrefix(path, "/admin/repos"):
189 return "admin-repos"
190 case strings.HasPrefix(path, "/admin/users"):
191 return "admin-users"
190 192 case strings.HasPrefix(path, "/account"):
191 193 return "account"
192 194 }
@@ -195,7 +197,8 @@ func pageSection(path string) string {
195 197
196 198 // canRead reports whether the viewer may see the repository. An anonymous
197 199 // viewer is the empty principal, which is the same rule the git HTTP transport
198 // uses; a logged-in account gets its ACL role.
200 // uses; a logged-in account gets its ACL role, and an instance administrator may
201 // read anything they can already change the rules for.
199 202 func (w *Web) canRead(r *http.Request, m *repo.Meta) bool {
200 203 a, err := m.ACL()
201 204 if err != nil {
@@ -205,7 +208,8 @@ func (w *Web) canRead(r *http.Request, m *repo.Meta) bool {
205 208 if p := w.principal(r); p != nil {
206 209 name = p.account.Name
207 210 }
208 return a.Can(name, access.Read)
211 instanceAdmin := name != "" && w.Ident != nil && w.Ident.IsAdmin(name)
212 return a.EffectiveRole(name, instanceAdmin).AtLeast(access.Read)
209 213 }
210 214
211 215 // htmxRequest reports whether a request came from HTMX. The same handler still