Skip to content

add OTA overlay support with signed bundle loading and integration tests#79

Open
nromito wants to merge 3 commits intomasterfrom
feat/ota-overlay
Open

add OTA overlay support with signed bundle loading and integration tests#79
nromito wants to merge 3 commits intomasterfrom
feat/ota-overlay

Conversation

@nromito
Copy link
Copy Markdown
Collaborator

@nromito nromito commented Apr 6, 2026

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

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>
@nromito nromito requested a review from ledbit April 6, 2026 23:16
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nromito nromito requested a review from sobolewsk April 7, 2026 20:47
@nromito
Copy link
Copy Markdown
Collaborator Author

nromito commented Apr 8, 2026

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>
@nromito
Copy link
Copy Markdown
Collaborator Author

nromito commented Apr 9, 2026

Updated naming to "overlay"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant