Skip to content

B2CA-2702: Add web UI tol for backup & Restore - #163

Merged
cedelavergne-ledger merged 5 commits into
developfrom
cev/B2CA-2702_web_ui
Jun 17, 2026
Merged

B2CA-2702: Add web UI tol for backup & Restore#163
cedelavergne-ledger merged 5 commits into
developfrom
cev/B2CA-2702_web_ui

Conversation

@cedelavergne-ledger

@cedelavergne-ledger cedelavergne-ledger commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Description

Browser-based backup/restore tool based on Vite + React 18 + lumen

pytools: fix latent backup/restore bugs

Fix #160

Found while building the web UI:
- restore(): write the salutation as an ASCII digit instead of bytes.fromhex()
  on the odd-length "1"/"2" (which raises).
- _decode_tlv(): use elif for the 1-byte / 2-byte long-length forms so the
  second branch no longer re-evaluates the reassigned length.
- backup.py: also verify PW2 (0x82), required to read/write the private DOs
  0x0101/0x0103.
- restore(): stop writing the read-only signature counter (DO 0x93).
A browser-based backup/restore tool for the OpenPGP app, served at
https://ledgerhq.github.io/app-openpgp/wui/ and linked from the docs.

- Stack: Vite + React 18, Ledger's lumen design system (Tailwind), pnpm
  (exact version pinning).
- Talks to the device over WebHID (the generic HID APDU interface) — the same
  channel pytools/backup.py uses; no firmware change required.
- Backup (get_all -> version-1 JSON, native save dialog), restore (PUT DATA
  sequence + optional deterministic key regeneration from the seed), factory
  reset, key-slot selection; PIN dialogs and recovery hints, with graceful
  handling of the device-side crash that can occur during key regeneration.
- APDU framing / TLV / data-object layer ported from pytools, covered by
  Vitest. A "?mock" dev preview opens the connected screen without a device.
- Co-hosted on the existing GitHub Pages workflow (builds clients/wui into
  doc/html/build/wui/); pnpm-lock.yaml is excluded from the codespell and
  large-file pre-commit hooks.
@codecov-commenter

codecov-commenter commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 40.19%. Comparing base (baa2541) to head (e4b8331).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #163   +/-   ##
========================================
  Coverage    40.19%   40.19%           
========================================
  Files            1        1           
  Lines          209      209           
  Branches        49       49           
========================================
  Hits            84       84           
  Misses         118      118           
  Partials         7        7           
Flag Coverage Δ
unittests 40.19% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

Copy link
Copy Markdown
Contributor

Code coverage report

Code Coverage

Per-file coverage
Package Line Rate Branch Rate Health
src 25% 9%
Summary 25% (56 / 227) 9% (9 / 101)

@0pendev
0pendev self-requested a review June 17, 2026 14:55

@0pendev 0pendev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both python and the new web client works without issue on my end.
Tested on Nano Gen5, Nano SP, Flex.

C code was edited but is only formatting fixes. Those changes are all present in a single commit.

@cedelavergne-ledger
cedelavergne-ledger merged commit c1bd307 into develop Jun 17, 2026
72 checks passed
@cedelavergne-ledger
cedelavergne-ledger deleted the cev/B2CA-2702_web_ui branch June 17, 2026 15:03
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.

Restore operation fails: Ledger Nano S Plus becomes unresponsive (screen turns off) mid-restore

3 participants