~sircmpwn/meta.sr.ht

ref: 72548bd7545f78670878667674cc7645835a17bd meta.sr.ht/metasrht/templates/keys.html -rw-r--r-- 4.5 KiB
72548bd7Drew DeVault API: Updates per core-go auth changes 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{% extends "meta.html" %}
{% block title %}
<title>Keys - {{cfg("sr.ht", "site-name")}} meta</title>
{% endblock %}
{% block content %}
<div class="row">
  <div class="col-md-12 event-list">
    <section class="event">
      <h3>SSH Keys</h3>
      {% if any(current_user.ssh_keys) %}
      <p>The following SSH keys are associated with your account:</p>
      <table class="table">
        <thead>
          <tr>
            <th>Name</th>
            <th>Fingerprint</th>
            <th>Authorized</th>
            <th>Last Used</th>
            <th></th>
          </tr>
        </thead>
        <tbody>
          {% for key in current_user.ssh_keys %}
          <tr>
            <td>{{key.comment}}</td>
            <td>{{key.fingerprint}}</td>
            <td>{{key.created|date}}</td>
            <td>{{key.last_used|date}}</td>
            <td style="width: 6rem">
              <form method="POST" action="/keys/delete-ssh/{{key.id}}">
                {{csrf_token()}}
                <button type="submit" class="btn btn-danger btn-fill">
                  Delete
                </a>
              </form>
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
      {% endif %}
      <form method="POST" action="/keys/ssh-keys">
        {{csrf_token()}}
        <div class="form-group">
          <label for="ssh-key">SSH Public Key:</label>
          <input
            type="text"
            class="form-control {{valid.cls("ssh-key")}}"
            id="ssh-key"
            name="ssh-key"
            aria-describedBy="sshkey-details"
            value="{{ssh_key or ""}}"
            placeholder="ssh-ed25519 bWFyYmxlY2FrZQo= ..." />
          <small id="sshkey-details" class="form-text text-muted">
            A list of your SSH public keys is available to the public via
            <a
              href="{{url_for("profile.user_keys_GET",
                username=current_user.username)}}"
            >{{current_user.canonical_name}}.keys</a>
          </small>
          {{valid.summary("ssh-key")}}
        </div>
        {{valid.summary()}}
        <button type="submit" class="btn btn-primary pull-right">
          Add key {{icon("caret-right")}}
        </button>
      </form>
    </section>
    <section class="event">
      <h3>PGP Keys</h3>
      {% if any(current_user.pgp_keys) %}
      <p>The following PGP keys are associated with your account:</p>
      <table class="table">
        <thead>
          <tr>
            <th>Email</th>
            <th>Key ID</th>
            <th>Authorized</th>
            <th></th>
          </tr>
        </thead>
        <tbody>
          {% for key in current_user.pgp_keys %}
          <tr>
            <td>{{key.email}}</td>
            <td>{{key.key_id}}</td>
            <td>{{key.created|date}}</td>
            <td style="width: 6rem">
              <form method="POST" action="/keys/delete-pgp/{{key.id}}">
                {{csrf_token()}}
                <button type="submit" class="btn btn-danger btn-fill">Delete</a>
              </form>
            </td>
          </tr>
          {% endfor %}
        </tbody>
      </table>
      {% endif %}
      {% if tried_to_delete_key_in_use %}
      <div class="alert alert-danger">This key is currently selected to encrypt
          e-mails. Please either select a different key or disable e-mail
          encryption in the <a href="/privacy">privacy section</a> before
          deleting this key.</div>
      {% endif %}
      <form method="POST" action="/keys/pgp-keys">
        {{csrf_token()}}
        <div class="form-group">
          <label for="pgp-key">PGP Public Key:</label>
          <textarea
            class="form-control {{valid.cls("pgp-key")}}"
            id="pgp-key"
            name="pgp-key"
            style="font-family: monospace"
            rows="5"
            placeholder="gpg --armor --export-options export-minimal --export 616C736F207468652067616D650A"
          >{{pgp_key or ""}}</textarea>
          <small id="sshkey-details" class="form-text text-muted">
            A list of your PGP public keys is available to the public via
            <a
              href="{{url_for("profile.user_pgp_keys_GET",
                username=current_user.username)}}"
            >{{current_user.canonical_name}}.pgp</a>
          </small>
          {{valid.summary("pgp-key")}}
        </div>
        <button type="submit" class="btn btn-primary pull-right">
          Add key {{icon("caret-right")}}
        </button>
      </form>
    </section>
  </div>
</div>
{% endblock %}