Commit 87ae804
fix(install): accept --url/--node-id/--key args, single one-liner for the modal
User report: ran the dashboard's "Install CloudNode" command on a Pi
that had a stale ~/data/node.db from earlier `cargo run` testing.
install.sh saw the existing node.db, set IS_REGISTERED=true, skipped
the setup wizard entirely, and started a systemd service with the
revoked credentials. The script said "CloudNode is streaming" — it
wasn't, and there was no way to tell from the output.
Three changes that converge on a single one-shot install command:
1. install.sh now parses --url, --node-id, and --key from the
command line. Use them like:
curl -fsSL .../install.sh | bash -s -- \
--url <url> --node-id <id> --key <key>
All three required together (fail loud if partial). Unknown
args are ignored so future modal versions can append new flags
without breaking older script versions.
2. When credentials are passed, the script:
a. Treats any existing ~/data/node.db or
$INSTALL_DIR/data/node.db as STALE — flips IS_REGISTERED
back to false and forces re-registration. Setup overwrites
the old DB atomically.
b. Runs `sourcebox-sentry-cloudnode setup --url X --node-id Y
--key Z` non-interactively. No /dev/tty needed, works in
curl|bash pipes.
c. Auto-installs the systemd service (no prompt — operator
opted in by passing creds).
d. On setup failure: exits 1 so the calling shell sees the
failure, prints the manual command for retry.
Without credentials the script behaves exactly as before:
interactive wizard from /dev/tty, optional systemd install with
prompt. Existing CI/Ansible/cloud-init flows that don't pass
args see no behavior change.
3. AddNodeModal.jsx generates the install command WITH the
credentials already inlined, so the operator copies one
command instead of two. The previous "1. Install" + "2. Quick
Setup" split was the source of the confusion that motivated
this fix — install.sh was already trying to do step 2 itself,
just badly when stale state existed.
Windows still needs two steps (MSI download + post-install
setup command in PowerShell) since we don't pipe args into the
MSI installer. The modal now only shows the second step on
the Windows tab.
Verified bash syntax (`bash -n install.sh`) and frontend builds
clean. Backwards compatible: every existing install path keeps
working; the new path is opt-in via the args.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent c7a2ba3 commit 87ae804
2 files changed
Lines changed: 181 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
6 | 19 | | |
7 | 20 | | |
8 | 21 | | |
| |||
16 | 29 | | |
17 | 30 | | |
18 | 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 | + | |
19 | 83 | | |
20 | 84 | | |
21 | 85 | | |
| |||
397 | 461 | | |
398 | 462 | | |
399 | 463 | | |
400 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
401 | 480 | | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
408 | 493 | | |
409 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
410 | 516 | | |
411 | 517 | | |
412 | 518 | | |
413 | 519 | | |
414 | 520 | | |
415 | 521 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | 522 | | |
420 | 523 | | |
421 | | - | |
422 | | - | |
423 | 524 | | |
424 | 525 | | |
425 | 526 | | |
| |||
531 | 632 | | |
532 | 633 | | |
533 | 634 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
540 | 662 | | |
541 | 663 | | |
542 | 664 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
43 | 57 | | |
44 | | - | |
45 | | - | |
| 58 | + | |
| 59 | + | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
51 | 70 | | |
52 | 71 | | |
53 | 72 | | |
| |||
167 | 186 | | |
168 | 187 | | |
169 | 188 | | |
170 | | - | |
| 189 | + | |
171 | 190 | | |
172 | 191 | | |
173 | 192 | | |
| |||
197 | 216 | | |
198 | 217 | | |
199 | 218 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
205 | 232 | | |
206 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
207 | 237 | | |
208 | 238 | | |
209 | 239 | | |
| |||
0 commit comments