on master help sign in
rekey: new breach/simple rekey copy

fixes urbit/bridge#888, fixes urbit/bridge#868

commit9cccfa8992de3d7ee8dd7197c04717dae91546da authorJames Acklin <james@tlon.io> dateMon 24 Jan 2022, 15:28 (5 years ago) parent4a978aa
2 files changed+53−16
src/views/UrbitOS/NetworkKeys.scss+10−10 src/views/UrbitOS/NetworkKeys.tsx+43−6
src/views/UrbitOS/NetworkKeys.scss+10−10
@@ -6,6 +6,12 @@
66 .body-pane {
77 height: 360px;
88
9+ .download {
10+ height: 24px;
11+ width: 24px;
12+ margin: 0 auto 22px;
13+ }
14+
915 .download-message {
1016 align-items: center;
1117 width: 350px;
@@ -15,12 +21,6 @@
1521 letter-spacing: 0em;
1622 text-align: center;
1723 margin: 90px auto 40px;
18−
19− .download {
20− height: 24px;
21− width: 24px;
22− margin-bottom: 22px;
23− }
2424 }
2525
2626 .contents {
@@ -29,24 +29,24 @@
2929 display: flex;
3030 flex-direction: column;
3131 justify-content: space-between;
32−
32+
3333 .check-row {
3434 margin-top: 8px;
3535 font-weight: 500;
36−
36+
3737 .checkbox {
3838 border-radius: $medium-border-radius;
3939 height: 16px;
4040 width: 16px;
4141 margin-right: 14px;
42−
42+
4343 svg {
4444 height: 18px;
4545 width: 18px;
4646 }
4747 }
4848 }
49−
49+
5050 .info-text {
5151 color: $dark-gray;
5252 margin: 8px 0px 24px 32px;
src/views/UrbitOS/NetworkKeys.tsx+43−6
@@ -9,7 +9,7 @@ import { Just } from 'folktale/maybe';
99import { Grid, Button } from 'indigo-react';
1010import * as azimuth from 'azimuth-js';
1111import { randomHex } from 'web3-utils';
12−import { Box, Checkbox, Icon, Row } from '@tlon/indigo-react';
12+import { Box, Checkbox, Icon, Row, Text } from '@tlon/indigo-react';
1313
1414import { usePointCache } from 'store/pointCache';
1515import { useNetwork } from 'store/network';
@@ -280,8 +280,44 @@ export default function UrbitOSNetworkKeys({
280280 ? 'Set Network Keys'
281281 : 'Initiate Network Keys';
282282
283− const usageMessage =
284− 'With your new network keys, you also have a new keyfile. Download your new keyfile to boot your OS.';
283+ const bootMessage = () => (
284+ <Text as="p" textAlign={'center'}>
285+ With your new network keys, you also have a new bootkey. Download your new
286+ bootkey to boot your ship. Be sure to delete your old pier before booting
287+ with this new bootkey.
288+ </Text>
289+ );
290+
291+ const resetMessage = () => (
292+ <>
293+ <Text as="p" textAlign={'center'}>
294+ With your new network keys, you also have a new bootkey.
295+ <br />
296+ Copy the contents of your new bootkey and run
297+ </Text>
298+ <Text
299+ as="code"
300+ mono
301+ bg={'washedGray'}
302+ padding={2}
303+ borderRadius={2}
304+ textAlign={'center'}>
305+ |rekey 'bootkey_contents'
306+ </Text>
307+ <Text as="p" textAlign={'center'}>
308+ using the dojo on your running ship.
309+ </Text>
310+ </>
311+ );
312+
313+ const waitMessage = () => (
314+ <Text as="p" textAlign={'center'}>
315+ <strong>Important:</strong> you will need to wait until the next L2 batch
316+ is submitted to the roller to boot your ship. If you do not wait, then you
317+ will run into a key mismatch error and will not be able to communicate
318+ with other ships on the network.
319+ </Text>
320+ );
285321
286322 const buttonText = `${hasKeys ? 'Reset' : 'Set'} Network Keys`;
287323
@@ -295,9 +331,10 @@ export default function UrbitOSNetworkKeys({
295331 <BodyPane>
296332 {isComplete && (
297333 <Box className="flex-col col justify-between h-full">
298− <Box className="flex-col download-message">
334+ <Box className="flex-col h-full justify-center">
299335 <Icon icon="Download" className="download" />
300− <Box>{usageMessage}</Box>
336+ {breach ? bootMessage() : resetMessage()}
337+ {breach && point.isL2 ? waitMessage() : null}
301338 </Box>
302339 {point.isL2 ? (
303340 <Grid.Item
@@ -306,7 +343,7 @@ export default function UrbitOSNetworkKeys({
306343 solid
307344 center
308345 onClick={keyfileBind.download}>
309− Download Keyfile
346+ Download Bootkey
310347 </Grid.Item>
311348 ) : (
312349 <Grid.Item