feat(cli): guided encrypted-image wizard (default) + remote-unlock

Add a guided setup: one interactive command that asks everything up front then
builds an encrypted, Tor-remote-unlockable image unattended (distribution,
target device, hostname, login user + key, password), creating or renaming the
login user and installing the SSH key for both unlock and post-boot login.

- wizard.py: _collect (all prompts) + _execute (autonomous build); renames a
  stock pi/alarm user or creates one, grants sudo, installs the login key.
- unlock.py + `lim --type remote-unlock`: reach the initramfs over Tor (onion,
  torsocks) or plain SSH (host/IP), run cryptroot-unlock or the passphrase
  prompt; the wizard persists a target record under ~/.config/lim/unlocks.
- cli.py: register guided (default --type) and remote-unlock; drop the
  deprecated --extra argument.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Kevin Veen-Birkenbach
2026-07-23 01:59:40 +02:00
parent 1649f73a69
commit 1725bc64a2
6 changed files with 605 additions and 10 deletions

View File

@@ -57,6 +57,10 @@ def test_unknown_type_is_rejected_by_argparse():
assert excinfo.value.code == 2
def test_type_defaults_to_guided():
assert cli.build_parser().parse_args([]).type == "guided"
def test_all_registered_commands_have_descriptions():
for name, command in cli.COMMANDS.items():
assert command.description, name