Skip to content

Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.

Merge branch 'security-fixes'

Yashwanth Kamireddid02c2bea2f45
diff --cc .github/workflows/release.yml
index f052258,101ee0c..aadac85
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@@ -29,16 -22,7 +29,16 @@@ jobs
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ # The updater binds each signature to the version the program was built as, and
+ # latest.json names the tag's: they must be the same, or every update would be refused.
+ - name: The tag is the version built
+ run: |
+ built=$(node -p 'require("./src-tauri/tauri.conf.json").version')
+ if [ "v$built" != "$GITHUB_REF_NAME" ]; then
+ echo "::error::tag $GITHUB_REF_NAME, but tauri.conf.json says $built"
+ exit 1
+ fi
- name: Build dependencies
run: |
sudo apt-get update
@@@ -55,23 -39,14 +55,23 @@@
with:
node-version: 22
cache: npm
- - uses: dtolnay/rust-toolchain@stable
- - uses: Swatinem/rust-cache@v2
+ - uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- run: npm ci
- name: Build the packages
- # The build machine's paths are never written into the program.
+ # The build machine's paths are never written into the program. The AppImage is signed
+ # for the updater; the key is the release's own secret.
env:
RUSTFLAGS: --remap-path-prefix=${{ github.workspace }}=skykeep
- run: npx tauri build
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
+ run: |
+ if [ -z "$TAURI_SIGNING_PRIVATE_KEY" ]; then
+ echo "::error::a release needs the TAURI_SIGNING_PRIVATE_KEY secret to sign its updates"
+ exit 1
+ fi
+ npx tauri build --config '{"bundle":{"createUpdaterArtifacts":true}}'
+ ls target/release/bundle/appimage/*.AppImage.sig
# One check for every package: the program is started headless with --background (no
# window is asked for unless sign-in needs one), on its own session bus, in an empty home,
# and must still be running 8 s later. `timeout` ending it (124) is the pass; any other
@@@ -151,42 -121,9 +151,42 @@@
permissions:
contents: write
steps:
+ # For the tag's own message, which becomes the update's notes.
- - uses: actions/checkout@v4
++ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ with:
+ fetch-depth: 1
+ path: source
- - uses: actions/download-artifact@v4
+ - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: dist
+ # What the in-app updater reads: the version, the tag's message as its notes, and for each
+ # kind of install that updates itself, where its file will be and its signature. The
+ # updater looks for `<os>-<arch>-<installer>`; with no plain `linux-x86_64`, a .deb or .rpm
+ # can never be handed the AppImage.
+ - name: The updater's latest.json
+ env:
+ REPO: ${{ github.repository }}
+ run: |
+ git -C source fetch --depth=1 origin "+refs/tags/$GITHUB_REF_NAME:refs/tags/$GITHUB_REF_NAME"
+ notes=$(git -C source tag -l --format='%(contents:subject)%0a%0a%(contents:body)' "$GITHUB_REF_NAME" | sed -e '/-----BEGIN PGP SIGNATURE-----/,$d')
+ one() { find dist -type f -name "$1" | head -n1; }
+ appimage=$(one '*.AppImage'); nsis=$(one '*-setup.exe'); msi=$(one '*.msi')
+ for f in "$appimage" "$nsis" "$msi"; do
+ if [ -z "$f" ] || [ ! -s "$f.sig" ]; then echo "::error::no signed updater file for '$f'"; exit 1; fi
+ done
+ base="https://github.com/$REPO/releases/download/$GITHUB_REF_NAME"
+ entry() { jq -n --arg url "$base/$(basename "$1")" --rawfile sig "$1.sig" '{url: $url, signature: ($sig | rtrimstr("\n"))}'; }
+ jq -n \
+ --arg version "${GITHUB_REF_NAME#v}" \
+ --arg notes "$notes" \
+ --arg date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
+ --argjson appimage "$(entry "$appimage")" \
+ --argjson nsis "$(entry "$nsis")" \
+ --argjson msi "$(entry "$msi")" \
+ '{version: $version, notes: ($notes | gsub("^\\s+|\\s+$"; "")), pub_date: $date,
+ platforms: {"linux-x86_64-appimage": $appimage, "windows-x86_64-nsis": $nsis, "windows-x86_64-msi": $msi}}' \
+ > dist/latest.json
+ cat dist/latest.json
- name: A draft release with every file
env:
GH_TOKEN: ${{ github.token }}
diff --cc Cargo.lock
index 1b50a37,383c2fa..3e8dbb6
--- a/Cargo.lock
+++ b/Cargo.lock
@@@ -4003,11 -3901,10 +4003,12 @@@ dependencies =
"keyring",
"num-bigint",
"pbkdf2",
+ "quince-auth",
"rand 0.9.5",
"reqwest 0.12.28",
+ "reqwest 0.13.5",
"reqwest_cookie_store",
+ "rustls",
"serde",
"serde_json",
"sha2",
diff --cc crates/quince-auth/Cargo.toml
index 7efd318,4970e98..35017a6
--- a/crates/quince-auth/Cargo.toml
+++ b/crates/quince-auth/Cargo.toml
@@@ -22,12 -22,14 +22,18 @@@ cookie_store = { version = "0.21", feat
thiserror = "2"
# Looking up Apple's hosts for the client's own resolver (AppleOnly).
tokio = { workspace = true, features = ["net"] }
+# The updater's client (releases.rs), locked like Apple's: the reqwest the Tauri updater plugin
+# is built on, with no TLS of its own — the plugin's (rustls on ring) is the one compiled.
+reqwest_releases = { package = "reqwest", version = "0.13", default-features = false, features = ["rustls-no-provider"] }
+rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
+ [features]
+ # This computer counts as Apple's — for tests, whose mock servers run here. Never in the app.
+ loopback = []
+
[dev-dependencies]
+ # The crate's own tests (tests/*.rs) reach mock servers on this computer.
+ quince-auth = { path = ".", features = ["loopback"] }
tokio = { workspace = true }
wiremock = "0.6"
tempfile = "3"