feat(device): add secure relayer fallback - #92
Conversation
feralfile-bot
left a comment
There was a problem hiding this comment.
Reviewers: 3 (approve: 1, request-changes: 2).
Critical issues
- Two reviewers independently flagged the same blocker: the no-mDNS interactive manual path asks for
Device ID or host, butdiscoverAndSelectDeviceonly returnshostValueand never returnsdiscoveredIdfor anff1-...answer.device addthen persistsid: discoveredId, so the saved device has no stable ID, anddevice pairfails with “has no stable device ID.” This directly breaks the cross-subnet/manual pairing workflow this PR is intended to enable. Please preserve the entered FF1 ID on this path and cover it.
Medium issues
- Manual
--idinput is uppercased insrc/commands/device.ts, while mDNS discovery preserves lowercase IDs, andfindExistingDeviceEntry/upsertDevicecompare IDs case-sensitively. A device added manually asFF1-SKYZ2E3Acan later rediscover asff1-skyz2e3aand fail identity matching, including the address-bridge path that explicitly rejects mismatched IDs. Normalize IDs consistently at storage/discovery boundaries or compare identity keys case-insensitively.
Missing tests
- Add coverage for the no-mDNS interactive manual path where the user enters an FF1 ID, the device is saved with that stable ID, and
device paircan proceed. - Add coverage for the manual uppercase ID followed by lowercase mDNS rediscovery case, or otherwise lock in a single canonical casing across discovery, lookup, upsert, topic-store usage, and config persistence.
No PR discussion exceptions or deferred follow-ups were provided, so both issues remain active for this review.
|
Automated human review request for PR #92. Risk zone: red This PR needs targeted human review on the scoped areas below, not a full second pass of the whole PR.
|
|
Addressed the bot manual-ID findings in
The commit hook passes 423 tests, lint, and copy checks. |
feralfile-bot
left a comment
There was a problem hiding this comment.
Reviewers: 3 (approve: 0, comment: 0, request-changes: 3).
Critical issues
ff-cli device removenow depends on OS keyring availability before it updatesconfig.json. All three reviewers raised this, and re-review confirms it:src/commands/device.ts:326-331callsgetTopicId(removed.id)anddeleteTopicId(removed.id)inside the main commandtrybefore writing the updated device list.getTopicIddirectly calls the native keyring backend insrc/utilities/topic-store.ts:39-43, so a locked/unavailable/failing credential store aborts removal via the outer catch atsrc/commands/device.ts:334-336. Removing a configured device should still succeed; topic cleanup should be best-effort, with a warning or non-fatal cleanup failure.
Missing tests
- Add command-level coverage for
device removewhen topic cleanup throws. The current tests cover topic-store behavior and remove lookup paths, but not the regression where a device with anidcannot be removed becausegetTopicIdordeleteTopicIdfails. The expected behavior should be: config is still updated, the device is removed, and any credential cleanup failure is reported non-fatally.
Considered but not re-raised
- I am not re-raising the earlier manual-ID findings from the PR discussion because the thread says they were addressed in
ab0c021with regression coverage.
|
Addressed the bot keyring-removal finding in
|
feralfile-bot
left a comment
There was a problem hiding this comment.
Reviewers: 3 (approve: 3, comment: 0, request-changes: 0).
No consolidated findings remain. The prior manual-ID and keyring-removal concerns were explicitly addressed in follow-up commits and are no longer active review findings.
Problem
FF1 playlist delivery is LAN-only, so sandboxed and cross-subnet clients cannot reach devices and bypass the shared relayer path. The CLI also has no secure way to acquire or retain a device topic. Closes #43.
Why it matters
LAN-first delivery remains fast while relayer fallback makes remote/cross-subnet control reliable and observable. Topics are transferred E2EE with a user-compared key commitment and stored per device in the operating system credential vault instead of config files.
Acceptance checks
ff-cli device pairexchanges a device-scoped topic through handoff.feralfile.com, compares the security check, and stores it in the OS keyring.npm ci,npm run verify(421 tests), bundle/native-keyring smoke, production broker handoff, and real FF1 relayer cast all pass.Notes
Production relayer deployments may still use the optional
FF1_RELAYER_API_KEYcompatibility gate; no shared key is bundled.