Commit 4f0b6274b6

4f0b6274b6e79208f00fc4c7af52e3d7124bf00a

parent: 0f8dbb4063

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-22 04:40 UTC

web: registration answers "no key yet?" in place

The link left the page for the wiki, on another origin, over a
half-filled form and with no way back to it. It also hardcoded
gitbay.org, so any other instance pointed at this one. A disclosure
holds the ssh-keygen and cat lines instead.

Ref #248
e2e/design_test.go +5 −2
@@ -200,8 +200,11 @@ func TestLandingRoutes(t *testing.T) {
200200 t.Error("landing still calls repo create the whole onboarding")
201201 }
202202 _, reg := inst.get(t, "/register")
203 if !strings.Contains(reg, "Paste the contents of your public key file") || !strings.Contains(reg, "/krz/gitbay/wiki/SSH-keys") {
204 t.Error("register page lacks the key hint or the wiki link")
203 if !strings.Contains(reg, "Paste the contents of your public key file") || !strings.Contains(reg, "ssh-keygen -t ed25519") {
204 t.Error("register page lacks the key hint or the disclosure that makes a key")
205 }
206 if strings.Contains(reg, "gitbay.org/krz/gitbay/wiki") {
207 t.Error("register page links out to this instance's wiki")
205208 }
206209}
207210
internal/web/templates/register.html +9 −1
@@ -10,7 +10,15 @@
1010{{if eq .Mode "invite"}}<div class="field"><label for="invite">Invite code</label><input type="text" id="invite" name="invite" required></div>
1111{{else}}<div class="field"><label for="email">Email</label><input type="text" id="email" name="email" required></div>{{end}}
1212<div class="field"><label for="key">SSH public key</label>
13<p class="hint">Paste the contents of your public key file, usually <code>~/.ssh/id_ed25519.pub</code>. It starts with <code>ssh-ed25519</code> or <code>ssh-rsa</code>. No key yet? <a href="https://gitbay.org/krz/gitbay/wiki/SSH-keys">Make one</a>.</p>
13<p class="hint">Paste the contents of your public key file, usually <code>~/.ssh/id_ed25519.pub</code>. It starts with <code>ssh-ed25519</code> or <code>ssh-rsa</code>.</p>
14{{/* The help is a disclosure rather than a link out: a wiki page is on
15 another origin, opens over the half-filled form, and has no way
16 back to it. */}}
17<details class="editbox"><summary>No key yet?</summary>
18<p class="meta">Run this, take the default path, and paste what the second line prints.</p>
19<pre class="code" tabindex="0">ssh-keygen -t ed25519
20cat ~/.ssh/id_ed25519.pub</pre>
21</details>
1422<textarea id="key" name="key" rows="3" required placeholder="ssh-ed25519 AAAA... you@host"></textarea></div>
1523<p><button type="submit">Create account</button></p>
1624</form>