internal/web/templates/account.html

3f4afd2210627e46fd0cea1f5831857af71638f6
gitbay/internal/web/templates/account.html history · blame · raw

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