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/home.html +10−10

@@ -5,10 +5,10 @@
5 5 <h1>{{.InstanceName}}</h1>
6 6 </div>
7 7 <div class="hero-actions">
8 {{if and .InstanceAdmin .Cards}}<a class="button" href="/repos/new">{{icon "plus"}}New repository</a>{{end}}
8 {{if and .InstanceAdmin .Cards}}<a class="button" href="/-/repos/new">{{icon "plus"}}New repository</a>{{end}}
9 9 {{if not .LoggedIn}}
10 <a class="button secondary" href="/login">{{icon "user"}}Sign in</a>
11 {{if .OpenRegistration}}<a class="button secondary" href="/register">{{icon "user"}}Create an account</a>{{end}}
10 <a class="button secondary" href="/-/login">{{icon "user"}}Sign in</a>
11 {{if .OpenRegistration}}<a class="button secondary" href="/-/register">{{icon "user"}}Create an account</a>{{end}}
12 12 {{end}}
13 13 </div>
14 14 </section>
@@ -32,7 +32,7 @@
32 32 <aside class="home-rail">
33 33 <div class="section-head">
34 34 <h2>Latest</h2>
35 <a class="more" href="/activity">all activity</a>
35 <a class="more" href="/-/activity">all activity</a>
36 36 </div>
37 37 {{if .Events}}
38 38 {{template "activity_events" .}}
@@ -53,7 +53,7 @@
53 53 <span class="empty-icon" aria-hidden="true">{{icon "folder"}}</span>
54 54 <h2>No repositories yet</h2>
55 55 <p class="muted">A repository is where code, issues, changes, and runs live. Create the first one to get started.</p>
56 <p class="empty-actions"><a class="button" href="/repos/new">{{icon "plus"}}New repository</a></p>
56 <p class="empty-actions"><a class="button" href="/-/repos/new">{{icon "plus"}}New repository</a></p>
57 57 <p class="empty-hint">Or from the instance directory: <code>vole admin repo create demo --owner {{if .User}}{{.User}}{{else}}you{{end}}</code></p>
58 58 </div>
59 59 {{else if .LoggedIn}}
@@ -77,7 +77,7 @@
77 77 </section>
78 78 {{else if and .InstanceAdmin (not .RepoReady)}}
79 79 <p class="readme-empty">This instance has no repository for customization yet. Create it on the
80 <a href="/admin?tab=configuration">Admin Configuration</a> page to customize this introduction, the styles, and the assets.</p>
80 <a href="/-/admin?tab=configuration">Admin Configuration</a> page to customize this introduction, the styles, and the assets.</p>
81 81 {{end}}
82 82 {{end}}
83 83
@@ -85,16 +85,16 @@
85 85 <article class="repo-card">
86 86 <div class="repo-card-top">
87 87 <span class="repo-vis" title="{{if .Private}}Private repository{{else}}Public repository{{end}}">{{if .Private}}{{icon "lock"}}{{else}}{{icon "globe"}}{{end}}</span>
88 <h3><a href="/r/{{.Name}}" title="{{if .Private}}Private repository{{else}}Public repository{{end}}">{{.Name}}</a></h3>
88 <h3><a href="/{{.Name}}" title="{{if .Private}}Private repository{{else}}Public repository{{end}}">{{.Name}}</a></h3>
89 89 {{if .Language}}<span class="repo-lang"><span class="lang-dot {{.LangClass}}" aria-hidden="true"></span>{{.Language}}</span>{{end}}
90 90 {{if not .Updated.IsZero}}<span class="repo-updated" title="Last activity">{{since .Updated.Unix}}</span>{{end}}
91 91 </div>
92 92 {{if .Description}}<p class="repo-desc">{{.Description}}</p>{{end}}
93 93 {{if or .OpenIssues .OpenChanges .LastTag}}
94 94 <div class="repo-chips">
95 {{if .OpenIssues}}<a class="chip" href="/r/{{.Name}}/issues">{{icon "circle-dot"}}{{.OpenIssues}} issue{{if ne .OpenIssues 1}}s{{end}}</a>{{end}}
96 {{if .OpenChanges}}<a class="chip" href="/r/{{.Name}}/changes">{{icon "git-pull-request"}}{{.OpenChanges}} change{{if ne .OpenChanges 1}}s{{end}}</a>{{end}}
97 {{if .LastTag}}<a class="chip" href="/r/{{.Name}}/releases/{{.LastTag.Name}}">{{icon "tag"}}{{.LastTag.Name}}</a>{{end}}
95 {{if .OpenIssues}}<a class="chip" href="/{{.Name}}/issues">{{icon "circle-dot"}}{{.OpenIssues}} issue{{if ne .OpenIssues 1}}s{{end}}</a>{{end}}
96 {{if .OpenChanges}}<a class="chip" href="/{{.Name}}/changes">{{icon "git-pull-request"}}{{.OpenChanges}} change{{if ne .OpenChanges 1}}s{{end}}</a>{{end}}
97 {{if .LastTag}}<a class="chip" href="/{{.Name}}/releases/{{.LastTag.Name}}">{{icon "tag"}}{{.LastTag.Name}}</a>{{end}}
98 98 </div>
99 99 {{end}}
100 100 </article>