@@ -2,8 +2,10 @@ |
| 2 | 2 | <div class="shithub-settings-page"> |
| 3 | 3 | {{ template "settings-nav" . }} |
| 4 | 4 | <div class="shithub-settings-content"> |
| 5 | | - <h1>SSH keys</h1> |
| 5 | + <h1>SSH and GPG keys</h1> |
| 6 | + |
| 6 | 7 | <section class="shithub-settings-section"> |
| 8 | + <h2>SSH keys</h2> |
| 7 | 9 | <p>SSH keys let you push and clone over SSH without typing a password. Generate one with <code>ssh-keygen -t ed25519</code> and paste the contents of the <code>.pub</code> file below.</p> |
| 8 | 10 | |
| 9 | 11 | {{ if .Keys }} |
@@ -11,6 +13,7 @@ |
| 11 | 13 | {{ range .Keys }} |
| 12 | 14 | <li class="shithub-key-row"> |
| 13 | 15 | <div> |
| 16 | + <span class="shithub-key-type-badge">SSH</span> |
| 14 | 17 | <strong>{{ .Title }}</strong> |
| 15 | 18 | <span class="shithub-key-meta">{{ .KeyType }}{{ if .KeyBits }} · {{ .KeyBits }} bits{{ end }}</span> |
| 16 | 19 | <code class="shithub-key-fp">{{ .FingerprintSha256 }}</code> |
@@ -29,7 +32,7 @@ |
| 29 | 32 | </section> |
| 30 | 33 | |
| 31 | 34 | <section class="shithub-settings-section"> |
| 32 | | - <h2>Add a key</h2> |
| 35 | + <h3>Add an SSH key</h3> |
| 33 | 36 | {{ with .AddError }}<p class="shithub-flash shithub-flash-error" role="alert">{{ . }}</p>{{ end }} |
| 34 | 37 | <form method="POST" action="/settings/keys" novalidate> |
| 35 | 38 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
@@ -45,6 +48,44 @@ |
| 45 | 48 | <button type="submit" class="shithub-button shithub-button-primary">Add SSH key</button> |
| 46 | 49 | </form> |
| 47 | 50 | </section> |
| 51 | + |
| 52 | + <section class="shithub-settings-section"> |
| 53 | + <div class="shithub-settings-section-head"> |
| 54 | + <h2>GPG keys</h2> |
| 55 | + <a class="shithub-button shithub-button-primary" href="/settings/keys/gpg/new">New GPG key</a> |
| 56 | + </div> |
| 57 | + <p>This is a list of GPG keys associated with your account. Remove any keys that you do not recognize.</p> |
| 58 | + |
| 59 | + {{ if .GPGKeys }} |
| 60 | + <ul class="shithub-key-list"> |
| 61 | + {{ range .GPGKeys }} |
| 62 | + <li class="shithub-key-row"> |
| 63 | + <div class="shithub-key-row-body"> |
| 64 | + <span class="shithub-key-type-badge">GPG</span> |
| 65 | + {{ if .Name }}<strong>{{ .Name }}</strong>{{ end }} |
| 66 | + {{ range .Emails }} |
| 67 | + <div><span class="shithub-key-meta-label">Email address:</span> |
| 68 | + <span class="shithub-email-chip">{{ .Email }}</span></div> |
| 69 | + {{ end }} |
| 70 | + <div><span class="shithub-key-meta-label">Key ID:</span> |
| 71 | + <code class="shithub-key-fp">{{ .KeyID }}</code></div> |
| 72 | + {{ if .SubkeyIDs }} |
| 73 | + <div><span class="shithub-key-meta-label">Subkeys:</span> |
| 74 | + <code class="shithub-key-fp">{{ range $i, $id := .SubkeyIDs }}{{ if $i }}, {{ end }}{{ $id }}{{ end }}</code></div> |
| 75 | + {{ end }} |
| 76 | + <div class="shithub-key-last">Added on {{ .CreatedAt.Format "Jan 2, 2006" }}</div> |
| 77 | + </div> |
| 78 | + <form method="POST" action="/settings/keys/gpg/{{ .ID }}/delete" novalidate> |
| 79 | + <input type="hidden" name="csrf_token" value="{{ $.CSRFToken }}"> |
| 80 | + <button type="submit" class="shithub-button shithub-button-danger">Delete</button> |
| 81 | + </form> |
| 82 | + </li> |
| 83 | + {{ end }} |
| 84 | + </ul> |
| 85 | + {{ else }} |
| 86 | + <p class="shithub-key-empty">No GPG keys yet.</p> |
| 87 | + {{ end }} |
| 88 | + </section> |
| 48 | 89 | </div> |
| 49 | 90 | </div> |
| 50 | 91 | {{- end }} |