Repository navigation
Device revoke OTA: setup firmware channel + admin-signed notice - #16
Open
JamesSmartCell wants to merge 2 commits into
Open
JamesSmartCell wants to merge 2 commits into
JamesSmartCell wants to merge 2 commits into
Conversation
Admins can upload per-project setup firmware (distinct from app latest), revoke a device with an admin-signed updateReady(purpose=revoke) notice, queue delivery for offline devices, and cancel pending revokes. Telemetry tracks requested/delivered/acknowledged/completed outcomes aligned with setup stay_portal (ack before OTA; app reappear after portal Done). Co-authored-by: James Brown <[email protected]>
Avoid comparing active.status to 'acknowledged' after it was already excluded by a prior equality check (TS2367). Co-authored-by: James Brown <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proxy-side REVOCATION: an admin can revoke a device by address so it OTA-installs the project's setup firmware and reboots into the provisioning portal (
stay_portal=1per Web3E-Setup-Firmware#3).Aligned with setup firmware: setup stays in the portal and typically does not TCP-login, so telemetry completion is device ack (
revoking) and/or app re-appearance after portal Done — not a setup-firmware login.Door firmware PR was not open yet when this landed; notice format below is the contract for NFT-Gated-ESP-Control.
Exact revoke notice format (firmware agents)
Same transport as OTA notify: TCP opcode
0x04, methodupdateReady.updateReadyupdateReadychecking/rate_limitedrevoking(required before OTA)Revoke args (length-prefixed key/value):
purposerevokeversionsha256sizemessagerevoke:<project>:<device>:<sha256>:<nonce>signaturepersonal_signofmessageby an admin key<device>= lowercase0x-prefixed KeyID address<sha256>in message = setup binary hashGET /api/firmware/<project>/setup, confirm metadata matches notice, downloadurl, verify SHA-256, set NVSweb3e_boot/stay_portal=1, flash setup, reboot.Endpoints / CLI
POST /api/firmware/:project/setup— messagesetup-firmware:<project>:<version>:<sha256>:<nonce>npm run firmware:upload-setup <project> <version> <bin>GET /api/firmware/:project/setupPOST /api/firmware/:project/revoke— messagerevoke:<project>:<device>:<setupSha256>:<nonce>npm run firmware:revoke <project> <device>POST /api/firmware/:project/revoke/cancel— messagerevoke-cancel:<project>:<device>:<nonce>npm run firmware:revoke:cancel <project> <device>GET /api/firmware/:project/revokesSetup firmware is stored under
firmware/<project>/setup/<version>/firmware.binand never becomes app/latest. Same admin auth / R2 env as existing firmware upload (no secrets committed).Queueing behaviour
firmware_revoke_requested; notice storeddelivered/firmware_revoke_deliveredpending; delivered on next TCP loginrevoking→acknowledged/firmware_revoke_acknowledgedcompleted/firmware_revoke_completedcancelled/firmware_revoke_cancelled(stops delivery)Full detail:
docs/firmware-ota.md.Tests
npm test— 281 passing (includes newfirmware-revoke.test.ts)npm run typecheck:tools— clean