Skip to content

updater: Nostr-based auto-update with SHA256 verification (DECK-468)#1326

Merged
jb55 merged 5 commits intomasterfrom
jb55-deck-877-auto-updater
Mar 12, 2026
Merged

updater: Nostr-based auto-update with SHA256 verification (DECK-468)#1326
jb55 merged 5 commits intomasterfrom
jb55-deck-877-auto-updater

Conversation

@jb55
Copy link
Contributor

@jb55 jb55 commented Mar 6, 2026

Summary

  • Add auto-updater that discovers releases via signed Nostr events (NIP-94 kind 1063) instead of GitHub API
  • SHA256 hash verification of downloaded binaries against the hash in the signed event
  • Gate all active updater logic behind auto-update Cargo feature flag (dormant by default)
  • Add notedeck-release CLI tool for publishing release events from GitHub Release artifacts
  • Disable Windows arm64 installer builds until Inno Setup support is fixed
  • Exclude notedeck_release from Android builds (OpenSSL not available in NDK)

How it works

  1. Updater subscribes to kind 1063 events from a trusted release pubkey
  2. Events contain download URL, SHA256 hash, version, and platform info in tags
  3. Downloaded binary is verified against the SHA256 hash before installation
  4. notedeck-release --version X.Y.Z --nsec <key> --relay wss://... publishes release events

Test plan

  • Unit tests for Nostr event parsing (platform matching, version comparison, hash extraction)
  • Unit tests for SHA256 verification (match, mismatch, HTTP error cases)
  • Integration test for notedeck-release dry-run against GitHub Releases (#[ignore] until assets exist)
  • Android build verified locally with --exclude notedeck_release
  • End-to-end test after merging: publish release events, verify updater discovers them

🤖 Generated with Claude Code

@linear
Copy link

linear bot commented Mar 6, 2026

@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ffbb268b-829d-455e-9966-1fbebf5775ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jb55-deck-877-auto-updater
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

Add a self-updating system that checks GitHub Releases for newer
versions, downloads the update in the background, and prompts the
user to restart. Uses ehttp for async HTTP, semver for version
comparison, and self-replace for atomic binary swap.

The updater is a state machine (Idle → Checking → Downloading →
ReadyToInstall) polled each frame via try_recv(), keeping the UI
non-blocking. Platform-specific install handles macOS .app bundle
replacement, and Linux/Windows binary swap.

New crates: updater/github.rs (API client), updater/platform.rs
(install logic), updater/mod.rs (state machine). Gated to desktop
only via cfg(not(android/wasm32)).

Changelog-Added: Add auto-update support from GitHub Releases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jb55 jb55 force-pushed the jb55-deck-877-auto-updater branch from 149a7d6 to 5fb8fde Compare March 12, 2026 16:52
jb55 and others added 4 commits March 12, 2026 10:56
…468)

Replace the GitHub Releases API with NIP-94 file metadata events
(kind 1063) signed by a trusted release pubkey. This adds SHA256
hash verification of downloaded binaries and removes the dependency
on GitHub's API for update discovery.

- Add updater/nostr.rs with release filter, event parsing, and ndb querying
- Delete updater/github.rs (no longer needed)
- Add SHA256 verification in handle_download() before writing to disk
- Wire up ndb subscription and polling in app.rs for release events
- New state machine: Idle → WaitingForRelease → Downloading → ReadyToInstall

Changelog-Changed: Replace GitHub-based auto-updater with Nostr-based release verification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…DECK-468)

Gate auto-update logic behind a Cargo feature flag so it can be
merged without activating updater polling. Add notedeck-release CLI
for publishing NIP-94 release events from GitHub Release artifacts.
Also disable Windows arm64 installer builds until Inno Setup arm64
support is fixed.

Changelog-None:

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ECK-468)

Changelog-None:

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The notedeck_release CLI depends on tungstenite with native-tls
which requires OpenSSL, unavailable in the Android NDK toolchain.

Changelog-None:

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jb55 jb55 changed the title updater: add auto-update from GitHub Releases (DECK-877) updater: Nostr-based auto-update with SHA256 verification (DECK-468) Mar 12, 2026
@jb55 jb55 merged commit 721c7d0 into master Mar 12, 2026
11 checks passed
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