web, wiki: the newcomer route says where the code goes !426

merged merged by cmc on 2026-09-19 04:40 UTC · krz/gitbay:newcomer into main

6 files changed, +25 −5

Layout: unified · split

.gitbay/wiki/Quickstart.org +12 −1
@@ -1,6 +1,17 @@
11#+title: Quickstart
22
31. Install the CLI: =go install gitbay.org/gitbay/cmd/gitbay@latest=
3* From the browser
4
51. Create an account at https://gitbay.org/register with your SSH public key
62. Verify the code from the mail under Settings
73. + New repository
84. Clone with the SSH command the repository shows
95. Push
10
11* From the terminal
12
131. Install the CLI: =brew install krz/tap/gitbay= on a Mac, or
14 =go install gitbay.org/gitbay/cmd/gitbay@latest=
4152. =ssh git@gitbay.org whoami= — your key is your identity
5163. =gitbay repo create you/hello= then push
6174. =gitbay issue create --title "first"= from inside the clone
.gitbay/wiki/SSH-keys.org +1 −1
@@ -25,7 +25,7 @@ whole line is what the registration form and =register= want.
2525* Check it works
2626
2727#+begin_src sh
28ssh git@<host> whoami
28ssh git@gitbay.org whoami
2929#+end_src
3030
3131More keys, labels and scopes: [[Users][the user guide]] under "SSH keys".
e2e/registration_test.go +3
@@ -143,6 +143,9 @@ func TestOpenRegistration(t *testing.T) {
143143 if !strings.Contains(msg, "To: dana@example.test") || !strings.Contains(msg, "From: noreply@gitbay.test") {
144144 t.Fatalf("mail headers:\n%s", msg)
145145 }
146 if !strings.Contains(msg, "/login") {
147 t.Fatalf("mail missing web sign-in path:\n%s", msg)
148 }
146149
147150 // Pending: the key authenticates, whoami works, but everything else is
148151 // gated — control commands and git alike.
e2e/websignup_test.go +2 −1
@@ -54,7 +54,8 @@ func TestWebSignup(t *testing.T) {
5454 // The real thing: account is active immediately (invite proves the mailbox).
5555 status, body = browserPost(t, browser, inst.base()+"/register", url.Values{
5656 "username": {"erin"}, "invite": {inviteCode}, "key": {string(pub)}})
57 if status != 200 || !strings.Contains(body, "welcome, erin") {
57 if status != 200 || !strings.Contains(body, "welcome, erin") ||
58 !strings.Contains(body, `href="/settings"`) || !strings.Contains(body, "paste the code") {
5859 t.Fatalf("signup: %d\n%s", status, body)
5960 }
6061 out, errOut, code := inst.ssh(t, key, "", "whoami")
internal/control/register.go +2 −1
@@ -127,8 +127,9 @@ func sendVerification(cfg config.Config, st *store.Store, userID int64, address
127127 body := fmt.Sprintf(
128128 "Someone (hopefully you) added this address to an account on %s.\n\n"+
129129 "To verify it, run:\n\n ssh git@%s email verify %s\n\n"+
130 "Or sign in at https://%s/login with this address and paste the code under Settings.\n\n"+
130131 "The code expires in 24 hours. If this wasn't you, ignore this mail.\n",
131 siteHost(cfg), siteHost(cfg), code)
132 siteHost(cfg), siteHost(cfg), code, siteHost(cfg))
132133 return mail.Send(cfg, address, "verify your email on "+siteHost(cfg), body)
133134}
134135
internal/web/templates/registered.html +5 −1
@@ -4,7 +4,11 @@
44<div class="landing">
55<h1>Welcome, {{.Username}}</h1>
66<pre class="quickstart">{{.Message}}</pre>
7<p>Everything runs over SSH with the key you registered:</p>
7<h2>On the web</h2>
8<p>Check your mail for the code, <a href="/login">sign in</a> with an emailed
9link, and paste the code under <a href="/settings">Settings</a>. Then +
10creates your first repository.</p>
11<h2>From the terminal</h2>
812<pre class="quickstart">ssh git@{{.Host}} whoami
913ssh git@{{.Host}} repo create {{.Username}}/hello
1014gitbay web login # mints a browser session from your terminal</pre>