onboardrr 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. onboardrr-0.1.0/.gitignore +10 -0
  2. onboardrr-0.1.0/PKG-INFO +323 -0
  3. onboardrr-0.1.0/README.md +308 -0
  4. onboardrr-0.1.0/distribution/entrypoint.py +7 -0
  5. onboardrr-0.1.0/distribution/onboardrr.spec +31 -0
  6. onboardrr-0.1.0/distribution/smoke.py +115 -0
  7. onboardrr-0.1.0/onboardrr/__init__.py +3 -0
  8. onboardrr-0.1.0/onboardrr/__main__.py +1008 -0
  9. onboardrr-0.1.0/onboardrr/automatic.py +633 -0
  10. onboardrr-0.1.0/onboardrr/compose_agent.py +315 -0
  11. onboardrr-0.1.0/onboardrr/credential_retirement.py +100 -0
  12. onboardrr-0.1.0/onboardrr/goku_export.py +119 -0
  13. onboardrr-0.1.0/onboardrr/goku_retirement.py +221 -0
  14. onboardrr-0.1.0/onboardrr/host_resolution.py +40 -0
  15. onboardrr-0.1.0/onboardrr/host_retirement.py +137 -0
  16. onboardrr-0.1.0/onboardrr/http_json.py +56 -0
  17. onboardrr-0.1.0/onboardrr/image_versions.py +227 -0
  18. onboardrr-0.1.0/onboardrr/inventory.py +154 -0
  19. onboardrr-0.1.0/onboardrr/komodo.py +325 -0
  20. onboardrr-0.1.0/onboardrr/linux.py +126 -0
  21. onboardrr-0.1.0/onboardrr/monitoring.py +590 -0
  22. onboardrr-0.1.0/onboardrr/nas.py +256 -0
  23. onboardrr-0.1.0/onboardrr/nas_monitoring.py +44 -0
  24. onboardrr-0.1.0/onboardrr/outbound.py +191 -0
  25. onboardrr-0.1.0/onboardrr/pangolin.py +302 -0
  26. onboardrr-0.1.0/onboardrr/pangolin_network.py +196 -0
  27. onboardrr-0.1.0/onboardrr/periphery.py +253 -0
  28. onboardrr-0.1.0/onboardrr/primary_storage.py +138 -0
  29. onboardrr-0.1.0/onboardrr/progress.py +46 -0
  30. onboardrr-0.1.0/onboardrr/reconcile.py +142 -0
  31. onboardrr-0.1.0/onboardrr/registry.py +28 -0
  32. onboardrr-0.1.0/onboardrr/remote/compose_update.py +686 -0
  33. onboardrr-0.1.0/onboardrr/remote/goku_export.sh +97 -0
  34. onboardrr-0.1.0/onboardrr/remote/goku_export_create.sh +153 -0
  35. onboardrr-0.1.0/onboardrr/remote/goku_periphery.sh +53 -0
  36. onboardrr-0.1.0/onboardrr/remote/install_key.py +129 -0
  37. onboardrr-0.1.0/onboardrr/remote/monitoring.py +314 -0
  38. onboardrr-0.1.0/onboardrr/remote/nas.sh +279 -0
  39. onboardrr-0.1.0/onboardrr/remote/nas_mount.py +225 -0
  40. onboardrr-0.1.0/onboardrr/remote/nas_openbao.py +196 -0
  41. onboardrr-0.1.0/onboardrr/remote/pangolin_api.py +29 -0
  42. onboardrr-0.1.0/onboardrr/remote/periphery_identity.py +54 -0
  43. onboardrr-0.1.0/onboardrr/remote/preflight.py +55 -0
  44. onboardrr-0.1.0/onboardrr/remote/reconcile.py +274 -0
  45. onboardrr-0.1.0/onboardrr/remote/retire_host.py +343 -0
  46. onboardrr-0.1.0/onboardrr/remote/usb_storage.py +475 -0
  47. onboardrr-0.1.0/onboardrr/remote/verify.py +79 -0
  48. onboardrr-0.1.0/onboardrr/retirement.py +326 -0
  49. onboardrr-0.1.0/onboardrr/runs.py +300 -0
  50. onboardrr-0.1.0/onboardrr/runtime.py +58 -0
  51. onboardrr-0.1.0/onboardrr/secrets.py +202 -0
  52. onboardrr-0.1.0/onboardrr/ssh.py +224 -0
  53. onboardrr-0.1.0/onboardrr/ssh_retirement.py +49 -0
  54. onboardrr-0.1.0/onboardrr/stack_update.py +327 -0
  55. onboardrr-0.1.0/onboardrr/stacks.py +430 -0
  56. onboardrr-0.1.0/onboardrr/storage.py +165 -0
  57. onboardrr-0.1.0/onboardrr/sudo_input.py +67 -0
  58. onboardrr-0.1.0/onboardrr/termix.py +218 -0
  59. onboardrr-0.1.0/onboardrr/tui.py +1727 -0
  60. onboardrr-0.1.0/onboardrr/tui.tcss +385 -0
  61. onboardrr-0.1.0/onboardrr/tui_theme.py +72 -0
  62. onboardrr-0.1.0/onboardrr/usb_storage.py +57 -0
  63. onboardrr-0.1.0/onboardrr/verification.py +127 -0
  64. onboardrr-0.1.0/onboardrr/wifi.py +85 -0
  65. onboardrr-0.1.0/provisioning/collections.yml +4 -0
  66. onboardrr-0.1.0/provisioning/openbao/onboardrr-compose-bootstrap.hcl +4 -0
  67. onboardrr-0.1.0/provisioning/openbao/onboardrr-compose-host.hcl +29 -0
  68. onboardrr-0.1.0/provisioning/openbao/onboardrr-compose-managed.hcl +45 -0
  69. onboardrr-0.1.0/provisioning/openbao/onboardrr-periphery-retirement.hcl +3 -0
  70. onboardrr-0.1.0/provisioning/openbao/onboardrr-read.hcl +83 -0
  71. onboardrr-0.1.0/provisioning/prepare.yml +8 -0
  72. onboardrr-0.1.0/provisioning/requirements.txt +1 -0
  73. onboardrr-0.1.0/provisioning/roles/linux/defaults/main.yml +6 -0
  74. onboardrr-0.1.0/provisioning/roles/linux/files/docker-login.sh +18 -0
  75. onboardrr-0.1.0/provisioning/roles/linux/files/watch-komodo-core.sh +42 -0
  76. onboardrr-0.1.0/provisioning/roles/linux/tasks/bluetooth.yml +86 -0
  77. onboardrr-0.1.0/provisioning/roles/linux/tasks/compose_agent.yml +242 -0
  78. onboardrr-0.1.0/provisioning/roles/linux/tasks/goku_credentials.yml +139 -0
  79. onboardrr-0.1.0/provisioning/roles/linux/tasks/goku_mounts.yml +35 -0
  80. onboardrr-0.1.0/provisioning/roles/linux/tasks/install_openbao_agent.yml +162 -0
  81. onboardrr-0.1.0/provisioning/roles/linux/tasks/main.yml +376 -0
  82. onboardrr-0.1.0/provisioning/roles/linux/tasks/mount.yml +153 -0
  83. onboardrr-0.1.0/provisioning/roles/linux/tasks/server_docker.yml +14 -0
  84. onboardrr-0.1.0/provisioning/roles/linux/tasks/server_nvidia.yml +120 -0
  85. onboardrr-0.1.0/provisioning/roles/linux/tasks/server_vnc.yml +18 -0
  86. onboardrr-0.1.0/provisioning/roles/linux/tasks/shell_aliases.yml +50 -0
  87. onboardrr-0.1.0/provisioning/roles/linux/tasks/vendor_apt.yml +62 -0
  88. onboardrr-0.1.0/provisioning/roles/linux/templates/komodo-core.openbao.yaml.j2 +14 -0
  89. onboardrr-0.1.0/provisioning/roles/linux/templates/openbao-agent.compose.yaml.j2 +51 -0
  90. onboardrr-0.1.0/provisioning/wifi.yml +218 -0
  91. onboardrr-0.1.0/pyproject.toml +45 -0
  92. onboardrr-0.1.0/requirements.txt +3 -0
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .env
5
+ *.sqlite3
6
+ *.sqlite3-*
7
+ /build/
8
+ /dist/
9
+ /.coverage
10
+ /.coverage.*
@@ -0,0 +1,323 @@
1
+ Metadata-Version: 2.5
2
+ Name: onboardrr
3
+ Version: 0.1.0
4
+ Summary: Terminal inventory and provisioning controller for self-hosted devices
5
+ Project-URL: Repository, https://github.com/kinouzero/onboardrr
6
+ Project-URL: Releases, https://github.com/kinouzero/onboardrr/releases
7
+ Project-URL: Issues, https://github.com/kinouzero/onboardrr/issues
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: paramiko==4.0.0
10
+ Requires-Dist: pyyaml==6.0.3
11
+ Requires-Dist: textual==8.2.8
12
+ Provides-Extra: test
13
+ Requires-Dist: coverage<8,>=7.13; extra == 'test'
14
+ Description-Content-Type: text/markdown
15
+
16
+ # Onboardrr
17
+
18
+ Onboardrr is a self-hosted controller for preparing Linux devices and enrolling
19
+ them in Komodo and Pangolin. The CLI manages device inventory and run records,
20
+ previews a target over SSH, enrolls its operator key, and prepares its Komodo
21
+ registration. The Linux preparation playbook is available for test devices.
22
+
23
+ ## Install and launch
24
+
25
+ Install with [pipx](https://pipx.pypa.io/) on macOS or Linux:
26
+
27
+ ```sh
28
+ pipx install onboardrr
29
+ pipx ensurepath
30
+ onboardrr
31
+ ```
32
+
33
+ From any directory, `onboardrr` opens the TUI and `onboardrr --help` lists
34
+ CLI commands. Run `pipx install .` to install from a source checkout. The
35
+ checkout also supports `python3 -m onboardrr`
36
+ with Python 3.11 or later and the dependencies in `requirements.txt`.
37
+ Linux provisioning and Wi-Fi require an external `ansible-playbook` and
38
+ the collections in [provisioning/collections.yml](provisioning/collections.yml).
39
+
40
+ ### Download GitHub releases
41
+
42
+ Download a wheel or a native archive from [GitHub Releases](https://github.com/kinouzero/onboardrr/releases).
43
+ The [installer workflow](.github/workflows/build-installers.yml) builds Linux
44
+ x86-64 and ARM64 on Ubuntu 22.04 and macOS Intel and Apple Silicon on macOS
45
+ 15. Version tags publish the matching archives to GitHub Releases and the
46
+ Python distributions to PyPI. A manual run on `master` builds preview
47
+ artifacts. Each binary archive and wheel includes a SHA-256 checksum.
48
+
49
+ Install the wheel with `pipx install ./onboardrr-0.1.0-py3-none-any.whl`.
50
+ For a native archive, extract it and run `./onboardrr` or put the executable
51
+ in a directory on your `PATH`.
52
+
53
+ ### Build distributions
54
+
55
+ Run these from the checkout with Python 3.11 or later:
56
+
57
+ ```sh
58
+ python3 -m pip install -r requirements.txt build pyinstaller==6.22.3
59
+ python3 -m build
60
+ python3 -m PyInstaller --noconfirm distribution/onboardrr.spec
61
+ ```
62
+
63
+ The wheel in `dist/` can be installed with pipx. The standalone
64
+ `dist/onboardrr` executable includes Python and runs on its build platform.
65
+ Build it on macOS or Linux for the desired operating system and CPU
66
+ architecture. For Linux, build on the oldest glibc distribution you intend
67
+ to support. Place the executable in a directory on your `PATH` to use it
68
+ from any terminal.
69
+
70
+ ## Local usage
71
+
72
+ ```sh
73
+ onboardrr add lab-pi --user operator
74
+ onboardrr add lab-nas lab-nas.local --user operator --profile nas
75
+ onboardrr add lab-server lab-server.local --user operator --profile server
76
+ onboardrr set-profile lab-server raspberry-pi
77
+ onboardrr list
78
+ ```
79
+
80
+ ### Terminal interface
81
+
82
+ ```sh
83
+ onboardrr
84
+ ```
85
+
86
+ On macOS, the terminal interface follows the system appearance while open.
87
+ Graphite is the dark theme and the fallback when system appearance is
88
+ unavailable. Ivory is the light theme. Press **F7** to cycle through
89
+ Graphite, Ivory, and automatic mode for the current session.
90
+
91
+ The app opens on **Home**, where the selected host's checkpoint and
92
+ shortcuts to the wizard, Compose updates, and history are visible.
93
+ Select **Home** in the top bar to return from any subpage, including the
94
+ wizard and results.
95
+ Use **F2** to add a host, or **F3** to return to the inventory and **Enter** to
96
+ open the selected host's guided step. Use **Ctrl+P** to search for a screen or
97
+ action for the selected host. Use **Edit profile** from the host list or the
98
+ palette to correct the profile. Profile changes keep the host's identity and history.
99
+ Switching between Linux and QNAP starts a new workflow when the host already
100
+ has a provisioning run. **Continue** shows the next action for its profile
101
+ and saved checkpoint. Choose **Steps** for a different provisioning action.
102
+ Use **Preview** to check readiness and **Apply** to confirm changes.
103
+ **Steps** lists actions in execution order. **Install Docker**
104
+ includes Docker Hub authentication. **Configure Goku** prepares the
105
+ deployment files, the NFS export, and the SMB and NFS mounts.
106
+
107
+ For a Raspberry Pi with USB storage, choose **Mount USB storage**, load its
108
+ USB devices, and select the data volume. The same step is available as an
109
+ opt-in in **Auto**. Apply mounts it at `~/ssd` in the SSH user's home on the
110
+ Raspberry Pi and adds a UUID entry for systemd automount. Boot can continue
111
+ if the drive is disconnected.
112
+ Unmount a volume already mounted at another location before applying.
113
+
114
+ For the JMicron USB-to-SATA bridge `152d:1561`, Mount and Format first
115
+ configure the Raspberry Pi to use `usb-storage` instead of UAS. Onboardrr
116
+ backs up the boot command line and preserves quirks for other adapters. When
117
+ the fallback is pending, reboot the Pi and apply the same step again. An
118
+ automatic installation stops at the USB step until the fallback is active.
119
+
120
+ Use **Maintenance → Unmount USB storage** to detach a selected volume and
121
+ stop its active Onboardrr automount for the current boot. Its UUID entry in
122
+ `/etc/fstab` stays in place. The CLI option is `--usb-device VOLUME --unmount
123
+ --apply`. Close files on the volume before applying.
124
+
125
+ In **Maintenance → Format USB storage**, select a volume and confirm the
126
+ dialog showing its host and device path. The action unmounts the volume,
127
+ erases its data, and mounts the new ext4 filesystem at `~/ssd` by default.
128
+ USB formatting uses ordinary writes in place of discard and block zeroing requests.
129
+ Close any files on the volume so that it can be unmounted. Use `--mount-point`
130
+ to choose another directory directly under that user's home or `/mnt`. The CLI equivalents are
131
+ `onboardrr usb-storage DEVICE --public-key PATH`, with `--usb-device VOLUME
132
+ --apply` to mount or `--usb-device VOLUME --format --confirm-device VOLUME
133
+ --apply` to format.
134
+
135
+ Commands stream their logs into **Results**. The overall bar counts selected
136
+ components processed by an automatic run. The current-step bar animates until
137
+ the command reports that the step has finished. SSH, sudo, and Wi-Fi prompts
138
+ open inside the interface. Results also show the first blocker and the last
139
+ 20 executions of the session. Use **Esc** to return to the form and **F6**
140
+ to reopen results. **Maintenance** groups routine operations and
141
+ **History** shows saved provisioning runs.
142
+
143
+ Use **F1** for command help, **F5** to refresh the inventory, and **F10**
144
+ to exit. Open **Options** for extra arguments or **CLI** to run another
145
+ Onboardrr subcommand. Enter the target's sudo password once in the masked
146
+ **Host sudo password** field to use it throughout a run.
147
+ Leave the field blank for passwordless sudo. The CLI also supports
148
+ `--ask-become-pass` for a masked prompt. To open a different inventory,
149
+ pass `--database PATH` before `tui`.
150
+
151
+ Open **Wizard** from the dashboard or **Auto** from the action screens to
152
+ install or uninstall several components in one run. The wizard starts with
153
+ the profile's component defaults, then presents the connection settings and
154
+ the review. **Preview** checks the selection and opens the results.
155
+ **Install selection** starts installation. **Uninstall selection**
156
+ opens a removal confirmation. Return from the results to adjust the selection
157
+ or settings. Installation resumes from the recorded checkpoint.
158
+
159
+ The **SSH public key** picker lists files in `~/.ssh/`. Choose **Other file…**
160
+ to enter a different path. Set
161
+ `ONBOARDRR_TUI_PUBLIC_KEY` and `ONBOARDRR_TUI_KNOWN_HOSTS` to prefill the
162
+ SSH paths. The interface inherits the existing CLI environment, including
163
+ OpenBao and service settings.
164
+
165
+ The device name identifies the record independently of its SSH endpoint.
166
+ Omit the address in `add` or leave the address field blank in the terminal
167
+ form to use `<name>.local`. Update an existing address with
168
+ `onboardrr set-host lab-pi lab-pi.local` to keep the same device and run history.
169
+ Conflicting names and SSH endpoints return an error. The inventory does not
170
+ resolve DNS or contact a host.
171
+
172
+ The CLI prints JSON and stores its database at
173
+ `$XDG_STATE_HOME/onboardrr/inventory.sqlite3`, using
174
+ `~/.local/state/onboardrr/inventory.sqlite3` when the environment variable is
175
+ unset or relative. Use `--database PATH` before the command to select a different
176
+ file.
177
+
178
+ ### SSH preflight and key enrollment
179
+
180
+ Install the SSH dependency in the controller environment with
181
+ `python3 -m pip install -r requirements.txt`. Add the target's verified host
182
+ key to an OpenSSH `known_hosts` file and load the operator identity in the local
183
+ SSH agent. If the inventory hostname cannot resolve, Onboardrr tries its local
184
+ OpenSSH `HostName` and checks the key against the inventory hostname and port.
185
+ The same fallback supplies IP addresses to integrations such as Pangolin and
186
+ Termix when they require an IP. A hostname with multiple matching addresses
187
+ still requires an explicit address.
188
+ Bootstrap the public key with the target's initial login and password.
189
+
190
+ ```sh
191
+ python3 -m onboardrr bootstrap-key lab-pi --public-key ~/.ssh/id_ed25519.pub
192
+ ```
193
+
194
+ This installs the key through the password-authenticated session and verifies it
195
+ through a second, key-only session. It can run before the central services are
196
+ configured. The password is prompted for in a terminal or can be piped in from
197
+ a trusted credential source with `--password-stdin`. In the terminal
198
+ interface, **Verify SSH** checks the enrolled key and records the SSH
199
+ checkpoint. The CLI equivalent is:
200
+
201
+ ```sh
202
+ python3 -m onboardrr preflight lab-pi --ssh-only --use-key \
203
+ --public-key ~/.ssh/id_ed25519.pub --apply-key
204
+ ```
205
+
206
+ Run the full preflight to check sudo and the central services from the target:
207
+
208
+ ```sh
209
+ python3 -m onboardrr preflight lab-pi \
210
+ --public-key ~/.ssh/id_ed25519.pub \
211
+ --goku-host goku.local --komodo-host komodo.example.org \
212
+ --pangolin-host pangolin.example.org
213
+ ```
214
+
215
+ The preflight queries SMB and NFS on Goku and HTTPS on Komodo and Pangolin from
216
+ the target and prints the planned steps. Re-run it with `--apply-key` to
217
+ complete the SSH checkpoint after those checks pass. Both commands use the SSH
218
+ port in the inventory and support `--known-hosts PATH` for a separate trust file.
219
+ After bootstrapping, pass `--use-key` to use the selected agent identity instead
220
+ of the initial SSH password. Add `--ask-become-pass` if sudo needs a password.
221
+
222
+ ### Start on Ethernet and add Wi-Fi later
223
+
224
+ For a first boot without Wi-Fi, enable SSH and configure the account when
225
+ writing the OS image. Plug the Pi into Ethernet, find its DHCP address, and
226
+ register that address or a name that resolves to it. Run `bootstrap-key` over
227
+ Ethernet. Once the adapter and WLAN country are configured, keep the cable
228
+ connected while checking and adding Wi-Fi:
229
+
230
+ ```sh
231
+ python3 -m onboardrr wifi lab-pi
232
+ python3 -m onboardrr wifi lab-pi --band 2G --apply --ask-become-pass
233
+ ```
234
+
235
+ The first command reads the current SSH route, adapter, and Wi-Fi status. The
236
+ second configures a persistent WPA2 Personal profile for the selected band
237
+ from a wired SSH session. Choose `2G` or `5G` in **Maintenance** → **Enable
238
+ Wi-Fi** in the TUI. The command preserves unrelated profiles and reports
239
+ the Wi-Fi address after activation. Verify SSH to that address before unplugging
240
+ Ethernet. The application leaves the registered endpoint unchanged.
241
+ See [Wi-Fi deployment settings](docs/integrations.md#wifi-after-ethernet-bootstrap).
242
+
243
+ ### Central services and Linux preparation
244
+
245
+ See [integration setup](docs/integrations.md) for OpenBao, the read-only
246
+ Komodo and Pangolin commands, the Komodo registration preview, the Periphery
247
+ configuration renderer, and the Ansible playbook for Docker and Goku mounts.
248
+ Use [outbound Periphery recovery](docs/integrations.md#recover-an-outbound-periphery-agent)
249
+ to restore an existing Komodo registration after reinstalling Linux.
250
+ See [NAS](docs/integrations.md#prepare-a-qnap-nas) and
251
+ [server](docs/integrations.md#prepare-a-linux-server) for their preparation commands.
252
+ See [primary NAS selection](docs/integrations.md#choose-the-primary-storage-nas)
253
+ to switch the Compose and Komodo storage endpoint.
254
+
255
+ The TUI actions **Deploy baseline stacks** and **Add to monitoring tools**
256
+ preview changes before applying them. Baseline deployment
257
+ selects compatible Docker Hub image tags using WUD labels. Monitoring uses
258
+ Komodo variables to enroll hosts in Beszel, WUD, Prometheus, and Dozzle.
259
+ See [baseline stacks](docs/integrations.md#deploy-the-baseline-komodo-stacks)
260
+ and [monitoring setup](docs/integrations.md#enroll-devices-in-central-monitoring).
261
+
262
+ ### Update selected Compose files
263
+
264
+ ```sh
265
+ python3 -m onboardrr compose-update lab-pi --list-files --public-key ~/.ssh/id_ed25519.pub
266
+ python3 -m onboardrr compose-update lab-pi --file compose.yaml --file media/docker-compose.yml \
267
+ --public-key ~/.ssh/id_ed25519.pub --apply
268
+ ```
269
+
270
+ The terminal's Maintenance menu lets you select multiple files from the
271
+ host's default Compose directory. Its **Apply and deploy** button
272
+ edits the files directly and redeploys the affected running services.
273
+ Add `--deploy` to the CLI command for the same behavior.
274
+ See [Compose maintenance](docs/integrations.md#update-existing-compose-projects).
275
+
276
+ ### Run history
277
+
278
+ The terminal shows operation progress alongside the result. To enable
279
+ the same timestamped progress in the CLI, add `--verbose` before the
280
+ subcommand. Progress goes to stderr and the JSON result goes to stdout.
281
+
282
+ ```sh
283
+ python3 -m onboardrr run open lab-pi
284
+ python3 -m onboardrr run list lab-pi
285
+ python3 -m onboardrr run show RUN_ID
286
+ ```
287
+
288
+ Use the ID printed by `run open` in `run show`. Opening a run creates a local
289
+ record or returns the existing unfinished run and its next step. These commands
290
+ operate only on SQLite. Existing inventory databases migrate automatically.
291
+
292
+ `python3 -m onboardrr verify lab-pi --public-key ~/.ssh/id_ed25519.pub` checks
293
+ the mounts, local Docker and Compose, Periphery, Komodo stacks, and Pangolin.
294
+ Add `--apply` to record successful verification or a failed checkpoint.
295
+ Use the integration API environment or add `--ssh-target` for private Pangolin.
296
+ Once Newt connects, enrollment reconciles the device's private `<device>.pang`
297
+ host route and its peer site assignments. See
298
+ [private host routes](docs/integrations.md#reconcile-private-host-routes)
299
+ for preview and apply commands for existing sites.
300
+
301
+ `python3 -m onboardrr retire lab-pi` previews recorded resources in retirement
302
+ order. Add `--purge` to preview deletion of tracked Goku data directories.
303
+ `retire lab-pi --apply` removes recorded monitoring entries and owned Komodo
304
+ baseline stacks when eligible, preserving volumes. See [retirement and Goku purge](docs/integrations.md#retire-a-linux-device)
305
+ for Pangolin site removal and the separate opt-in purge.
306
+
307
+ ## Verification
308
+
309
+ ```sh
310
+ python3 -m unittest discover -s tests -v
311
+ ```
312
+
313
+ To measure statement and branch coverage, including supported Python
314
+ subprocesses, install the optional test dependency and run:
315
+
316
+ ```sh
317
+ python3 -m pip install -e '.[test]'
318
+ python3 -m coverage run -m unittest discover -s tests -q
319
+ python3 -m coverage report -m
320
+ ```
321
+
322
+ See the [MVP architecture](docs/architecture.md) for the first target and
323
+ integration milestones.
@@ -0,0 +1,308 @@
1
+ # Onboardrr
2
+
3
+ Onboardrr is a self-hosted controller for preparing Linux devices and enrolling
4
+ them in Komodo and Pangolin. The CLI manages device inventory and run records,
5
+ previews a target over SSH, enrolls its operator key, and prepares its Komodo
6
+ registration. The Linux preparation playbook is available for test devices.
7
+
8
+ ## Install and launch
9
+
10
+ Install with [pipx](https://pipx.pypa.io/) on macOS or Linux:
11
+
12
+ ```sh
13
+ pipx install onboardrr
14
+ pipx ensurepath
15
+ onboardrr
16
+ ```
17
+
18
+ From any directory, `onboardrr` opens the TUI and `onboardrr --help` lists
19
+ CLI commands. Run `pipx install .` to install from a source checkout. The
20
+ checkout also supports `python3 -m onboardrr`
21
+ with Python 3.11 or later and the dependencies in `requirements.txt`.
22
+ Linux provisioning and Wi-Fi require an external `ansible-playbook` and
23
+ the collections in [provisioning/collections.yml](provisioning/collections.yml).
24
+
25
+ ### Download GitHub releases
26
+
27
+ Download a wheel or a native archive from [GitHub Releases](https://github.com/kinouzero/onboardrr/releases).
28
+ The [installer workflow](.github/workflows/build-installers.yml) builds Linux
29
+ x86-64 and ARM64 on Ubuntu 22.04 and macOS Intel and Apple Silicon on macOS
30
+ 15. Version tags publish the matching archives to GitHub Releases and the
31
+ Python distributions to PyPI. A manual run on `master` builds preview
32
+ artifacts. Each binary archive and wheel includes a SHA-256 checksum.
33
+
34
+ Install the wheel with `pipx install ./onboardrr-0.1.0-py3-none-any.whl`.
35
+ For a native archive, extract it and run `./onboardrr` or put the executable
36
+ in a directory on your `PATH`.
37
+
38
+ ### Build distributions
39
+
40
+ Run these from the checkout with Python 3.11 or later:
41
+
42
+ ```sh
43
+ python3 -m pip install -r requirements.txt build pyinstaller==6.22.3
44
+ python3 -m build
45
+ python3 -m PyInstaller --noconfirm distribution/onboardrr.spec
46
+ ```
47
+
48
+ The wheel in `dist/` can be installed with pipx. The standalone
49
+ `dist/onboardrr` executable includes Python and runs on its build platform.
50
+ Build it on macOS or Linux for the desired operating system and CPU
51
+ architecture. For Linux, build on the oldest glibc distribution you intend
52
+ to support. Place the executable in a directory on your `PATH` to use it
53
+ from any terminal.
54
+
55
+ ## Local usage
56
+
57
+ ```sh
58
+ onboardrr add lab-pi --user operator
59
+ onboardrr add lab-nas lab-nas.local --user operator --profile nas
60
+ onboardrr add lab-server lab-server.local --user operator --profile server
61
+ onboardrr set-profile lab-server raspberry-pi
62
+ onboardrr list
63
+ ```
64
+
65
+ ### Terminal interface
66
+
67
+ ```sh
68
+ onboardrr
69
+ ```
70
+
71
+ On macOS, the terminal interface follows the system appearance while open.
72
+ Graphite is the dark theme and the fallback when system appearance is
73
+ unavailable. Ivory is the light theme. Press **F7** to cycle through
74
+ Graphite, Ivory, and automatic mode for the current session.
75
+
76
+ The app opens on **Home**, where the selected host's checkpoint and
77
+ shortcuts to the wizard, Compose updates, and history are visible.
78
+ Select **Home** in the top bar to return from any subpage, including the
79
+ wizard and results.
80
+ Use **F2** to add a host, or **F3** to return to the inventory and **Enter** to
81
+ open the selected host's guided step. Use **Ctrl+P** to search for a screen or
82
+ action for the selected host. Use **Edit profile** from the host list or the
83
+ palette to correct the profile. Profile changes keep the host's identity and history.
84
+ Switching between Linux and QNAP starts a new workflow when the host already
85
+ has a provisioning run. **Continue** shows the next action for its profile
86
+ and saved checkpoint. Choose **Steps** for a different provisioning action.
87
+ Use **Preview** to check readiness and **Apply** to confirm changes.
88
+ **Steps** lists actions in execution order. **Install Docker**
89
+ includes Docker Hub authentication. **Configure Goku** prepares the
90
+ deployment files, the NFS export, and the SMB and NFS mounts.
91
+
92
+ For a Raspberry Pi with USB storage, choose **Mount USB storage**, load its
93
+ USB devices, and select the data volume. The same step is available as an
94
+ opt-in in **Auto**. Apply mounts it at `~/ssd` in the SSH user's home on the
95
+ Raspberry Pi and adds a UUID entry for systemd automount. Boot can continue
96
+ if the drive is disconnected.
97
+ Unmount a volume already mounted at another location before applying.
98
+
99
+ For the JMicron USB-to-SATA bridge `152d:1561`, Mount and Format first
100
+ configure the Raspberry Pi to use `usb-storage` instead of UAS. Onboardrr
101
+ backs up the boot command line and preserves quirks for other adapters. When
102
+ the fallback is pending, reboot the Pi and apply the same step again. An
103
+ automatic installation stops at the USB step until the fallback is active.
104
+
105
+ Use **Maintenance → Unmount USB storage** to detach a selected volume and
106
+ stop its active Onboardrr automount for the current boot. Its UUID entry in
107
+ `/etc/fstab` stays in place. The CLI option is `--usb-device VOLUME --unmount
108
+ --apply`. Close files on the volume before applying.
109
+
110
+ In **Maintenance → Format USB storage**, select a volume and confirm the
111
+ dialog showing its host and device path. The action unmounts the volume,
112
+ erases its data, and mounts the new ext4 filesystem at `~/ssd` by default.
113
+ USB formatting uses ordinary writes in place of discard and block zeroing requests.
114
+ Close any files on the volume so that it can be unmounted. Use `--mount-point`
115
+ to choose another directory directly under that user's home or `/mnt`. The CLI equivalents are
116
+ `onboardrr usb-storage DEVICE --public-key PATH`, with `--usb-device VOLUME
117
+ --apply` to mount or `--usb-device VOLUME --format --confirm-device VOLUME
118
+ --apply` to format.
119
+
120
+ Commands stream their logs into **Results**. The overall bar counts selected
121
+ components processed by an automatic run. The current-step bar animates until
122
+ the command reports that the step has finished. SSH, sudo, and Wi-Fi prompts
123
+ open inside the interface. Results also show the first blocker and the last
124
+ 20 executions of the session. Use **Esc** to return to the form and **F6**
125
+ to reopen results. **Maintenance** groups routine operations and
126
+ **History** shows saved provisioning runs.
127
+
128
+ Use **F1** for command help, **F5** to refresh the inventory, and **F10**
129
+ to exit. Open **Options** for extra arguments or **CLI** to run another
130
+ Onboardrr subcommand. Enter the target's sudo password once in the masked
131
+ **Host sudo password** field to use it throughout a run.
132
+ Leave the field blank for passwordless sudo. The CLI also supports
133
+ `--ask-become-pass` for a masked prompt. To open a different inventory,
134
+ pass `--database PATH` before `tui`.
135
+
136
+ Open **Wizard** from the dashboard or **Auto** from the action screens to
137
+ install or uninstall several components in one run. The wizard starts with
138
+ the profile's component defaults, then presents the connection settings and
139
+ the review. **Preview** checks the selection and opens the results.
140
+ **Install selection** starts installation. **Uninstall selection**
141
+ opens a removal confirmation. Return from the results to adjust the selection
142
+ or settings. Installation resumes from the recorded checkpoint.
143
+
144
+ The **SSH public key** picker lists files in `~/.ssh/`. Choose **Other file…**
145
+ to enter a different path. Set
146
+ `ONBOARDRR_TUI_PUBLIC_KEY` and `ONBOARDRR_TUI_KNOWN_HOSTS` to prefill the
147
+ SSH paths. The interface inherits the existing CLI environment, including
148
+ OpenBao and service settings.
149
+
150
+ The device name identifies the record independently of its SSH endpoint.
151
+ Omit the address in `add` or leave the address field blank in the terminal
152
+ form to use `<name>.local`. Update an existing address with
153
+ `onboardrr set-host lab-pi lab-pi.local` to keep the same device and run history.
154
+ Conflicting names and SSH endpoints return an error. The inventory does not
155
+ resolve DNS or contact a host.
156
+
157
+ The CLI prints JSON and stores its database at
158
+ `$XDG_STATE_HOME/onboardrr/inventory.sqlite3`, using
159
+ `~/.local/state/onboardrr/inventory.sqlite3` when the environment variable is
160
+ unset or relative. Use `--database PATH` before the command to select a different
161
+ file.
162
+
163
+ ### SSH preflight and key enrollment
164
+
165
+ Install the SSH dependency in the controller environment with
166
+ `python3 -m pip install -r requirements.txt`. Add the target's verified host
167
+ key to an OpenSSH `known_hosts` file and load the operator identity in the local
168
+ SSH agent. If the inventory hostname cannot resolve, Onboardrr tries its local
169
+ OpenSSH `HostName` and checks the key against the inventory hostname and port.
170
+ The same fallback supplies IP addresses to integrations such as Pangolin and
171
+ Termix when they require an IP. A hostname with multiple matching addresses
172
+ still requires an explicit address.
173
+ Bootstrap the public key with the target's initial login and password.
174
+
175
+ ```sh
176
+ python3 -m onboardrr bootstrap-key lab-pi --public-key ~/.ssh/id_ed25519.pub
177
+ ```
178
+
179
+ This installs the key through the password-authenticated session and verifies it
180
+ through a second, key-only session. It can run before the central services are
181
+ configured. The password is prompted for in a terminal or can be piped in from
182
+ a trusted credential source with `--password-stdin`. In the terminal
183
+ interface, **Verify SSH** checks the enrolled key and records the SSH
184
+ checkpoint. The CLI equivalent is:
185
+
186
+ ```sh
187
+ python3 -m onboardrr preflight lab-pi --ssh-only --use-key \
188
+ --public-key ~/.ssh/id_ed25519.pub --apply-key
189
+ ```
190
+
191
+ Run the full preflight to check sudo and the central services from the target:
192
+
193
+ ```sh
194
+ python3 -m onboardrr preflight lab-pi \
195
+ --public-key ~/.ssh/id_ed25519.pub \
196
+ --goku-host goku.local --komodo-host komodo.example.org \
197
+ --pangolin-host pangolin.example.org
198
+ ```
199
+
200
+ The preflight queries SMB and NFS on Goku and HTTPS on Komodo and Pangolin from
201
+ the target and prints the planned steps. Re-run it with `--apply-key` to
202
+ complete the SSH checkpoint after those checks pass. Both commands use the SSH
203
+ port in the inventory and support `--known-hosts PATH` for a separate trust file.
204
+ After bootstrapping, pass `--use-key` to use the selected agent identity instead
205
+ of the initial SSH password. Add `--ask-become-pass` if sudo needs a password.
206
+
207
+ ### Start on Ethernet and add Wi-Fi later
208
+
209
+ For a first boot without Wi-Fi, enable SSH and configure the account when
210
+ writing the OS image. Plug the Pi into Ethernet, find its DHCP address, and
211
+ register that address or a name that resolves to it. Run `bootstrap-key` over
212
+ Ethernet. Once the adapter and WLAN country are configured, keep the cable
213
+ connected while checking and adding Wi-Fi:
214
+
215
+ ```sh
216
+ python3 -m onboardrr wifi lab-pi
217
+ python3 -m onboardrr wifi lab-pi --band 2G --apply --ask-become-pass
218
+ ```
219
+
220
+ The first command reads the current SSH route, adapter, and Wi-Fi status. The
221
+ second configures a persistent WPA2 Personal profile for the selected band
222
+ from a wired SSH session. Choose `2G` or `5G` in **Maintenance** → **Enable
223
+ Wi-Fi** in the TUI. The command preserves unrelated profiles and reports
224
+ the Wi-Fi address after activation. Verify SSH to that address before unplugging
225
+ Ethernet. The application leaves the registered endpoint unchanged.
226
+ See [Wi-Fi deployment settings](docs/integrations.md#wifi-after-ethernet-bootstrap).
227
+
228
+ ### Central services and Linux preparation
229
+
230
+ See [integration setup](docs/integrations.md) for OpenBao, the read-only
231
+ Komodo and Pangolin commands, the Komodo registration preview, the Periphery
232
+ configuration renderer, and the Ansible playbook for Docker and Goku mounts.
233
+ Use [outbound Periphery recovery](docs/integrations.md#recover-an-outbound-periphery-agent)
234
+ to restore an existing Komodo registration after reinstalling Linux.
235
+ See [NAS](docs/integrations.md#prepare-a-qnap-nas) and
236
+ [server](docs/integrations.md#prepare-a-linux-server) for their preparation commands.
237
+ See [primary NAS selection](docs/integrations.md#choose-the-primary-storage-nas)
238
+ to switch the Compose and Komodo storage endpoint.
239
+
240
+ The TUI actions **Deploy baseline stacks** and **Add to monitoring tools**
241
+ preview changes before applying them. Baseline deployment
242
+ selects compatible Docker Hub image tags using WUD labels. Monitoring uses
243
+ Komodo variables to enroll hosts in Beszel, WUD, Prometheus, and Dozzle.
244
+ See [baseline stacks](docs/integrations.md#deploy-the-baseline-komodo-stacks)
245
+ and [monitoring setup](docs/integrations.md#enroll-devices-in-central-monitoring).
246
+
247
+ ### Update selected Compose files
248
+
249
+ ```sh
250
+ python3 -m onboardrr compose-update lab-pi --list-files --public-key ~/.ssh/id_ed25519.pub
251
+ python3 -m onboardrr compose-update lab-pi --file compose.yaml --file media/docker-compose.yml \
252
+ --public-key ~/.ssh/id_ed25519.pub --apply
253
+ ```
254
+
255
+ The terminal's Maintenance menu lets you select multiple files from the
256
+ host's default Compose directory. Its **Apply and deploy** button
257
+ edits the files directly and redeploys the affected running services.
258
+ Add `--deploy` to the CLI command for the same behavior.
259
+ See [Compose maintenance](docs/integrations.md#update-existing-compose-projects).
260
+
261
+ ### Run history
262
+
263
+ The terminal shows operation progress alongside the result. To enable
264
+ the same timestamped progress in the CLI, add `--verbose` before the
265
+ subcommand. Progress goes to stderr and the JSON result goes to stdout.
266
+
267
+ ```sh
268
+ python3 -m onboardrr run open lab-pi
269
+ python3 -m onboardrr run list lab-pi
270
+ python3 -m onboardrr run show RUN_ID
271
+ ```
272
+
273
+ Use the ID printed by `run open` in `run show`. Opening a run creates a local
274
+ record or returns the existing unfinished run and its next step. These commands
275
+ operate only on SQLite. Existing inventory databases migrate automatically.
276
+
277
+ `python3 -m onboardrr verify lab-pi --public-key ~/.ssh/id_ed25519.pub` checks
278
+ the mounts, local Docker and Compose, Periphery, Komodo stacks, and Pangolin.
279
+ Add `--apply` to record successful verification or a failed checkpoint.
280
+ Use the integration API environment or add `--ssh-target` for private Pangolin.
281
+ Once Newt connects, enrollment reconciles the device's private `<device>.pang`
282
+ host route and its peer site assignments. See
283
+ [private host routes](docs/integrations.md#reconcile-private-host-routes)
284
+ for preview and apply commands for existing sites.
285
+
286
+ `python3 -m onboardrr retire lab-pi` previews recorded resources in retirement
287
+ order. Add `--purge` to preview deletion of tracked Goku data directories.
288
+ `retire lab-pi --apply` removes recorded monitoring entries and owned Komodo
289
+ baseline stacks when eligible, preserving volumes. See [retirement and Goku purge](docs/integrations.md#retire-a-linux-device)
290
+ for Pangolin site removal and the separate opt-in purge.
291
+
292
+ ## Verification
293
+
294
+ ```sh
295
+ python3 -m unittest discover -s tests -v
296
+ ```
297
+
298
+ To measure statement and branch coverage, including supported Python
299
+ subprocesses, install the optional test dependency and run:
300
+
301
+ ```sh
302
+ python3 -m pip install -e '.[test]'
303
+ python3 -m coverage run -m unittest discover -s tests -q
304
+ python3 -m coverage report -m
305
+ ```
306
+
307
+ See the [MVP architecture](docs/architecture.md) for the first target and
308
+ integration milestones.
@@ -0,0 +1,7 @@
1
+ """Entry point for the standalone Onboardrr executable."""
2
+
3
+ from onboardrr.__main__ import entrypoint
4
+
5
+
6
+ if __name__ == "__main__":
7
+ raise SystemExit(entrypoint())
@@ -0,0 +1,31 @@
1
+ """Build a standalone executable on the target operating system."""
2
+
3
+ from pathlib import Path
4
+
5
+ from PyInstaller.utils.hooks import collect_data_files, collect_submodules, copy_metadata
6
+
7
+ root = Path(SPECPATH).parent
8
+ analysis = Analysis(
9
+ [str(root / "distribution" / "entrypoint.py")],
10
+ pathex=[str(root)],
11
+ datas=[
12
+ (str(root / "onboardrr" / "tui.tcss"), "onboardrr"),
13
+ *((str(script), "onboardrr/remote")
14
+ for script in (root / "onboardrr" / "remote").iterdir()
15
+ if script.suffix in {".py", ".sh"}),
16
+ (str(root / "provisioning"), "onboardrr/provisioning"),
17
+ *collect_data_files("textual"),
18
+ *copy_metadata("textual"),
19
+ ],
20
+ hiddenimports=[
21
+ *collect_submodules("rich._unicode_data"),
22
+ *collect_submodules("textual.widgets"),
23
+ *collect_submodules("textual.drivers"),
24
+ ],
25
+ )
26
+ archive = PYZ(analysis.pure)
27
+ executable = EXE(
28
+ archive, analysis.scripts, analysis.binaries, analysis.datas,
29
+ name="onboardrr",
30
+ console=True,
31
+ )