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 @@
1#+title: Quickstart 1#+title: Quickstart
2 2
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=
42. =ssh git@gitbay.org whoami= — your key is your identity 152. =ssh git@gitbay.org whoami= — your key is your identity
53. =gitbay repo create you/hello= then push 163. =gitbay repo create you/hello= then push
64. =gitbay issue create --title "first"= from inside the clone 174. =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.
25* Check it works 25* Check it works
26 26
27#+begin_src sh 27#+begin_src sh
28ssh git@<host> whoami 28ssh git@gitbay.org whoami
29#+end_src 29#+end_src
30 30
31More keys, labels and scopes: [[Users][the user guide]] under "SSH keys". 31More 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) {
143 if !strings.Contains(msg, "To: dana@example.test") || !strings.Contains(msg, "From: noreply@gitbay.test") { 143 if !strings.Contains(msg, "To: dana@example.test") || !strings.Contains(msg, "From: noreply@gitbay.test") {
144 t.Fatalf("mail headers:\n%s", msg) 144 t.Fatalf("mail headers:\n%s", msg)
145 } 145 }
146 if !strings.Contains(msg, "/login") {
147 t.Fatalf("mail missing web sign-in path:\n%s", msg)
148 }
146 149
147 // Pending: the key authenticates, whoami works, but everything else is 150 // Pending: the key authenticates, whoami works, but everything else is
148 // gated — control commands and git alike. 151 // gated — control commands and git alike.
e2e/websignup_test.go +2 −1
@@ -54,7 +54,8 @@ func TestWebSignup(t *testing.T) {
54 // The real thing: account is active immediately (invite proves the mailbox). 54 // The real thing: account is active immediately (invite proves the mailbox).
55 status, body = browserPost(t, browser, inst.base()+"/register", url.Values{ 55 status, body = browserPost(t, browser, inst.base()+"/register", url.Values{
56 "username": {"erin"}, "invite": {inviteCode}, "key": {string(pub)}}) 56 "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") {
58 t.Fatalf("signup: %d\n%s", status, body) 59 t.Fatalf("signup: %d\n%s", status, body)
59 } 60 }
60 out, errOut, code := inst.ssh(t, key, "", "whoami") 61 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
127 body := fmt.Sprintf( 127 body := fmt.Sprintf(
128 "Someone (hopefully you) added this address to an account on %s.\n\n"+ 128 "Someone (hopefully you) added this address to an account on %s.\n\n"+
129 "To verify it, run:\n\n ssh git@%s email verify %s\n\n"+ 129 "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"+
130 "The code expires in 24 hours. If this wasn't you, ignore this mail.\n", 131 "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))
132 return mail.Send(cfg, address, "verify your email on "+siteHost(cfg), body) 133 return mail.Send(cfg, address, "verify your email on "+siteHost(cfg), body)
133} 134}
134 135
internal/web/templates/registered.html +5 −1
@@ -4,7 +4,11 @@
4<div class="landing"> 4<div class="landing">
5<h1>Welcome, {{.Username}}</h1> 5<h1>Welcome, {{.Username}}</h1>
6<pre class="quickstart">{{.Message}}</pre> 6<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>
8<pre class="quickstart">ssh git@{{.Host}} whoami 12<pre class="quickstart">ssh git@{{.Host}} whoami
9ssh git@{{.Host}} repo create {{.Username}}/hello 13ssh git@{{.Host}} repo create {{.Username}}/hello
10gitbay web login # mints a browser session from your terminal</pre> 14gitbay web login # mints a browser session from your terminal</pre>