internal/web/templates/account.html
123 lines · 6834 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>Profile</h2>
8<p class="meta">Shown on your profile page, <a href="/{{.Viewer}}">/{{.Viewer}}</a>.</p>
9<form method="post" action="/settings" class="setform stack">
10 <input type="hidden" name="field" value="profile">
11 <label for="p-description">Description</label>
12 <input type="text" id="p-description" name="description" value="{{.Profile.Description}}" placeholder="one line, shown in listings">
13 <label for="p-website">Website</label>
14 <input type="text" id="p-website" name="website" value="{{.Profile.Website}}" placeholder="https://example.org">
15 <label for="p-links">Links</label>
16 <textarea id="p-links" name="links" rows="3" placeholder="one per line: label|https://... or a bare https://... (at most 5)">{{.LinksText}}</textarea>
17 <label for="p-about">About</label>
18 <textarea id="p-about" name="about" rows="8" placeholder="longer, shown below your repositories">{{.Profile.About}}</textarea>
19 {{template "formatpicker" .Profile.AboutFormat}}
20 <button type="submit">Save profile</button>
21</form>
22
23<h2>SSH keys</h2>
24<p class="meta">Your keys are your identity here. A <code>full</code> key can run
25commands and push; a <code>git</code> key can only move git data, which is what
26a CI checkout wants.</p>
27{{if .Keys}}<div class="tablewrap"><table class="keys">
28<tr class="cols"><th scope="col">fingerprint</th><th scope="col">type</th><th scope="col">scope</th><th scope="col"></th></tr>
29{{range .Keys}}<tr>
30 <td class="mono">{{.Fingerprint}}</td>
31 <td>{{.Algo}}</td>
32 <td>{{.Scope}}</td>
33 <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>
34</tr>
35{{end}}</table></div>
36{{else}}<p class="none">No SSH keys — which cannot be right, since you signed in.</p>{{end}}
37<details class="editbox">
38 <summary>Add an SSH key</summary>
39 <form method="post" action="/settings" class="setform stack">
40 <input type="hidden" name="field" value="key-add">
41 <label for="key">Public key</label>
42 <textarea id="key" name="key" rows="3" required placeholder="ssh-ed25519 AAAA... you@machine"></textarea>
43 <label for="scope">Scope</label>
44 <select id="scope" name="scope">
45 <option value="full">full — commands and git</option>
46 <option value="git">git — git transport only</option>
47 </select>
48 <button type="submit">Add key</button>
49 </form>
50</details>
51
52<h2>Email addresses</h2>
53<p class="meta">A verified address is what ties your signed commits to this
54account, and where notifications go.</p>
55{{if .Emails}}<ul class="plain">
56{{range .Emails}}<li>{{.Address}}
57 {{if .Primary}}<span class="chip">primary</span>{{end}}
58 {{if .Verified}}<span class="badge badge-verified">verified{{with .VerifiedBy}} · {{.}}{{end}}</span>
59 {{else}}<span class="badge badge-unsigned">unverified</span>{{end}}
60 {{if not .Primary}}{{if .Verified}}<form method="post" action="/settings" class="inline"><input type="hidden" name="field" value="email-primary"><input type="hidden" name="address" value="{{.Address}}"><button type="submit" class="linklike">Make primary</button></form>{{end}}
61 <form method="post" action="/settings" class="inline"><input type="hidden" name="field" value="email-remove"><input type="hidden" name="address" value="{{.Address}}"><button type="submit" class="linklike">Remove</button></form>{{end}}</li>
62{{end}}</ul>{{end}}
63<details class="editbox">
64 <summary>Add an address</summary>
65 <form method="post" action="/settings" class="setform">
66 <input type="hidden" name="field" value="email-add">
67 <label for="address">Address</label>
68 <input type="email" id="address" name="address" required placeholder="you@example.org">
69 <button type="submit">Send code</button>
70 </form>
71 <form method="post" action="/settings" class="setform">
72 <input type="hidden" name="field" value="email-verify">
73 <label for="code">Verification code</label>
74 <input type="text" id="code" name="code" required placeholder="from the mail">
75 <button type="submit">Verify</button>
76 </form>
77</details>
78
79<h2>OpenPGP keys</h2>
80<p class="meta">Only needed if you sign commits with GPG. SSH signing
81(<code>gpg.format = ssh</code>) uses the keys above.</p>
82{{if .PGP}}<div class="tablewrap"><table class="keys">
83<tr class="cols"><th scope="col">fingerprint</th><th scope="col">identities</th><th scope="col"></th></tr>
84{{range .PGP}}<tr>
85 <td class="mono">{{.Fingerprint}}</td>
86 <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>
87 <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>
88</tr>
89{{end}}</table></div>
90{{else}}<p class="none">No OpenPGP keys.</p>{{end}}
91<details class="editbox">
92 <summary>Add a PGP key</summary>
93 <form method="post" action="/settings" class="setform stack">
94 <input type="hidden" name="field" value="pgp-add">
95 <label for="pgpkey">Armored public key</label>
96 <textarea id="pgpkey" name="key" rows="6" required placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"></textarea>
97 <button type="submit">Add key</button>
98 </form>
99</details>
100
101<h2>Notifications</h2>
102<form method="post" action="/settings" class="setform">
103 <input type="hidden" name="field" value="notify-mail">
104 <label for="notify-mail">Activity by mail</label>
105 <input type="checkbox" id="notify-mail" name="mail" value="on"{{if .MailOn}} checked{{end}}>
106 <button type="submit">Save</button>
107</form>
108<p class="meta">The inbox is filed either way; this is the mail half. Login links are not activity and still arrive.</p>
109
110<h2>Export</h2>
111<p class="meta">Your profile, repositories, issues and merge requests as one
112JSON bundle, the same one <code>gitbay account export</code> writes. Keys are
113never included; a replayed bundle's emails arrive unverified.</p>
114<p><a href="/settings/export">Download bundle</a></p>
115
116<h2>On SSH only</h2>
117<p class="meta">Anything whose input is a credential stays on the command line,
118where it can be piped instead of pasted:</p>
119<pre class="message">gitbay auth token mint --name laptop # API tokens
120gitbay admin ... # instance administration</pre>
121<p class="meta">All of the above works from stock OpenSSH too:
122<code>ssh git@{{.Host}} auth whoami</code>.</p>
123{{end}}