vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Replace the runner allowlist with a runner role
648cd81bde97042f682a528ebb9ce6353b95bf3f · Keenan Nemetz · 1d ago · parent ea92d754
server/ssh/lfs.go +8−8
| @@ -10,10 +10,10 @@ import ( | |||
| 10 | 10 | ) | |
| 11 | 11 | ||
| 12 | 12 | // serveLFS runs a git-lfs transfer session: `ssh host git-lfs-transfer <repo> | |
| 13 | // upload|download`. Uploads require maintain access to the repository, downloads | ||
| 14 | // the same read rule the web and clone use — but resolved against the account | ||
| 15 | // that owns the key, so a private repository's members can pull objects over | ||
| 16 | // SSH while anonymous readers cannot. | ||
| 13 | // upload|download`. Uploads require the runner role, which is how a job publishes | ||
| 14 | // its declared artifacts; downloads use the same read rule the web and clone use — | ||
| 15 | // but resolved against the account that owns the key, so a private repository's | ||
| 16 | // members can pull objects over SSH while anonymous readers cannot. | ||
| 17 | 17 | func (s *Server) serveLFS(ch Session, pathArg, op, user string) { | |
| 18 | 18 | refuse := func(format string, args ...any) { | |
| 19 | 19 | ch.Accept() | |
| @@ -47,10 +47,10 @@ func (s *Server) serveLFS(ch Session, pathArg, op, user string) { | |||
| 47 | 47 | } | |
| 48 | 48 | role := a.EffectiveRole(user, s.cfg.Identity.IsAdmin(user)) | |
| 49 | 49 | canRead := role.AtLeast(access.Read) | |
| 50 | canMaintain := role.AtLeast(access.Maintain) | ||
| 51 | if op == "upload" && !canMaintain { | ||
| 50 | canWrite := role.AtLeast(access.Runner) | ||
| 51 | if op == "upload" && !canWrite { | ||
| 52 | 52 | s.cfg.Log.Warn("ssh: refused lfs upload", "user", user, "repo", name, "role", role) | |
| 53 | refuse("%s does not have maintain access to %s (role: %s)", user, name, role) | ||
| 53 | refuse("%s does not have runner or maintain access to %s (role: %s)", user, name, role) | ||
| 54 | 54 | return | |
| 55 | 55 | } | |
| 56 | 56 | if op == "download" && !canRead { | |
| @@ -70,7 +70,7 @@ func (s *Server) serveLFS(ch Session, pathArg, op, user string) { | |||
| 70 | 70 | RepoID: m.ID, | |
| 71 | 71 | User: user, | |
| 72 | 72 | CanRead: canRead, | |
| 73 | CanWrite: canMaintain, | ||
| 73 | CanWrite: canWrite, | ||
| 74 | 74 | // Releasing somebody else's lock is an admin act, the same rule a force-push | |
| 75 | 75 | // follows: the alternative is a lock nobody can clear once its holder leaves. | |
| 76 | 76 | IsAdmin: role.AtLeast(access.Admin), | |