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.
Phase 2, first slice: issues as files on a branch
37c01e5aa9b98bbea8567e741cd3af508ae1ba7d · Keenan Nemetz · 18d ago · parent 197ecaa2
Phase 2, first slice: issues as files on a branch Push-based issues, per the decision to keep the web read-only. The format is the contract; nothing here requires a Vole binary on a contributor's machine. issues/<ulid>/meta.json issues/<ulid>/description.md issues/<ulid>/comments/<ulid>.md on refs/heads/issues Design points worth recording: - IDs are ULIDs generated by the writer, so there is no server-assigned counter, no contention, and no ID allocation in the write path at all. - Issues live on a branch rather than a custom ref, so a plain `git clone` carries them. That is the same lesson that moved the user roster off refs/vole/users: `git clone` only mirrors refs/heads/*. - File-per-comment means two people replying to the same issue never touch the same file, so the only merge conflict is two edits to one comment. - Validation happens in pre-receive, so a malformed tree never reaches the web. Every problem is reported at once with the offending path, and a rejected push leaves the branch unmoved. The index gained issue rows, refreshed when the issues ref moves rather than by a hook, plus coverage in the full rebuild. The list page reads the index; the detail page reads git, so bodies and comments are never stale. Markdown is rendered with goldmark and sanitised with bluemonday. Issue bodies arrive by push, which makes them untrusted input on a public page; a test asserts that <script> and javascript: URLs do not survive. Verified by hand with a user who has an editor and a key: filed an issue, added a comment, saw both rendered, then pushed an issue with no title and got back "issues/01M5.../meta.json: title is required" with the branch unmoved.
internal/web/web.go +6
| @@ -126,6 +126,10 @@ func (w *Web) Repo(rw http.ResponseWriter, r *http.Request) { | |||
| 126 | 126 | commits, _ = g.Log(commit, 10) | |
| 127 | 127 | count, _ = g.CountCommits(commit) | |
| 128 | 128 | } | |
| 129 | issueCount := 0 | ||
| 130 | if err := w.Index.EnsureIssues(m); err == nil { | ||
| 131 | issueCount, _ = w.Index.IssueCount(m.ID) | ||
| 132 | } | ||
| 129 | 133 | branches, _ := g.ListRefs("refs/heads/") | |
| 130 | 134 | names := make([]string, 0, len(branches)) | |
| 131 | 135 | for k := range branches { | |
| @@ -143,6 +147,7 @@ func (w *Web) Repo(rw http.ResponseWriter, r *http.Request) { | |||
| 143 | 147 | Commit string | |
| 144 | 148 | Count int | |
| 145 | 149 | Branches []string | |
| 150 | IssueCount int | ||
| 146 | 151 | }{ | |
| 147 | 152 | Page: w.base(m.Name), | |
| 148 | 153 | Name: m.Name, | |
| @@ -155,6 +160,7 @@ func (w *Web) Repo(rw http.ResponseWriter, r *http.Request) { | |||
| 155 | 160 | Commit: commit, | |
| 156 | 161 | Count: count, | |
| 157 | 162 | Branches: names, | |
| 163 | IssueCount: issueCount, | ||
| 158 | 164 | }, 0) | |
| 159 | 165 | } | |
| 160 | 166 | ||