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/ssh/server.go +20
| @@ -29,6 +29,7 @@ import ( | |||
| 29 | 29 | "github.com/rodent-software/vole/ci/runs" | |
| 30 | 30 | "github.com/rodent-software/vole/core/lfs" | |
| 31 | 31 | "github.com/rodent-software/vole/forge" | |
| 32 | "github.com/rodent-software/vole/forge/access" | ||
| 32 | 33 | "github.com/rodent-software/vole/forge/identity" | |
| 33 | 34 | "github.com/rodent-software/vole/forge/repo" | |
| 34 | 35 | ) | |
| @@ -279,6 +280,25 @@ func (s *Server) exec(ch xssh.Channel, req *xssh.Request, command, user, fp, rem | |||
| 279 | 280 | refuse("repository %q not found", name) | |
| 280 | 281 | return | |
| 281 | 282 | } | |
| 283 | // Fetching runs the same read rule as the web and HTTP transports. Without | ||
| 284 | // this check any authenticated key could clone a private repository just by | ||
| 285 | // naming it; with it, an instance administrator still may, because they can | ||
| 286 | // already rewrite its rules. | ||
| 287 | if verb == "git-upload-pack" { | ||
| 288 | a, err := m.ACL() | ||
| 289 | if err != nil { | ||
| 290 | refuse("cannot read access rules for %s", name) | ||
| 291 | return | ||
| 292 | } | ||
| 293 | role := a.EffectiveRole(user, s.cfg.Identity.IsAdmin(user)) | ||
| 294 | if !role.AtLeast(access.Read) { | ||
| 295 | s.cfg.Log.Warn("ssh: refused read", "user", user, "repo", name, "role", role) | ||
| 296 | // The same shape as a missing repository: do not confirm that a | ||
| 297 | // private repository exists. | ||
| 298 | refuse("repository %q not found", name) | ||
| 299 | return | ||
| 300 | } | ||
| 301 | } | ||
| 282 | 302 | if err := req.Reply(true, nil); err != nil { | |
| 283 | 303 | return | |
| 284 | 304 | } | |