|
| 1 | +## Why |
| 2 | + |
| 3 | +Without auto-updates, users must manually check GitHub for new versions. Sparkle is the de facto standard framework for macOS app updates outside the App Store — used by Firefox, VLC, iTerm2, and hundreds of other apps. It handles checking for updates, downloading, verifying signatures, and installing — all in-app with no browser required. Auto-update should be enabled by default so users always have the latest version. |
| 4 | + |
| 5 | +## What Changes |
| 6 | + |
| 7 | +- Integrate the Sparkle 2.x framework via Swift Package Manager |
| 8 | +- Host an appcast XML file (version feed) on the website or in the repo |
| 9 | +- Sign updates with an Ed25519 key for integrity verification |
| 10 | +- Add "Check for Updates" menu item and auto-check on launch (enabled by default) |
| 11 | +- Add update preferences to Settings (auto-check on/off, check now button) |
| 12 | +- Update the release process to generate appcast entries and sign update archives |
| 13 | + |
| 14 | +## Capabilities |
| 15 | + |
| 16 | +### New Capabilities |
| 17 | +- `sparkle-updates`: In-app update mechanism using the Sparkle framework. Checks an appcast feed for new versions. Downloads, verifies (Ed25519 signature), and installs updates in-place. Auto-check is enabled by default. Users can check manually via menu item or disable automatic checks in Settings. |
| 18 | + |
| 19 | +### Modified Capabilities |
| 20 | +- `privacy-settings`: Add update check preferences (auto-check on/off, check now button) to the Settings view. |
| 21 | + |
| 22 | +## Impact |
| 23 | + |
| 24 | +- **AppDelegate.swift**: Initialize Sparkle updater, add "Check for Updates" menu item |
| 25 | +- **SettingsView.swift**: Add update preferences section |
| 26 | +- **Info.plist**: Add Sparkle configuration keys (feed URL, public key) |
| 27 | +- **Release process**: Generate and sign appcast entries using `generate_appcast` tool |
| 28 | +- **New dependency**: Sparkle 2.x framework (via Swift Package Manager) — MIT licence, open source |
| 29 | +- **CHANGELOG.md**: New entry |
| 30 | + |
| 31 | +## How Sparkle Works |
| 32 | + |
| 33 | +1. App checks the appcast URL on a schedule (default: daily, configurable) |
| 34 | +2. Appcast lists versions with download URLs, Ed25519 signatures, and release notes |
| 35 | +3. If a newer version exists, Sparkle shows an update dialog with release notes |
| 36 | +4. User clicks "Install Update" — Sparkle downloads the archive, verifies the signature, replaces the app, and relaunches |
| 37 | +5. No browser, no manual download, no drag-to-Applications |
| 38 | + |
| 39 | +## Prerequisites |
| 40 | + |
| 41 | +- `macos-code-signing` change completed (signed builds required for updates) |
| 42 | +- Appcast hosting decided (website or repo — see `website-landing-page` change) |
| 43 | +- Ed25519 key pair generated for update signing (separate from Apple code signing) |
| 44 | + |
| 45 | +## Notes |
| 46 | + |
| 47 | +- This is the first external dependency in the project. Sparkle is MIT-licenced, widely used, and actively maintained. The alternative (rolling our own update checker) would be significantly more work for a worse result. |
| 48 | +- Auto-check is enabled by default with a daily interval. Users can disable it in Settings. |
| 49 | + |
| 50 | +## Open Questions |
| 51 | + |
| 52 | +1. **Appcast hosting**: On the website (alongside the landing page) or committed to the repo (served via GitHub raw URL)? |
| 53 | +2. **Appcast generation**: Automate with `generate_appcast` tool (ships with Sparkle) in the release workflow, or maintain manually? Recommend automating. |
| 54 | +3. **Delta updates**: Sparkle supports binary diffs (smaller downloads). Worth enabling or overkill for a small app? |
0 commit comments