-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
212 lines (190 loc) · 7.76 KB
/
index.html
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Solo Webupdate</title>
<link rel="stylesheet" href="css/styles.css">
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
</head>
<body onload="prepare()">
<div id="app" v-cloak>
<section class="section">
<div class="container">
<h1 class="title">
Solo Webupdate
</h1>
<p class="content">
<!-- https://stackoverflow.com/a/47033801/4768845 -->
<span v-if="platform_description" v-text="platform_description"></span>
<br>
<span v-if="webauthn_support" v-text="webauthn_support"></span>
<br>
Solo firmware version:
<span v-if="solo_version" v-text="solo_version"></span>
<span v-else>unknown</span>
<br>
Latest Solo firmware version:
<span v-if="stable_version" v-text="stable_version"></span>
<span v-else>unknown</span>
</p>
<template v-if="is_linux">
<div class="message is-warning">
<div class="message-header">
<p>Linux needs udev rules</p>
</div>
<div class="message-body">
<p>On Linux, you likely need "udev rules" installed to use your key.</p>
<p>See <a href="https://docs.solokeys.io/solo/udev/" target="_blank">https://docs.solokeys.io/solo/udev/</a> for more information.</p>
</div>
</div>
</template>
<div class="content">
<button onclick="inspect()" class="button is-primary">Inspect Key</button>
</div>
<template v-if="ask_for_attestation">
<article class="message is-warning">
<div class="message-header">
<p>INSPECTING KEY</p>
</div>
<div class="message-body">
Please press the button on your key!
<br>
If nothing happens, replug and press again.
</div>
</article>
</template>
<template v-if="cannot_inspect">
<article class="message is-danger">
<div class="message-header">
<p>DEVICE IS IN BOOTLOADER MODE</p>
</div>
<div class="message-body">
<ul>
<li class="list-item"> To inspect your key, unplug, replug, and try to inspect again </li>
<li class="list-item"> If your key remains in bootloader mode, try "advanced mode" below, and flash the appropriate firmware (secure/hacker).</li>
</ul>
</div>
</article>
</template>
</div>
</section>
<section class="section">
<div class="container">
<p class="content" v-if="is_solo_secure">Your key is a Solo Secure!</p>
<p class="content" v-if="is_solo_hacker">Your key is a Solo Hacker!</p>
</div>
<template v-if="correct_firmware">
<div class="container" v-if="needs_update">
<p>
Since the firmware is out of date, it needs an update.
<br>
Please unplug your key, and plug it back in while holding the button pressed until the LED blinks yellow.
<br>
You may let go of the button once the LED blinks yellow.
</p>
<button onclick="update()" class="button is-primary" v-if="is_solo_secure">Update Solo Secure</button>
<button onclick="update()" class="button is-primary" v-if="is_solo_hacker">Update Solo Hacker</button>
<p>
<span v-if="update_status" v-text="update_status"></span>
<br>
<span v-if="update_progress" v-text="update_progress"></span>
</p>
</div>
<div class="container" v-else-if="is_solo_secure || is_solo_hacker">
<p>
Your firmware seems up to date! For testing, you can flash it again.
<br>
For this, unplug your key, and plug in while keeping pressed until the LED blinks yellow.
</p>
<template v-if="cannot_flash">
<article class="message is-danger">
<div class="message-header">
<p>DEVICE IS NOT IN BOOTLOADER MODE</p>
</div>
<div class="message-body">
<p>Please unplug your key, and plug in while keeping pressed until the LED blinks yellow.</p>
<p>Then try to flash again</p>
</div>
</article>
</template>
<template>
<article class="message is-warning">
<div class="message-header">
<p>DO NOT TAB OUT</p>
</div>
<div class="message-body">
During the firmware update, you will see flashing popups - this is normal.
<br>
Do NOT TAB OUT during the update, or it will abort.
</div>
</article>
</template>
<button onclick="update()" class="button is-primary" v-if="is_solo_secure">Reflash Solo Secure</button>
<button onclick="update()" class="button is-primary" v-if="is_solo_hacker">Reflash Solo Hacker</button>
<p>
<span v-if="update_status" v-text="update_status"></span>
<br>
<span v-if="update_progress" v-text="update_progress"></span>
<progress class="progress is-success is-large" v-bind:value="p_progress" max="100" v-if="p_progress">{{ p_progress }}%</progress>
</p>
<template v-if="update_success">
<article class="message is-success">
<div class="message-header">
<p>UPDATE SUCCESSFUL!</p>
</div>
<div class="message-body">
Your key is now updated.
</div>
</article>
</template>
</div>
</template>
<template v-else>
<article class="message is-danger">
<div class="message-header">
<p>SITE FIRMWARE OUT OF DATE!</p>
</div>
<div class="message-body">
<p>Please inform SoloKeys!</p>
<p>Firmware flashing deactivated.</p>
</div>
</article>
</template>
</section>
<section class="section">
<div class="container">
<a href="https://github.com/solokeys/solo-webupdate" target="_blank"><img src="images/github.png" height=32 width=32>github.com/solokeys/solo-webupdate</a>
</div>
</section>
<section class="section">
<div class="container">
<button onclick="toggle_advanced_mode()" class="button is-light">Advanced Mode (DANGER ZONE!)</button>
<template v-if="advanced_mode">
<br>
<br>
<button onclick="update_secure()" class="button is-primary">I CONFIRM: Solo Secure plugged in - reflash it</button>
<br>
<br>
<button onclick="update_hacker()" class="button is-primary">I CONFIRM: Solo Hacker plugged in - reflash it</button>
</template>
</div>
</section>
</div>
</body
<!-- development version, includes helpful console warnings -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- production version, optimized for size and speed -->
<!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script> -->
<!-- external; permissive licenses -->
<script src="js/vendor/cbor.js"></script>
<script src="js/vendor/platform.js"></script>
<script src="js/vendor/sha256.js"></script>
<script src="js/vendor/intel-hex.js"></script>
<script src="js/vendor/u2f-api.js"></script>
<!-- our stuff -->
<script src="js/constants.js"></script>
<script src="js/helpers.js"></script>
<script src="js/ctaphid.js"></script>
<script src="js/main.js"></script>
</html>