internal/web/templates/account.html

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

134 lines · 7719 bytes

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