add OTA overlay support with signed bundle loading and integration tests#79
Open
add OTA overlay support with signed bundle loading and integration tests#79
Conversation
Add over-the-air update capability to js2bin binaries. When --enable-ota
is passed, the binary checks for signed OTA bundles at startup and loads
them instead of the embedded app, falling back gracefully on failure.
OTA runtime (_third_party_main_ota.js):
- Loads bundles from ${execDir}/ota/current/ or CRIBL_OTA_DIR env var
- Verifies ECDSA P-256 signatures against embedded key and/or
trusted-keys directory, supporting key rotation
- Falls back to embedded app on missing/invalid/tampered bundles
OTA bundle builder (--ota command):
- Compresses app with brotli, signs with ECDSA P-256, writes
bundle.js, bundle.js.sig, and bundle.js.sha256
Build changes:
- --enable-ota and --signing-public-key flags for --build and --ci paths
- -ota suffix on cached binary names to distinguish OTA variants
- buildName() accepts enableOta parameter
Tests:
- Unit tests for OTABuilder (compression, signing, artifact generation)
- Integration tests exercising ./js2bin.js CLI end-to-end:
Tier 1: OTA bundle creation, round-trip, signature, checksum, errors
Tier 2: full binary flow — embedded fallback, OTA override,
CRIBL_OTA_DIR, tampered signature rejection, trusted-keys directory
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
getting some feedback on the naming - may update this to be overlay instead of OTA as its more descriptive of the behavior/mechanism |
Renames all OTA references to Overlay naming convention: files, classes, CLI flags, env vars, directory paths, and test suites. Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
Author
|
Updated naming to "overlay" |
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.
Add over-the-air update capability to js2bin binaries. When --enable-ota is passed, the binary checks for signed OTA bundles at startup and loads them instead of the embedded app, falling back gracefully on failure.
OTA runtime (_third_party_main_ota.js):
OTA bundle builder (--ota command):
Build changes:
Tests: