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.

Serve repositories from the root of the URL space

ed03b3d1fa16ef6b55e2773aaf10e3be13282c3a · Keenan Nemetz · 5h 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/status.html +6−6

@@ -47,7 +47,7 @@
47 47 </tbody>
48 48 </table>
49 49 </div>
50 <p class="muted"><a href="/admin?tab=audit">Read the full audit log</a></p>
50 <p class="muted"><a href="/-/admin?tab=audit">Read the full audit log</a></p>
51 51 {{else if not .RecentAudit.Err}}
52 52 <div class="empty-state"><p>No privileged actions have been recorded yet.</p></div>
53 53 {{end}}
@@ -67,7 +67,7 @@
67 67 </tbody>
68 68 </table>
69 69 </div>
70 <p class="muted"><a href="/admin?tab=configuration">See every effective setting</a></p>
70 <p class="muted"><a href="/-/admin?tab=configuration">See every effective setting</a></p>
71 71 {{end}}
72 72
73 73 <h2>Page views</h2>
@@ -140,7 +140,7 @@
140 140 <tr>
141 141 <td>{{.Account}}</td>
142 142 <td class="muted">{{if .Labels}}{{.Labels}}{{else}}any job{{end}}</td>
143 <td>{{if .Idle}}<span class="muted">waiting for work</span>{{else if .RunID}}<a href="/r/{{.Repo}}/runs/{{.RunID}}">{{.Job}}</a> on <a href="/r/{{.Repo}}">{{.Repo}}</a>{{else}}<span class="muted">busy</span>{{end}}</td>
143 <td>{{if .Idle}}<span class="muted">waiting for work</span>{{else if .RunID}}<a href="/{{.Repo}}/runs/{{.RunID}}">{{.Job}}</a> on <a href="/{{.Repo}}">{{.Repo}}</a>{{else}}<span class="muted">busy</span>{{end}}</td>
144 144 <td class="muted">{{since .Seen.Unix}}</td>
145 145 </tr>
146 146 {{end}}
@@ -161,7 +161,7 @@
161 161 <tbody>
162 162 {{range .RunnerQueue}}
163 163 <tr>
164 <td><a href="/r/{{.Name}}">{{.Name}}</a></td>
164 <td><a href="/{{.Name}}">{{.Name}}</a></td>
165 165 <td class="muted">{{.Queued}}</td>
166 166 <td class="muted">{{.Running}}{{if .Cap}}{{if ge .Running .Cap}} of {{.Cap}} <span class="muted">(at the cap)</span>{{else}} of {{.Cap}}{{end}}{{end}}</td>
167 167 </tr>
@@ -189,7 +189,7 @@ Clone it with <code>{{.InstanceRepo.CloneURL}}</code>.</p>
189 189 {{else}}
190 190 <p class="muted">The instance repository <code>{{.InstanceRepo.Name}}</code> does not exist yet.</p>
191 191 {{end}}
192 <form method="post" action="/admin/instance/repo" class="form-block">
192 <form method="post" action="/-/admin/instance/repo" class="form-block">
193 193 <input type="hidden" name="csrf" value="{{.CSRF}}">
194 194 <div class="form-actions"><button type="submit">{{icon "plus"}}Create instance repository</button></div>
195 195 </form>
@@ -204,7 +204,7 @@ Clone it with <code>{{.InstanceRepo.CloneURL}}</code>.</p>
204 204 <tr><td><code>profile/custom.css</code></td><td>Instance-wide stylesheet, loaded after the built-in ones and any theme</td></tr>
205 205 <tr><td><code>profile/themes/&lt;id&gt;.css</code></td><td>One stylesheet per theme; the file name is its label in Account → Appearance</td></tr>
206 206 <tr><td><code>profile/favicon.svg</code></td><td>Favicon override</td></tr>
207 <tr><td><code>assets/</code></td><td>Files served at <code>/static/custom/assets/</code></td></tr>
207 <tr><td><code>assets/</code></td><td>Files served at <code>/-/static/custom/assets/</code></td></tr>
208 208 </tbody>
209 209 </table>
210 210 </div>