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/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software:2222/vole.git

A free and open-source forge that lives in your Git repo.

Serve repositories from the root of the URL space

ed03b3d1fa16ef6b55e2773aaf10e3be13282c3a · Keenan Nemetz · 9h ago · parent d37d301f

Serve repositories from the root of the URL space

A repository is now /<name> and its Git transport /<name>.git, so the URL a
person opens, the URL a clone uses, and the Go module path are the same name.
The forge's own pages moved under /-/ (admin, accounts, the directory, the
feed, sign-in, assets), a prefix no repository name can start with: names are
[a-z0-9...] and cannot begin with "-". That leaves the router with two disjoint
spaces and removes the /r/ and /git/ prefixes, which existed only to keep
repositories away from the forge's own paths.

Routes: repoRoutes lose /r/; global, auth and admin routes gain /-/; assets
move to /-/static/ because a subtree pattern like /static/ cannot coexist with
one-segment-wildcard repo routes — Go's mux reports them as conflicting
neither-more-specific patterns. The catch-all still renders the styled 404.

Transport: githttp.Route parses /<name>.git/<rest> instead of a /git/ prefix,
and forgepaths.go hands such requests to the proxy before the mux, because a
wildcard fills a whole segment and cannot match "<name>.git". LFS stays on the
mux (<name>.git/info/lfs/...), and the Go module discovery probe moves to the
same pre-router so a package path under a public repository is answered even
when its first segments name a page tab.

Names: repo.ValidateName now refuses the four root paths the forge must keep —
static, robots.txt, sitemap.xml, sitemap-pages.xml. Everything else is an
ordinary repository name, including admin, u, and activity.

Docs and the packaged URLs follow the new layout; robots.txt, the sitemaps and
the instance activity feed point at the new paths. No aliases: the old /r/ and
/git/ URLs are gone.

Verified with ./vole workflow check and ./vole workflow run verify.

server/web/templates/releases.html +10−10

@@ -7,7 +7,7 @@
7 7 <h1>Releases</h1>
8 8 <p class="page-sub">{{if .Tags}}{{len .Tags}} tag(s){{if .Lightweight}} · {{.Lightweight}} lightweight{{end}}{{else}}Tags with notes, artifacts, and archives.{{end}}</p>
9 9 </div>
10 {{if .CanManage}}<div class="page-head-actions"><a class="button" href="/r/{{.Name}}/releases/new">{{icon "plus"}}New release</a></div>{{end}}
10 {{if .CanManage}}<div class="page-head-actions"><a class="button" href="/{{.Name}}/releases/new">{{icon "plus"}}New release</a></div>{{end}}
11 11 </div>
12 12
13 13 {{if .Tags}}
@@ -16,12 +16,12 @@
16 16 <tr><th>Tag</th><th>Notes</th><th>Tagger</th><th>Age</th><th>Source</th>{{if .CanManage}}<th></th>{{end}}</tr>
17 17 {{range .Tags}}
18 18 <tr>
19 <td><a href="/r/{{$.Name}}/releases/{{esc .Name}}">{{.Name}}</a>{{if not .Annotated}} <span class="label">lightweight</span>{{end}}</td>
19 <td><a href="/{{$.Name}}/releases/{{esc .Name}}">{{.Name}}</a>{{if not .Annotated}} <span class="label">lightweight</span>{{end}}</td>
20 20 <td class="muted">{{.Subject}}</td>
21 21 <td class="muted">{{if .Tagger}}{{.Tagger}}{{else}}—{{end}}</td>
22 22 <td class="muted">{{since .When}}</td>
23 <td><a href="/r/{{$.Name}}/releases/{{esc .Name}}/archive.tar">tar</a> · <a href="/r/{{$.Name}}/releases/{{esc .Name}}/archive.tar.gz">tar.gz</a></td>
24 {{if $.CanManage}}<td>{{if .Annotated}}<a href="/r/{{$.Name}}/releases/edit?tag={{urlquery .Name}}">edit notes</a>{{end}}</td>{{end}}
23 <td><a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar">tar</a> · <a href="/{{$.Name}}/releases/{{esc .Name}}/archive.tar.gz">tar.gz</a></td>
24 {{if $.CanManage}}<td>{{if .Annotated}}<a href="/{{$.Name}}/releases/edit?tag={{urlquery .Name}}">edit notes</a>{{end}}</td>{{end}}
25 25 </tr>
26 26 {{end}}
27 27 </table>
@@ -50,10 +50,10 @@ records a tagger and a message, which is what makes a tag a release.</p>
50 50 {{if .Tag.Annotated}}annotated tag{{else}}lightweight tag{{end}}
51 51 {{if .Tag.Tagger}}by {{.Tag.Tagger}}{{end}}
52 52 · {{since .Tag.When}}
53 · commit <a class="sha" href="/r/{{.Name}}/commit/{{.Tag.Commit}}">{{short .Tag.Commit}}</a>
53 · commit <a class="sha" href="/{{.Name}}/commit/{{.Tag.Commit}}">{{short .Tag.Commit}}</a>
54 54 </p>
55 55 </div>
56 {{if .CanEdit}}<div class="page-head-actions"><a class="button secondary" href="/r/{{.Name}}/releases/edit?tag={{urlquery .Tag.Name}}">{{icon "sliders-horizontal"}}Edit notes</a></div>{{end}}
56 {{if .CanEdit}}<div class="page-head-actions"><a class="button secondary" href="/{{.Name}}/releases/edit?tag={{urlquery .Tag.Name}}">{{icon "sliders-horizontal"}}Edit notes</a></div>{{end}}
57 57 </div>
58 58
59 59 {{if .Notes}}
@@ -71,10 +71,10 @@ records a tagger and a message, which is what makes a tag a release.</p>
71 71 <tr><th>File</th><th>Size</th><th>SHA-256</th><th></th></tr>
72 72 {{range .Artifacts}}
73 73 <tr>
74 <td><a href="/r/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">{{.Name}}</a></td>
74 <td><a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">{{.Name}}</a></td>
75 75 <td class="muted">{{.Size}}</td>
76 76 <td class="muted"><code>{{short .OID}}</code></td>
77 <td><a href="/r/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">download</a></td>
77 <td><a href="/{{$.Name}}/releases/{{esc $.Tag.Name}}/artifacts/{{.Name}}">download</a></td>
78 78 </tr>
79 79 {{end}}
80 80 </table>
@@ -88,8 +88,8 @@ records a tagger and a message, which is what makes a tag a release.</p>
88 88
89 89 <div class="card">
90 90 <h2>Source</h2>
91 <p><a href="/r/{{.Name}}/releases/{{esc .Tag.Name}}/archive.tar">Download .tar</a>
92 · <a href="/r/{{.Name}}/releases/{{esc .Tag.Name}}/archive.tar.gz">Download .tar.gz</a></p>
91 <p><a href="/{{.Name}}/releases/{{esc .Tag.Name}}/archive.tar">Download .tar</a>
92 · <a href="/{{.Name}}/releases/{{esc .Tag.Name}}/archive.tar.gz">Download .tar.gz</a></p>
93 93 <p class="muted">Generated from the tag when you ask for it, not stored — the same bytes on
94 94 every request, so a cached copy cannot go stale.</p>
95 95 {{if .LFSPointers}}<p class="muted">This repository tracks files with Git LFS: those files appear