Commit 4f0b6274b6
Verified · cmc
Layout: unified · split
e2e/design_test.go +5 −2
| @@ -200,8 +200,11 @@ func TestLandingRoutes(t *testing.T) { | |||
| 200 | t.Error("landing still calls repo create the whole onboarding") | 200 | t.Error("landing still calls repo create the whole onboarding") |
| 201 | } | 201 | } |
| 202 | _, reg := inst.get(t, "/register") | 202 | _, 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") { | 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 wiki link") | 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") | ||
| 205 | } | 208 | } |
| 206 | } | 209 | } |
| 207 | 210 | ||
internal/web/templates/register.html +9 −1
| @@ -10,7 +10,15 @@ | |||
| 10 | {{if eq .Mode "invite"}}<div class="field"><label for="invite">Invite code</label><input type="text" id="invite" name="invite" required></div> | 10 | {{if eq .Mode "invite"}}<div class="field"><label for="invite">Invite code</label><input type="text" id="invite" name="invite" required></div> |
| 11 | {{else}}<div class="field"><label for="email">Email</label><input type="text" id="email" name="email" required></div>{{end}} | 11 | {{else}}<div class="field"><label for="email">Email</label><input type="text" id="email" name="email" required></div>{{end}} |
| 12 | <div class="field"><label for="key">SSH public key</label> | 12 | <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 | ||
| 20 | cat ~/.ssh/id_ed25519.pub</pre> | ||
| 21 | </details> | ||
| 14 | <textarea id="key" name="key" rows="3" required placeholder="ssh-ed25519 AAAA... you@host"></textarea></div> | 22 | <textarea id="key" name="key" rows="3" required placeholder="ssh-ed25519 AAAA... you@host"></textarea></div> |
| 15 | <p><button type="submit">Create account</button></p> | 23 | <p><button type="submit">Create account</button></p> |
| 16 | </form> | 24 | </form> |