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.

Phase 2, first slice: issues as files on a branch

37c01e5aa9b98bbea8567e741cd3af508ae1ba7d · Keenan Nemetz · 17d 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.

go.mod +5

@@ -9,11 +9,16 @@ require (
9 9 )
10 10
11 11 require (
12 github.com/aymerick/douceur v0.2.0 // indirect
12 13 github.com/dustin/go-humanize v1.1.0 // indirect
13 14 github.com/google/uuid v1.6.0 // indirect
15 github.com/gorilla/css v1.0.1 // indirect
14 16 github.com/mattn/go-isatty v0.0.24 // indirect
17 github.com/microcosm-cc/bluemonday v1.0.27 // indirect
15 18 github.com/ncruces/go-strftime v1.1.0 // indirect
16 19 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
20 github.com/yuin/goldmark v1.8.6 // indirect
21 golang.org/x/net v0.60.0 // indirect
17 22 golang.org/x/sys v0.49.0 // indirect
18 23 modernc.org/libc v1.79.0 // indirect
19 24 modernc.org/mathutil v1.7.1 // indirect