A CLI-first git forge.

cli forge git self-hosted

https://gitbay.org

Commit dbd18f08cd

dbd18f08cd5999c73ffbedec7998e9290f7ba7fe

parent: 73c8e291f7

Verified · cmc ci/build: success

cmc <hello@cleberg.net> · 2026-08-26T05:20:37Z

web: drop the key comment column

SSH keys are stored in wire format, which carries no comment — reading
one out of the blob printed binary noise next to each fingerprint.

Ref #35
e2e/accountweb_test.go +5
@@ -38,6 +38,11 @@ func TestAccountSettingsWeb(t *testing.T) {
3838 if !strings.Contains(body, "SHA256:") {
3939 t.Error("no SSH key fingerprint listed")
4040 }
41 // Keys are stored in wire format, which holds no comment; anything
42 // pulled out of it and printed would be binary noise.
43 if strings.Contains(body, "\ufffd") {
44 t.Error("key row is rendering raw blob bytes")
45 }
4146 if !strings.Contains(body, "alice@example.test") || !strings.Contains(body, "verified") {
4247 t.Error("verified address not shown")
4348 }
e2e/facts_test.go +3 −3
@@ -47,9 +47,9 @@ func TestRepoFacts(t *testing.T) {
4747 "<strong>2</strong> commit", // both commits counted
4848 "<strong>1</strong> branch",
4949 "<strong>1</strong> tag",
50 "0BSD", // license detected and surfaced
51 "Go", // language census
52 "Shell", // and it is not single-language
50 "0BSD", // license detected and surfaced
51 "Go", // language census
52 "Shell", // and it is not single-language
5353 "2 contributors",
5454 } {
5555 if !strings.Contains(body, want) {
internal/httpd/account.go +1 −15
@@ -15,7 +15,6 @@ type accountKey struct {
1515 Fingerprint string
1616 Algo string
1717 Scope string
18 Comment string
1918 }
2019
2120 type accountPGP struct {
@@ -31,10 +30,7 @@ func (s *Server) accountForm(w http.ResponseWriter, r *http.Request, u store.Use
3130 var keys []accountKey
3231 if list, err := s.st.ListSSHKeys(u.ID); err == nil {
3332 for _, k := range list {
34 keys = append(keys, accountKey{
35 Fingerprint: k.Fingerprint, Algo: k.Algo, Scope: k.Scope,
36 Comment: keyComment(k.Blob),
37 })
33 keys = append(keys, accountKey{Fingerprint: k.Fingerprint, Algo: k.Algo, Scope: k.Scope})
3834 }
3935 }
4036 var pgp []accountPGP
@@ -62,16 +58,6 @@ func (s *Server) accountForm(w http.ResponseWriter, r *http.Request, u store.Use
6258 r.URL.Query().Get("e"), r.URL.Query().Get("m")})
6359 }
6460
65// keyComment pulls the trailing comment off an authorized_keys blob, which
66// is how people tell their own keys apart.
67func keyComment(blob []byte) string {
68 f := strings.Fields(string(blob))
69 if len(f) < 3 {
70 return ""
71 }
72 return strings.Join(f[2:], " ")
73}
74
7561 // accountSubmit routes the account forms to their commands. Everything
7662 // here is a public key or an address — no secret is accepted over the web.
7763 func (s *Server) accountSubmit(w http.ResponseWriter, r *http.Request, u store.User) {
internal/web/templates/account.html +1 −1
@@ -11,7 +11,7 @@ a CI checkout wants.</p>
1111 {{if .Keys}}<div class="tablewrap"><table class="keys">
1212 <tr class="cols"><th scope="col">fingerprint</th><th scope="col">type</th><th scope="col">scope</th><th scope="col"></th></tr>
1313 {{range .Keys}}<tr>
14 <td class="mono">{{.Fingerprint}}{{with .Comment}}<br><span class="muted">{{.}}</span>{{end}}</td>
14 <td class="mono">{{.Fingerprint}}</td>
1515 <td>{{.Algo}}</td>
1616 <td>{{.Scope}}</td>
1717 <td class="act"><form method="post" action="/settings"><input type="hidden" name="field" value="key-remove"><input type="hidden" name="fingerprint" value="{{.Fingerprint}}"><button type="submit" class="linklike">Remove</button></form></td>