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.
Identify accounts by their registered name
62576fa8157d431dcf2d360f3ebe481de77bda03 · Keenan Nemetz · 14d ago · parent 642e5994
Identify accounts by their registered name Drop the internal account id and display name. Users, keys, passkeys, invites, sessions, ACL entries, approvals, locks and CI records now all use the registered name as the single identity. The roster migrates in place: old id-keyed tables are rebuilt around the name, and access-rule/lock references are rewritten through the same mapping. Display-name editing and whoami --id are removed.
server/ssh/lfs.go +9−10
| @@ -16,7 +16,7 @@ import ( | |||
| 16 | 16 | // the same read rule the web and clone use — but resolved against the account | |
| 17 | 17 | // that owns the key, so a private repository's members can pull objects over | |
| 18 | 18 | // SSH while anonymous readers cannot. | |
| 19 | func (s *Server) serveLFS(ch xssh.Channel, req *xssh.Request, pathArg, op, user, accountID string) { | ||
| 19 | func (s *Server) serveLFS(ch xssh.Channel, req *xssh.Request, pathArg, op, user string) { | ||
| 20 | 20 | refuse := func(format string, args ...any) { | |
| 21 | 21 | req.Reply(true, nil) | |
| 22 | 22 | fmt.Fprintf(ch, "vole: "+format+"\n", args...) | |
| @@ -47,8 +47,8 @@ func (s *Server) serveLFS(ch xssh.Channel, req *xssh.Request, pathArg, op, user, | |||
| 47 | 47 | refuse("cannot read access rules for %s", name) | |
| 48 | 48 | return | |
| 49 | 49 | } | |
| 50 | role := a.RoleFor(accountID) | ||
| 51 | canRead := a.Can(accountID, access.Read) | ||
| 50 | role := a.RoleFor(user) | ||
| 51 | canRead := a.Can(user, access.Read) | ||
| 52 | 52 | canMaintain := role.AtLeast(access.Maintain) | |
| 53 | 53 | if op == "upload" && !canMaintain { | |
| 54 | 54 | s.cfg.Log.Warn("ssh: refused lfs upload", "user", user, "repo", name, "role", role) | |
| @@ -67,17 +67,16 @@ func (s *Server) serveLFS(ch xssh.Channel, req *xssh.Request, pathArg, op, user, | |||
| 67 | 67 | } | |
| 68 | 68 | start := time.Now() | |
| 69 | 69 | t := &lfs.Transfer{ | |
| 70 | Store: s.cfg.LFS, | ||
| 71 | Repo: name, | ||
| 72 | RepoID: m.ID, | ||
| 73 | AccountID: accountID, | ||
| 74 | CanRead: canRead, | ||
| 75 | CanWrite: canMaintain, | ||
| 70 | Store: s.cfg.LFS, | ||
| 71 | Repo: name, | ||
| 72 | RepoID: m.ID, | ||
| 73 | User: user, | ||
| 74 | CanRead: canRead, | ||
| 75 | CanWrite: canMaintain, | ||
| 76 | 76 | // Releasing somebody else's lock is an admin act, the same rule a force-push | |
| 77 | 77 | // follows: the alternative is a lock nobody can clear once its holder leaves. | |
| 78 | 78 | IsAdmin: role.AtLeast(access.Admin), | |
| 79 | 79 | Locks: s.cfg.Locks, | |
| 80 | Names: s.cfg.Identity.Name, | ||
| 81 | 80 | Log: s.cfg.Log, | |
| 82 | 81 | } | |
| 83 | 82 | serveErr := t.Serve(op, ch, ch) | |