pyhubblenetwork 0.13.0__tar.gz → 0.14.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.
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/PKG-INFO +224 -26
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/README.md +220 -22
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/plugins/pyhubblenetwork/skills/hubble-ready-test/README.md +1 -1
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/pyproject.toml +3 -3
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/__init__.py +1 -1
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/ble.py +8 -4
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/cli.py +1702 -276
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/cloud.py +20 -4
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/crypto.py +3 -3
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/detect.py +4 -3
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/org.py +75 -35
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/packets.py +20 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/ready.py +2 -1
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/sat.py +4 -5
- pyhubblenetwork-0.14.0/src/hubblenetwork/termcaps.py +173 -0
- pyhubblenetwork-0.14.0/tests/conftest.py +17 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_aes_eax.py +6 -2
- pyhubblenetwork-0.14.0/tests/test_cli_doctor.py +186 -0
- pyhubblenetwork-0.14.0/tests/test_cli_help_and_errors.py +376 -0
- pyhubblenetwork-0.14.0/tests/test_cli_org_display.py +346 -0
- pyhubblenetwork-0.14.0/tests/test_cli_scan_display.py +423 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_org_delete_device.py +6 -3
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_register_device_cloud.py +61 -2
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_register_device_validation.py +18 -2
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_sat.py +2 -2
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_sat_decrypt.py +3 -3
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_sat_integration.py +1 -1
- pyhubblenetwork-0.14.0/tests/test_terminal_compat.py +379 -0
- pyhubblenetwork-0.13.0/tests/conftest.py +0 -1
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/.gitignore +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/LICENSE +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/device.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/src/hubblenetwork/errors.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/__init__.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_ble_validate.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_cli_ctr_autodetect.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_cli_payload.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_cloud_integration.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_counter_eid.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_detect.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_metrics.py +0 -0
- {pyhubblenetwork-0.13.0 → pyhubblenetwork-0.14.0}/tests/test_unencrypted.py +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: pyhubblenetwork
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.14.0
|
|
4
4
|
Summary: Hubble SDK host-side tools
|
|
5
5
|
Author-email: Paul Buckley <paul@hubble.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Classifier: Operating System :: OS Independent
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
|
10
|
-
Requires-Python: >=3.
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
11
|
Requires-Dist: bleak
|
|
12
|
-
Requires-Dist: click
|
|
12
|
+
Requires-Dist: click<9,>=8.2
|
|
13
13
|
Requires-Dist: docker>=7.0
|
|
14
14
|
Requires-Dist: httpx>=0.27
|
|
15
15
|
Requires-Dist: pycryptodome
|
|
@@ -43,6 +43,7 @@ Description-Content-Type: text/markdown
|
|
|
43
43
|
- [Public API (summary)](#public-api-summary)
|
|
44
44
|
- [Development & tests](#development--tests)
|
|
45
45
|
- [Troubleshooting](#troubleshooting)
|
|
46
|
+
- [Telemetry](#telemetry)
|
|
46
47
|
- [Releases & versioning](#releases--versioning)
|
|
47
48
|
|
|
48
49
|
|
|
@@ -55,9 +56,13 @@ Description-Content-Type: text/markdown
|
|
|
55
56
|
|
|
56
57
|
## Requirements & supported platforms
|
|
57
58
|
|
|
58
|
-
- Python **3.
|
|
59
|
+
- Python **3.10+** (3.11/3.12 recommended)
|
|
59
60
|
- BLE platform prerequisites (only needed if you use `ble.scan()`):
|
|
60
|
-
- **macOS**: CoreBluetooth
|
|
61
|
+
- **macOS**: CoreBluetooth. Run from a real terminal app and grant it Bluetooth
|
|
62
|
+
access when prompted. macOS kills any process whose executable has no
|
|
63
|
+
`NSBluetoothAlwaysUsageDescription` in an Info.plist, and a bare Python binary
|
|
64
|
+
has none — see [Troubleshooting](#troubleshooting) if you hit a crash rather
|
|
65
|
+
than a permission prompt.
|
|
61
66
|
- **Linux**: BlueZ required; user must have permission to access the BLE adapter (often `bluetooth` group).
|
|
62
67
|
- **Windows**: Requires a compatible BLE stack/adapter.
|
|
63
68
|
- Satellite scanning prerequisites (only needed if you use `sat.scan()`):
|
|
@@ -76,10 +81,9 @@ pipx install pyhubblenetwork
|
|
|
76
81
|
|
|
77
82
|
### Developers (editable install)
|
|
78
83
|
|
|
79
|
-
From the repo root
|
|
84
|
+
From the repo root:
|
|
80
85
|
|
|
81
86
|
```bash
|
|
82
|
-
cd python
|
|
83
87
|
python3 -m venv .venv && source .venv/bin/activate
|
|
84
88
|
pip install -e '.[dev]'
|
|
85
89
|
```
|
|
@@ -158,7 +162,7 @@ for pkt in sat.scan(timeout=60.0):
|
|
|
158
162
|
|
|
159
163
|
Docker must be running before calling `sat.scan()`. The PlutoSDR dongle must be connected.
|
|
160
164
|
|
|
161
|
-
## CLI usage
|
|
165
|
+
## CLI usage
|
|
162
166
|
|
|
163
167
|
If installed, the `hubblenetwork` command is available:
|
|
164
168
|
|
|
@@ -167,18 +171,149 @@ hubblenetwork --help
|
|
|
167
171
|
hubblenetwork ble scan
|
|
168
172
|
hubblenetwork ble scan --payload-format hex
|
|
169
173
|
hubblenetwork ble scan --key "base64key=" --counter-mode DEVICE_UPTIME # counter-based EID
|
|
170
|
-
hubblenetwork org get-packets --payload-format string
|
|
174
|
+
hubblenetwork org get-packets <id> --payload-format string
|
|
171
175
|
```
|
|
172
176
|
|
|
177
|
+
Start with `hubblenetwork doctor`, which checks whether this machine can actually
|
|
178
|
+
talk to Hubble and names the fix for anything broken:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
hubblenetwork doctor
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
x Credentials not set
|
|
186
|
+
Set both, or pass --org-id/--token:
|
|
187
|
+
export HUBBLE_ORG_ID=<your org id>
|
|
188
|
+
export HUBBLE_API_TOKEN=<your api token>
|
|
189
|
+
+ Bluetooth usage description present
|
|
190
|
+
x Docker Docker is not available
|
|
191
|
+
Only `sat` commands need Docker.
|
|
192
|
+
|
|
193
|
+
Not ready. | 1 ok | 2 failed
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
It exits 1 when something needed is broken, so a script can gate on it. A skipped
|
|
197
|
+
check is not a failure: it means the check does not apply on this platform, or could
|
|
198
|
+
not be answered without doing real work (pulling the satellite receiver image, say).
|
|
199
|
+
The Bluetooth check reads the interpreter's Info.plist rather than attempting a scan,
|
|
200
|
+
because attempting one is exactly what macOS kills.
|
|
201
|
+
|
|
202
|
+
Every command lives inside a group, so it is always `hubblenetwork <group> <command>`:
|
|
203
|
+
`org` for the cloud, `ble` for nearby devices, `ready` for provisioning, `sat` for
|
|
204
|
+
satellite, `metrics` for fleet counts. `hubblenetwork --help` prints the full list with
|
|
205
|
+
a one-line description and the required arguments for each, and every command takes
|
|
206
|
+
`--help` for its own options.
|
|
207
|
+
|
|
208
|
+
You don't have to remember which group a command is in. If you type one at the wrong
|
|
209
|
+
level the CLI finds it for you:
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
$ hubblenetwork list-devices
|
|
213
|
+
|
|
214
|
+
Usage: hubblenetwork [OPTIONS] COMMAND [ARGS]...
|
|
215
|
+
Try 'hubblenetwork --help' for help.
|
|
216
|
+
|
|
217
|
+
Error: No such command 'list-devices'.
|
|
218
|
+
|
|
219
|
+
Did you mean: hubblenetwork org list-devices
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
The same applies to missing arguments (they say how to find the value), unknown options
|
|
223
|
+
(they list what the command accepts), and missing credentials (they name the environment
|
|
224
|
+
variables and the flags). `validate-credentials` exits 1 when credentials are invalid, so
|
|
225
|
+
scripts can branch on it.
|
|
226
|
+
|
|
173
227
|
### Payload format option
|
|
174
228
|
|
|
175
|
-
Commands that output packet data (`ble scan`, `ble detect`, `org get-packets`) support the `--payload-format` flag to control how payloads are displayed:
|
|
229
|
+
Commands that output packet data (`ble scan`, `sat scan`, `ble detect`, `org get-packets`) support the `--payload-format` flag to control how payloads are displayed:
|
|
176
230
|
|
|
177
|
-
* `
|
|
231
|
+
* `auto` — printable ASCII shows as text, anything else as uppercase hex
|
|
232
|
+
* `base64` — encode payloads as base64
|
|
178
233
|
* `hex` — display payloads as hexadecimal
|
|
179
234
|
* `string` — decode payloads as UTF-8 text (falls back to `<invalid UTF-8>` if bytes are not valid UTF-8)
|
|
180
235
|
|
|
181
|
-
|
|
236
|
+
All four values work with every output format, but the **default** differs by
|
|
237
|
+
format, because a person and a program want different things. Tabular output
|
|
238
|
+
defaults to `auto`, so a decrypted payload reads as `T=21.4` rather than
|
|
239
|
+
`VD0yMS40`. JSON and CSV default to `base64` so the machine contract stays
|
|
240
|
+
stable. An explicit `--payload-format` always wins.
|
|
241
|
+
|
|
242
|
+
### Organization commands
|
|
243
|
+
|
|
244
|
+
`org list-devices` and `org get-packets` stream rows as pages arrive, so the first
|
|
245
|
+
rows appear in about a second rather than after the whole window downloads. A busy
|
|
246
|
+
device can hold tens of thousands of packets; Ctrl+C stops early and still prints a
|
|
247
|
+
summary, and `--limit N` caps the run (it says how it stopped, never silently).
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
hubblenetwork org info
|
|
251
|
+
hubblenetwork org list-devices # streams, tags summarised once
|
|
252
|
+
hubblenetwork org list-devices -f json # machine-readable
|
|
253
|
+
hubblenetwork org list-devices -n 20
|
|
254
|
+
hubblenetwork org get-packets <id> -n 50 --debug
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
`list-devices` takes `--format tabular|json` and `--limit`. `get-packets` takes
|
|
258
|
+
`--limit` and `--debug` (which adds `EPOCH`, `CTR` and `SEQ` columns). As with the
|
|
259
|
+
scan commands, rows go to stdout and headings, progress and summaries go to stderr.
|
|
260
|
+
|
|
261
|
+
The SDK mirrors this: `Organization.iter_devices()` and `Organization.iter_packets()`
|
|
262
|
+
are generators that yield as pages arrive, and both accept an `on_page(page, total)`
|
|
263
|
+
callback for progress. `list_devices()` and `retrieve_packets()` still return lists.
|
|
264
|
+
|
|
265
|
+
### Scan output layout
|
|
266
|
+
|
|
267
|
+
`ble scan` and `sat scan` print one line per packet with a signal bar, and close
|
|
268
|
+
with a summary on stderr:
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
TIME RSSI V EID CTR/SEQ PAYLOAD
|
|
272
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
273
|
+
✓ 00:06:40 -62 ███▏ 2 9c4e2ab77d3f0e1a 20320 T=21.4,B=87
|
|
274
|
+
✓ 00:06:43 -66 ██▉ 2 9c4e2ab77d3f0e1b 20321 T=21.4,B=87
|
|
275
|
+
✗ 00:06:49 -74 ██▏ 2 9c4e2ab77d3f0e1d - D307912C66BA4018E5
|
|
276
|
+
─────────────────────────────────────────────────────────────────────────────
|
|
277
|
+
|
|
278
|
+
4 packets · 3 decrypted, 1 failed · RSSI -62 to -74 dBm · 12s
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
The bar next to RSSI is signal strength: length is the magnitude, so you can watch
|
|
282
|
+
it shrink as you walk away from a device. The `✓`/`✗` mark only appears with
|
|
283
|
+
`--show-failed-decryption`, and the mark carries the state on its own, so the output
|
|
284
|
+
still reads correctly without colour.
|
|
285
|
+
|
|
286
|
+
### Terminals that can't do box-drawing
|
|
287
|
+
|
|
288
|
+
Not every terminal can render `─` and `█`. Writing them to a stdout using a legacy
|
|
289
|
+
code page raises `UnicodeEncodeError`, and because most of them are East Asian Width
|
|
290
|
+
"Ambiguous" they render double-width under a CJK terminal configuration, which shears
|
|
291
|
+
every column.
|
|
292
|
+
|
|
293
|
+
Pass `--ascii` (or set `HUBBLE_ASCII=1`) for a pure-ASCII rendering with identical
|
|
294
|
+
column widths:
|
|
295
|
+
|
|
296
|
+
```
|
|
297
|
+
TIME RSSI V EID CTR/SEQ PAYLOAD
|
|
298
|
+
---------------------------------------------------------------------------
|
|
299
|
+
15:50:13 -62 ###= 0 2030405 300 0A0B0C0D0E0F
|
|
300
|
+
---------------------------------------------------------------------------
|
|
301
|
+
|
|
302
|
+
1 packets | RSSI -62 to -62 dBm | 0s
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
The encoding case is detected automatically, so you only need the flag for the
|
|
306
|
+
double-width one. `--no-ascii` forces the Unicode rendering if the detection is
|
|
307
|
+
wrong for you.
|
|
308
|
+
|
|
309
|
+
Colour is a separate axis: `--no-color`, `NO_COLOR=1`, or a non-TTY stdout all
|
|
310
|
+
disable it, and `FORCE_COLOR=1` keeps it on where a pipe would otherwise strip it
|
|
311
|
+
(useful in CI). Both flags work on any command, before or after the subcommand.
|
|
312
|
+
|
|
313
|
+
Packet rows go to stdout and everything else (the scanning notice, detection
|
|
314
|
+
lines, the summary) goes to stderr, so `hubblenetwork ble scan > packets.txt`
|
|
315
|
+
captures data only. Pass `--debug` to add the forensic columns: `EPOCH`, `TAG`
|
|
316
|
+
and `SALT` for `ble scan`, `RS_CORR`, `SYM_MS` and `GAP_MS` for `sat scan`.
|
|
182
317
|
|
|
183
318
|
## Validating a device end-to-end
|
|
184
319
|
|
|
@@ -241,7 +376,7 @@ hubblenetwork sat scan --timeout 30
|
|
|
241
376
|
# Stop after receiving 5 packets
|
|
242
377
|
hubblenetwork sat scan -n 5
|
|
243
378
|
|
|
244
|
-
# JSON output (
|
|
379
|
+
# JSON output (a single array, streamed as packets arrive)
|
|
245
380
|
hubblenetwork sat scan -o json
|
|
246
381
|
|
|
247
382
|
# Combine options
|
|
@@ -253,7 +388,7 @@ hubblenetwork sat scan --key "a562a2f7e4c62bed52ab09633878f62b"
|
|
|
253
388
|
# Force the DEVICE_UPTIME counter instead of auto-detecting
|
|
254
389
|
hubblenetwork sat scan --key "<key>" --counter-mode DEVICE_UPTIME
|
|
255
390
|
|
|
256
|
-
# Show packets the key can't decrypt too (adds a
|
|
391
|
+
# Show packets the key can't decrypt too (adds a ✓/✗ decrypt mark per row)
|
|
257
392
|
hubblenetwork sat scan --key "<key>" --show-failed-decryption
|
|
258
393
|
```
|
|
259
394
|
|
|
@@ -340,19 +475,38 @@ for pkt in sat.scan(timeout=60.0):
|
|
|
340
475
|
|
|
341
476
|
## Configuration
|
|
342
477
|
|
|
343
|
-
|
|
478
|
+
The **CLI** reads two environment variables:
|
|
344
479
|
|
|
345
|
-
* `HUBBLE_ORG_ID` —
|
|
346
|
-
* `HUBBLE_API_TOKEN` — API token
|
|
347
|
-
|
|
348
|
-
Example:
|
|
480
|
+
* `HUBBLE_ORG_ID` — your organization id
|
|
481
|
+
* `HUBBLE_API_TOKEN` — your API token, passed through as a bearer token
|
|
349
482
|
|
|
350
483
|
```bash
|
|
351
484
|
export HUBBLE_ORG_ID=org_123
|
|
352
485
|
export HUBBLE_API_TOKEN=sk_XXXX
|
|
353
486
|
```
|
|
354
487
|
|
|
355
|
-
|
|
488
|
+
Every command that needs credentials also takes `--org-id` and `--token`, and
|
|
489
|
+
`--help` names the environment variable for each. On the `org` and `metrics`
|
|
490
|
+
groups those flags belong to the group, so they go before the subcommand:
|
|
491
|
+
|
|
492
|
+
```bash
|
|
493
|
+
hubblenetwork org --org-id <id> --token <token> list-devices
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
Check whichever route you used with `hubblenetwork validate-credentials`.
|
|
497
|
+
|
|
498
|
+
**The SDK does not read the environment.** `Organization()` requires its
|
|
499
|
+
credentials explicitly, so exporting the variables does nothing for library code:
|
|
500
|
+
|
|
501
|
+
```python
|
|
502
|
+
from hubblenetwork import Organization
|
|
503
|
+
import os
|
|
504
|
+
|
|
505
|
+
org = Organization(
|
|
506
|
+
org_id=os.environ["HUBBLE_ORG_ID"],
|
|
507
|
+
api_token=os.environ["HUBBLE_API_TOKEN"],
|
|
508
|
+
)
|
|
509
|
+
```
|
|
356
510
|
|
|
357
511
|
## Public API (summary)
|
|
358
512
|
|
|
@@ -360,10 +514,13 @@ Import from the package top-level for a stable surface:
|
|
|
360
514
|
|
|
361
515
|
```python
|
|
362
516
|
from hubblenetwork import (
|
|
363
|
-
ble, cloud, sat,
|
|
517
|
+
ble, cloud, ready, sat,
|
|
364
518
|
Organization, Device, Credentials, Environment,
|
|
365
|
-
EncryptedPacket,
|
|
366
|
-
|
|
519
|
+
EncryptedPacket, UnencryptedPacket, AesEaxPacket, UnknownPacket,
|
|
520
|
+
DecryptedPacket, SatellitePacket, Location,
|
|
521
|
+
decrypt, decrypt_eax, decrypt_satellite,
|
|
522
|
+
UNIX_TIME, DEVICE_UPTIME,
|
|
523
|
+
InvalidCredentialsError,
|
|
367
524
|
)
|
|
368
525
|
```
|
|
369
526
|
|
|
@@ -376,6 +533,11 @@ Key objects & functions:
|
|
|
376
533
|
* `Location` data about where a packet was seen.
|
|
377
534
|
* `ble.scan` function for locally scanning for devices with BLE.
|
|
378
535
|
* `sat.scan` generator for receiving satellite packets via PlutoSDR (requires Docker).
|
|
536
|
+
* `Organization.iter_devices()` / `iter_packets()` generators that yield as each API
|
|
537
|
+
page arrives instead of accumulating, so you can start processing immediately on a
|
|
538
|
+
device with tens of thousands of packets. Both take an optional
|
|
539
|
+
`on_page(page, total_so_far)` callback. `list_devices()` and `retrieve_packets()`
|
|
540
|
+
are `list()` wrappers over them and still return lists.
|
|
379
541
|
|
|
380
542
|
See code for full details.
|
|
381
543
|
|
|
@@ -384,7 +546,6 @@ See code for full details.
|
|
|
384
546
|
Set up a virtualenv and install dev deps:
|
|
385
547
|
|
|
386
548
|
```bash
|
|
387
|
-
cd python
|
|
388
549
|
python3 -m venv .venv
|
|
389
550
|
source .venv/bin/activate
|
|
390
551
|
pip install -e '.[dev]'
|
|
@@ -399,7 +560,19 @@ ruff check src
|
|
|
399
560
|
## Troubleshooting
|
|
400
561
|
|
|
401
562
|
* **`ble.scan()` finds nothing**: verify BLE permissions and adapter state; try increasing `timeout`.
|
|
402
|
-
* **
|
|
563
|
+
* **macOS: `ble scan` crashes instead of prompting for Bluetooth** — you'll see
|
|
564
|
+
`Termination Reason: Namespace TCC` and a message about a missing
|
|
565
|
+
`NSBluetoothAlwaysUsageDescription` key. macOS refuses CoreBluetooth to any
|
|
566
|
+
executable without that key in an Info.plist, and Homebrew's `python3` binary has
|
|
567
|
+
no Info.plist at all. Run from a real terminal app (Terminal, iTerm) rather than an
|
|
568
|
+
embedded IDE shell and grant it Bluetooth under System Settings → Privacy &
|
|
569
|
+
Security → Bluetooth. If it still aborts, run the CLI through a small app bundle
|
|
570
|
+
that carries the key; the framework build at
|
|
571
|
+
`$(brew --prefix)/Frameworks/Python.framework/Versions/<ver>/Resources/Python.app`
|
|
572
|
+
is a usable starting point to copy and amend.
|
|
573
|
+
* **Auth errors**: confirm `Organization(org_id, api_token)` or env vars are set; check
|
|
574
|
+
token scope/expiry. `hubblenetwork validate-credentials` reports which environment
|
|
575
|
+
accepted them and exits 1 if neither did, so it is safe to use in a script.
|
|
403
576
|
* **Import errors**: ensure you installed into the Python you’re running (`python -m pip …`). Prefer `pipx` for CLI-only usage.
|
|
404
577
|
* **`DockerError: Docker is not available`**: Docker daemon is not running. Start Docker Desktop (macOS/Windows) or `sudo systemctl start docker` (Linux).
|
|
405
578
|
* **`DockerError: The ‘docker’ Python package is required`**: run `pip install docker` (it is bundled with `pyhubblenetwork` but may be missing in some environments).
|
|
@@ -407,6 +580,31 @@ ruff check src
|
|
|
407
580
|
* **`sat scan` hangs pulling the image**: first run fetches `ghcr.io/hubblenetwork/sdr-docker:latest`; this may take a minute on a slow connection. Subsequent runs use the cached image.
|
|
408
581
|
|
|
409
582
|
|
|
583
|
+
## Telemetry
|
|
584
|
+
|
|
585
|
+
**There is none.** The CLI makes no network call except the ones a command
|
|
586
|
+
explicitly needs: the Hubble Cloud API for `org` and `metrics`, `localhost` for the
|
|
587
|
+
satellite receiver container, and Docker pulling that container image from
|
|
588
|
+
`ghcr.io` on first `sat` use. Nothing is reported anywhere about how you use it.
|
|
589
|
+
|
|
590
|
+
If that changes, these are the constraints it would have to meet, recorded here so
|
|
591
|
+
the bar is set before anyone writes the code:
|
|
592
|
+
|
|
593
|
+
* **Opt-in only.** Off by default, no collection before an explicit yes, and no
|
|
594
|
+
dark-pattern prompt that treats a dismissed dialog as consent.
|
|
595
|
+
* **Nothing sensitive, ever.** No API tokens, org IDs, device IDs, encryption keys,
|
|
596
|
+
payloads, coordinates, hostnames, or file paths. This tool handles customer device
|
|
597
|
+
keys, so the bar is higher than for a typical CLI. Command name, exit status, and
|
|
598
|
+
version is the ceiling.
|
|
599
|
+
* **Documented in this file**, listing every field actually sent, not a link to a
|
|
600
|
+
policy page.
|
|
601
|
+
* **Killable two ways**, a flag and an environment variable, both honoured on every
|
|
602
|
+
command.
|
|
603
|
+
* **Never blocks or slows a command.** No network call on the critical path, and
|
|
604
|
+
silent failure when offline.
|
|
605
|
+
* **Tested.** A test asserting the payload contains no credential and no device
|
|
606
|
+
identifier, so a future field cannot quietly widen it.
|
|
607
|
+
|
|
410
608
|
## Releases & versioning
|
|
411
609
|
|
|
412
610
|
Follows **SemVer** (MAJOR.MINOR.PATCH). Pushing a version tag triggers a GitHub Actions workflow that runs tests, builds the package, creates a GitHub Release, and publishes to PyPI.
|