carlos / contra Public

Clone
git clone https://amadan.net/carlos/contra

Plain git — no account needed to clone.

Download

Download this file

1{{define "title"}}This device — CONTRA{{end}}
2{{define "brand"}}<a rst-shell-brand href="/">CONTRA</a>{{end}}
3{{define "head"}}<script type="module" src="{{asset "static/pages/device.js"}}"></script>{{end}}
4
5{{define "content"}}
6<h1>This device</h1>
7
8{{/* Two jobs, one page. A person arriving here is either holding a browser
9 that needs the Account Key, or holding one that already has it and is
10 being asked to hand it over. Which of those they are is obvious to them
11 and not to us, so both are offered rather than guessed at.
12
13 PROTOCOL.md: every screen that needs an Account Key offers all available
14 rungs and never dead-ends. */}}
15
16<section data-need>
17 <h2>Give this device your Account Key</h2>
18 <p>Your vault is sealed with a key this server has never had. A browser can
19 only open it once it holds your Account Key, and this one does not yet.
20 Any of these will do it.</p>
21
22 <ol data-rungs>
23 <li data-rung="handoff">
24 <h3>From another signed-in device</h3>
25 <p>Easiest, and needs nothing printed. Open CONTRA on a device that
26 already works, go to <strong>This device</strong>, and type the code
27 below.</p>
28 <p><button type="button" data-start-handoff>Show me a code</button></p>
29
30 <div data-handoff hidden>
31 <p>On your other device, type this code:</p>
32 <p><output data-code class="code"></output></p>
33 <p data-handoff-status aria-live="polite">Waiting for the other
34 device…</p>
35 <p><button type="button" data-cancel-handoff>Stop waiting</button></p>
36 </div>
37 </li>
38
39 <li data-rung="scan" hidden>
40 <h3>Scan the card</h3>
41 <p>Point the camera at the QR code on your Account Key card.</p>
42 <p><button type="button" data-start-scan>Use the camera</button></p>
43 <div data-scan hidden>
44 <video data-video playsinline muted></video>
45 <p data-scan-status aria-live="polite"></p>
46 <p><button type="button" data-stop-scan>Stop</button></p>
47 </div>
48 </li>
49
50 <li data-rung="type">
51 <h3>Type it from the card</h3>
52 <p>The line under the QR code, starting <code>A1</code>. Hyphens are
53 optional, and it is not case sensitive.</p>
54 <form data-type-form method="post" action="#">
55 <p>
56 <label for="account-key">Account Key</label>
57 <input id="account-key" name="account_key" type="text"
58 autocomplete="off" autocapitalize="characters"
59 spellcheck="false" required
60 placeholder="A1-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX">
61 </p>
62
63 {{/* Only revealed when the checksum fails. Repairing a mistyped
64 character means testing candidates against the wrap's KCV, and
65 that needs the passphrase — but the common case is a code typed
66 correctly, and that case should not be asked for one. */}}
67 <p data-repair hidden>
68 <label for="repair-passphrase">Passphrase</label>
69 <input id="repair-passphrase" name="passphrase" type="password"
70 autocomplete="current-password">
71 <small>That code did not check out. With your passphrase this can
72 try the single-character corrections and find the right one.</small>
73 </p>
74
75 <p><button type="submit">Use this key</button></p>
76 </form>
77 </li>
78 </ol>
79
80 <p data-need-status aria-live="polite"></p>
81
82 <details>
83 <summary>What if I have lost the card and every other device?</summary>
84 <p>Then the vault cannot be opened, by you or by anyone, including us.
85 That is the product rather than a fault in it: a vault the operator can
86 open is a vault the operator can be made to open. If you still have a
87 working device, print a new card today — it is on
88 <a href="/vault">your vault</a>.</p>
89 </details>
90</section>
91
92<section data-have hidden>
93 <h2>Approve another device</h2>
94 <p>A device asking to join will show you an eight-character code. Type it
95 here.</p>
96
97 <form data-approve-form method="post" action="#">
98 <p>
99 <label for="link-code">Code from the other device</label>
100 <input id="link-code" name="code" type="text" autocomplete="off"
101 autocapitalize="characters" spellcheck="false" required
102 placeholder="XXXX-XXXX">
103 </p>
104 <p><button type="submit">Look it up</button></p>
105 </form>
106
107 <div data-confirm hidden>
108 {{/* slopbox's wording, and it is the honest version: say what approving
109 actually hands over, not that a device "would like access". */}}
110 <p><strong>Only approve this if you started it.</strong> Approving hands
111 that device a copy of your Account Key. With your passphrase as well, it
112 will be able to read everything in your vault.</p>
113 <p>
114 <label for="approve-passphrase">Your passphrase</label>
115 <input id="approve-passphrase" type="password"
116 autocomplete="current-password">
117 <small>Needed to unlock this device's copy of the key so it can be
118 sealed to the other one. It is not sent anywhere.</small>
119 </p>
120 <p>
121 <button type="button" data-do-approve>Approve that device</button>
122 <button type="button" data-not-me>Not me</button>
123 </p>
124 </div>
125
126 <p data-approve-status aria-live="polite"></p>
127</section>
128
129<p><a href="/vault">Back to your vault</a></p>
130{{end}}
131