internal/web/templates/account.html

6821a6f76082b1e10ff899ff51021b11695c4ad6
gitbay/internal/web/templates/account.html history · blame · raw

91 lines · 4651 bytes

 1{{define "title"}}account settings{{end}}
 2{{define "content"}}
 3<h1>Account settings</h1>
 4{{if .Notice}}<p class="error" role="alert">{{.Notice}}</p>{{end}}
 5{{if .Message}}<p class="notice" role="status">{{.Message}}</p>{{end}}
 6
 7<h2>SSH keys</h2>
 8<p class="meta">Your keys are your identity here. A <code>full</code> key can run
 9commands and push; a <code>git</code> key can only move git data, which is what
10a CI checkout wants.</p>
11{{if .Keys}}<div class="tablewrap"><table class="keys">
12<tr class="cols"><th scope="col">fingerprint</th><th scope="col">type</th><th scope="col">scope</th><th scope="col"></th></tr>
13{{range .Keys}}<tr>
14  <td class="mono">{{.Fingerprint}}</td>
15  <td>{{.Algo}}</td>
16  <td>{{.Scope}}</td>
17  <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>
18</tr>
19{{end}}</table></div>
20{{else}}<p class="none">No SSH keys — which cannot be right, since you signed in.</p>{{end}}
21<details class="editbox">
22  <summary>Add an SSH key</summary>
23  <form method="post" action="/settings" class="setform stack">
24    <input type="hidden" name="field" value="key-add">
25    <label for="key">Public key</label>
26    <textarea id="key" name="key" rows="3" required placeholder="ssh-ed25519 AAAA... you@machine"></textarea>
27    <label for="scope">Scope</label>
28    <select id="scope" name="scope">
29      <option value="full">full — commands and git</option>
30      <option value="git">git — git transport only</option>
31    </select>
32    <button type="submit" class="primary">Add key</button>
33  </form>
34</details>
35
36<h2>Email addresses</h2>
37<p class="meta">A verified address is what ties your signed commits to this
38account, and where notifications go.</p>
39{{if .Emails}}<ul class="plain">
40{{range .Emails}}<li>{{.Address}}
41  {{if .Primary}}<span class="chip">primary</span>{{end}}
42  {{if .Verified}}<span class="badge badge-verified">verified{{with .VerifiedBy}} · {{.}}{{end}}</span>
43  {{else}}<span class="badge badge-unsigned">unverified</span>{{end}}</li>
44{{end}}</ul>{{end}}
45<details class="editbox">
46  <summary>Add an address</summary>
47  <form method="post" action="/settings" class="setform">
48    <input type="hidden" name="field" value="email-add">
49    <label for="address">Address</label>
50    <input type="email" id="address" name="address" required placeholder="you@example.org">
51    <button type="submit">Send code</button>
52  </form>
53  <form method="post" action="/settings" class="setform">
54    <input type="hidden" name="field" value="email-verify">
55    <label for="code">Verification code</label>
56    <input type="text" id="code" name="code" required placeholder="from the mail">
57    <button type="submit">Verify</button>
58  </form>
59</details>
60
61<h2>OpenPGP keys</h2>
62<p class="meta">Only needed if you sign commits with GPG. SSH signing
63(<code>gpg.format = ssh</code>) uses the keys above.</p>
64{{if .PGP}}<div class="tablewrap"><table class="keys">
65<tr class="cols"><th scope="col">fingerprint</th><th scope="col">identities</th><th scope="col"></th></tr>
66{{range .PGP}}<tr>
67  <td class="mono">{{.Fingerprint}}</td>
68  <td>{{range .UIDs}}{{.}}<br>{{end}}{{if .Revoked}}<span class="badge badge-bad_signature">revoked</span>{{else if .Expired}}<span class="badge badge-signed_key_expired">expired</span>{{end}}</td>
69  <td class="act"><form method="post" action="/settings"><input type="hidden" name="field" value="pgp-remove"><input type="hidden" name="fingerprint" value="{{.Fingerprint}}"><button type="submit" class="linklike">Remove</button></form></td>
70</tr>
71{{end}}</table></div>
72{{else}}<p class="none">No OpenPGP keys.</p>{{end}}
73<details class="editbox">
74  <summary>Add a PGP key</summary>
75  <form method="post" action="/settings" class="setform stack">
76    <input type="hidden" name="field" value="pgp-add">
77    <label for="pgpkey">Armored public key</label>
78    <textarea id="pgpkey" name="key" rows="6" required placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"></textarea>
79    <button type="submit" class="primary">Add key</button>
80  </form>
81</details>
82
83<h2>On SSH only</h2>
84<p class="meta">Anything whose input is a credential stays on the command line,
85where it can be piped instead of pasted:</p>
86<pre class="message">gitbay auth token mint --name laptop   # API tokens
87gitbay auth export &gt; account.bundle    # your account, portable
88gitbay admin ...                       # instance administration</pre>
89<p class="meta">All of the above works from stock OpenSSH too:
90<code>ssh git@{{.Host}} auth whoami</code>.</p>
91{{end}}