Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat: updates follow the release gate alone
leepokai19e5771980b5
diff --git a/.github/workflows/host.yml b/.github/workflows/host.ymlindex 984a1d43..ce6e7ee0 100644--- a/.github/workflows/host.yml+++ b/.github/workflows/host.yml@@ -99,8 +99,6 @@ jobs:files: |codync-host-*.tar.gzcodync-host-*.tar.gz.sha256- codync-host-*.compat.json- codync-host-*.compat.json.sig# The update manifest last: the release gate takes a release with all its feeds as fully uploaded.- uses: softprops/action-gh-release@v2with:diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.ymlindex 16b6d9e6..08b9f14e 100644--- a/.github/workflows/release-desktop.yml+++ b/.github/workflows/release-desktop.yml@@ -121,9 +121,6 @@ jobs:SPARKLE_PRIVATE_KEY: ${{ secrets.SPARKLE_PRIVATE_KEY }}run: |VERSION=$(node -p 'require("./apps/desktop/package.json").version')- # The iPhone app this release needs: Macs with iPhones wait until the App Store has it.- MIN_APP=$(apps/desktop/build/native/codync-host compat | python3 -c 'import json,sys; print(json.load(sys.stdin)["minApp"])')- printf 'minApp: %s\n' "$MIN_APP" >> apps/desktop/dist/latest-mac.yml# Installs of the earlier native app update through Sparkle: one more appcast, now for the zip.test -n "$SPARKLE_PRIVATE_KEY" || { echo 'SPARKLE_PRIVATE_KEY is required'; exit 1; }curl -sSL https://github.com/sparkle-project/Sparkle/releases/download/2.10.0/Sparkle-2.10.0.tar.xz | tar xJ -C "$RUNNER_TEMP"@@ -131,7 +128,6 @@ jobs:printf '%s' "$SPARKLE_PRIVATE_KEY" | "$RUNNER_TEMP/bin/generate_appcast" --ed-key-file - --maximum-deltas 0 \--download-url-prefix "https://github.com/leepokai/Codync/releases/download/v${VERSION}/" \--link https://www.codync.dev/ -o build/appcast.xml build/updates- python3 packaging/updates/annotate-appcast.py build/appcast.xml "$MIN_APP"python3 -m venv "$RUNNER_TEMP/update-verification""$RUNNER_TEMP/update-verification/bin/pip" install 'cryptography>=44,<47'"$RUNNER_TEMP/update-verification/bin/python" packaging/updates/verify-appcast.py \@@ -196,12 +192,6 @@ jobs:curl -sf http://127.0.0.1:19333/health | grep -q computerIdTOKEN=$(cat "$RUNNER_TEMP/codync/token")curl -sf -X POST -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{}' http://127.0.0.1:19333/api/refreshBackends- - name: Update feed- working-directory: apps/desktop/dist- # Windows bundles the host like the Mac: PCs with iPhones wait until the App Store has the app it needs.- run: |- MIN_APP=$(win-unpacked/resources/codync-host.exe compat | node -p 'JSON.parse(require("fs").readFileSync(0, "utf8")).minApp')- printf 'minApp: %s\n' "$MIN_APP" >> latest.yml- uses: actions/upload-artifact@v4if: "!startsWith(github.ref, 'refs/tags/')"with:diff --git a/.gitignore b/.gitignoreindex e3858e66..c63ae6a5 100644--- a/.gitignore+++ b/.gitignore@@ -23,3 +23,6 @@ brag-output*/# Launch video projectsvideos/++# Python bytecode+__pycache__/diff --git a/apps/desktop/src/main/tray.ts b/apps/desktop/src/main/tray.tsindex 74e7959c..28a28902 100644--- a/apps/desktop/src/main/tray.ts+++ b/apps/desktop/src/main/tray.ts@@ -161,13 +161,9 @@ export class Tray {const u = updates.stateconst items: Electron.MenuItemConstructorOptions[] = [{ ...updateAction(u), click: () => updates.check() },- ]- // The release waits until paired iPhones can get the app it needs.- if (u.waitingForApp) items.push({ label: `Waiting for iPhone app ${u.waitingForApp} to pass App Store review`, enabled: false })- items.push({ label: 'Automatically check for updates', type: 'checkbox', checked: u.autoCheck, enabled: u.supported, click: () => updates.emit('setAutoCheck', !u.autoCheck) },{ label: 'Automatically download and install', type: 'checkbox', checked: u.autoDownload, enabled: u.supported, click: () => updates.emit('setAutoDownload', !u.autoDownload) },- )+ ]if (!u.supported) items.push({ label: 'Updates are available in release builds.', enabled: false })if (u.lastCheck) items.push({ label: `Last checked: ${new Date(u.lastCheck).toLocaleString()}`, enabled: false })if (u.error) {diff --git a/apps/desktop/src/main/updates.ts b/apps/desktop/src/main/updates.tsindex 796f5848..75ad8e58 100644--- a/apps/desktop/src/main/updates.ts+++ b/apps/desktop/src/main/updates.ts@@ -5,7 +5,6 @@ import { homedir } from 'node:os'import { join } from 'node:path'import { app, BrowserWindow, ipcMain, powerMonitor, shell } from 'electron'import electronUpdater, { type UpdateInfo } from 'electron-updater'-import { isBelow, parseVersion } from '../shared/compat'import type { UpdateState } from '../shared/ipc'import { isMainEnvironment } from './account'import { identity } from './environment'@@ -34,7 +33,6 @@ export class Updates extends EventEmitter {autoDownload: prefs.get('updatesAutoDownload') !== false,lastCheck: (prefs.get('updatesLastCheck') as number | undefined) ?? null,error: null,- waitingForApp: null,}private userInitiated = false/** The person chose Update: restart into the release as soon as it's downloaded. */@@ -42,7 +40,6 @@ export class Updates extends EventEmitter {private preparing: Promise<boolean> | null = nullprivate prepared = falseprivate updateGeneration = 0- private appStoreVersion: string | null = nullconstructor(private host: HostController) {super()@@ -72,7 +69,7 @@ export class Updates extends EventEmitter {autoUpdater.autoInstallOnAppQuit = trueautoUpdater.on('checking-for-update', () => this.set({ checking: true, error: null }))autoUpdater.on('update-not-available', () => this.upToDate())- autoUpdater.on('update-available', (info) => void this.available(info))+ autoUpdater.on('update-available', (info) => this.available(info))autoUpdater.on('download-progress', ({ percent }) => {const rounded = Math.floor(percent)if (this.state.downloadPercent !== null && rounded !== this.state.downloadPercent) this.set({ downloadPercent: rounded })@@ -144,11 +141,10 @@ export class Updates extends EventEmitter {this.userInitiated = false}- /** Daily, or hourly while a release waits for the iPhone app to pass review. */+ /** Checks daily; the minute of slack keeps the hourly timer from skipping a day. */private scheduled() {if (!this.state.autoCheck || this.state.checking || this.state.staged) return- const interval = this.state.waitingForApp ? 3600_000 : 24 * 3600_000- if (this.state.lastCheck && Date.now() - this.state.lastCheck < interval - 60_000) return+ if (this.state.lastCheck && Date.now() - this.state.lastCheck < 24 * 3600_000 - 60_000) returnthis.userInitiated = falsevoid autoUpdater.checkForUpdates().catch(() => {})}@@ -165,54 +161,24 @@ export class Updates extends EventEmitter {/** The sidebar's Update badge: restarts into the available release, downloading it first. */installNow() {- if (!enabled || !this.state.availableVersion || this.state.waitingForApp) return+ if (!enabled || !this.state.availableVersion) returnif (this.state.staged) return void this.install(true)this.installWhenDownloaded = truethis.check()}/**- * A release that needs a newer iPhone app than the App Store has (still in review) waits,- * so paired iPhones aren't asked for an update they can't get yet. Without an answer from- * the App Store, background checks wait and a check the person started goes ahead.+ * The release GitHub marks latest, which the release gate gives only to one the App Store's+ * iPhone app works with (docs/reference/compatibility.md).*/- private async available(info: UpdateInfo) {- const required = (info as UpdateInfo & { minApp?: string }).minApp- let waiting: string | null = null- if (required) {- const [hostMinApp, iphones] = await this.localHostFacts()- this.appStoreVersion = (await appStoreVersion()) ?? this.appStoreVersion- const storeHas = this.appStoreVersion && parseVersion(this.appStoreVersion) && !isBelow(this.appStoreVersion, required)- if (isBelow(hostMinApp ?? '0', required) && iphones !== false && !storeHas && !(this.appStoreVersion === null && this.userInitiated)) {- waiting = required- }- }- this.checked({ availableVersion: info.version, waitingForApp: waiting })- if (waiting) {- this.installWhenDownloaded = false- if (this.userInitiated) this.set({ error: `Codync ${info.version} needs the iPhone app ${waiting}, which isn't in the App Store yet. It installs once that version passes review.` })- this.userInitiated = false- return- }+ private available(info: UpdateInfo) {+ this.checked({ availableVersion: info.version })if (this.userInitiated || this.state.autoDownload) {this.set({ downloadPercent: 0 })void autoUpdater.downloadUpdate().catch(() => {})}}- /** The local host's `minApp` and whether an iPhone is paired with it. */- private async localHostFacts(): Promise<[string | null, boolean | null]> {- try {- const [hello, devices] = await Promise.all([- this.host.call<{ minApp?: string }>('hello'),- this.host.call<{ devices: { platform?: string }[] }>('devices'),- ])- return [hello.minApp ?? null, devices.devices.some((d) => d.platform === 'ios')]- } catch {- return [null, null]- }- }-/** Waits until the app is in the background, nobody has typed for ten minutes and no bot is working. */private installWhenIdle() {const timer = setInterval(async () => {@@ -277,14 +243,3 @@ function removeStuckShipIt() {execFile('/bin/launchctl', ['remove', label], () => {})})}--/** The iPhone app's version live in the App Store (iTunes lookup); null when unknown. */-async function appStoreVersion(): Promise<string | null> {- try {- const res = await fetch('https://itunes.apple.com/lookup?id=6760984418', { signal: AbortSignal.timeout(10_000), cache: 'no-store' })- const json = (await res.json()) as { results?: { version?: string }[] }- return json.results?.[0]?.version ?? null- } catch {- return null- }-}diff --git a/apps/desktop/src/renderer/demo/bridge.ts b/apps/desktop/src/renderer/demo/bridge.tsindex e0aa46a4..538c4ebe 100644--- a/apps/desktop/src/renderer/demo/bridge.ts+++ b/apps/desktop/src/renderer/demo/bridge.ts@@ -19,7 +19,7 @@ const snapshot: HostSnapshot = {const account: AccountState = { ready: true, configured: false, busy: false, error: null, user: null, cloudURL: null }const updates: UpdateState = {supported: false, checking: false, availableVersion: null, downloadPercent: null, staged: false, installing: false,- autoCheck: false, autoDownload: false, lastCheck: null, error: null, waitingForApp: null,+ autoCheck: false, autoDownload: false, lastCheck: null, error: null,}const bridge: CodyncBridge = {diff --git a/apps/desktop/src/renderer/views/UpdateButton.tsx b/apps/desktop/src/renderer/views/UpdateButton.tsxindex c4a6118e..ecd4cdd8 100644--- a/apps/desktop/src/renderer/views/UpdateButton.tsx+++ b/apps/desktop/src/renderer/views/UpdateButton.tsx@@ -29,7 +29,7 @@ export function UpdateButton({ updates, kind = 'secondary' }: { updates: UpdateSexport function UpdateBadge({ size }: { size: number }) {const updates = useUpdates()const [confirming, setConfirming] = useState(false)- if (!updates?.supported || !updates.availableVersion || updates.waitingForApp) return null+ if (!updates?.supported || !updates.availableVersion) return nullreturn (<><buttondiff --git a/apps/desktop/src/renderer/views/settings/SettingsView.tsx b/apps/desktop/src/renderer/views/settings/SettingsView.tsxindex 7e775bec..30e66e7e 100644--- a/apps/desktop/src/renderer/views/settings/SettingsView.tsx+++ b/apps/desktop/src/renderer/views/settings/SettingsView.tsx@@ -223,11 +223,7 @@ function UsageLimitsList() {function UpdateSettings() {const updates = useUpdates()if (!updates) return null- const footer = !updates.supported- ? 'Updates are available in release builds.'- : updates.waitingForApp- ? `Waiting for iPhone app ${updates.waitingForApp} to pass App Store review.`- : null+ const footer = updates.supported ? null : 'Updates are available in release builds.'const lastChecked = updates.lastCheck? `Last checked ${new Date(updates.lastCheck).toLocaleString(undefined, { dateStyle: 'medium', timeStyle: 'short' })}`: nulldiff --git a/apps/desktop/src/shared/ipc.ts b/apps/desktop/src/shared/ipc.tsindex 2664de95..cbe3b074 100644--- a/apps/desktop/src/shared/ipc.ts+++ b/apps/desktop/src/shared/ipc.ts@@ -86,8 +86,6 @@ export interface UpdateState {autoDownload: booleanlastCheck: number | nullerror: string | null- /** The release waits until paired iPhones can get the app it needs. */- waitingForApp: string | null}export interface AccountState {diff --git a/apps/desktop/src/shared/test-support/updater.ts b/apps/desktop/src/shared/test-support/updater.tsindex 1808db71..9f21af7d 100644--- a/apps/desktop/src/shared/test-support/updater.ts+++ b/apps/desktop/src/shared/test-support/updater.ts@@ -1,6 +1,5 @@import { EventEmitter } from 'node:events'import path from 'node:path'-import * as compat from '../compat.ts'import type { UpdateState } from '../ipc.ts'import { loadMainModule, settle } from './main-module.ts'@@ -15,7 +14,7 @@ interface UpdatesInstance extends EventEmitter {type ShipIt = { request: boolean; job: 'none' | 'idle' | 'running' }export function updaterFixture(options: { packaged?: boolean; main?: boolean; prefs?: Record<string, unknown>; shipIt?: ShipIt } = {}) {- const calls = { check: 0, download: 0, install: 0, prepare: 0, resume: 0, quit: 0, fetch: 0 }+ const calls = { check: 0, download: 0, install: 0, prepare: 0, resume: 0, quit: 0 }// macOS's installer job: whether its update request exists, and its launchd state.const shipIt = { ...(options.shipIt ?? { request: true, job: 'idle' }), removed: 0 }const launchctl = (_bin: string, args: string[], done: (error: Error | null, stdout: string) => void) => {@@ -36,10 +35,6 @@ export function updaterFixture(options: { packaged?: boolean; main?: boolean; prcheck: async () => {},download: async () => {},install: () => {},- hostFactsFail: false,- minApp: '2.0.0',- devices: [{ platform: 'ios' }],- storeVersion: '2.0.0' as string | null,focused: false,idleSeconds: 600,hostIdle: true,@@ -64,10 +59,6 @@ export function updaterFixture(options: { packaged?: boolean; main?: boolean; prprepareForUpdate: async () => { calls.prepare++; await behavior.prepare() },resumeAfterCancelledUpdate: () => { calls.resume++ },isIdleForUpdate: async () => behavior.hostIdle,- call: async (method: string) => {- if (behavior.hostFactsFail) throw new Error('Host unreachable')- return method === 'hello' ? { minApp: behavior.minApp } : { devices: behavior.devices }- },}const timer = (callback: () => unknown, ms: number) => {const id = ++nextTimer@@ -82,7 +73,6 @@ export function updaterFixture(options: { packaged?: boolean; main?: boolean; pr'node:path': path,electron: { app, ipcMain: ipc, shell: { openPath: async (target: string) => { opened.push(target); return '' } }, BrowserWindow: { getFocusedWindow: () => behavior.focused }, powerMonitor: { getSystemIdleTime: () => behavior.idleSeconds } },'electron-updater': { autoUpdater: updater },- '../shared/compat': compat,'./account': { isMainEnvironment: () => options.main ?? true },'./environment': { identity: { appId: 'com.pokai.Codync' } },'./host-controller': { prefs: { get: (key: string) => preferences.get(key), set: (key: string, value: unknown) => preferences.set(key, value) } },@@ -90,11 +80,6 @@ export function updaterFixture(options: { packaged?: boolean; main?: boolean; prDate: class extends Date { static override now() { return now } },process: { platform: 'darwin' },setTimeout: timer, setInterval: timer, clearInterval: (id: number) => timers.delete(id),- fetch: async () => {- calls.fetch++- if (behavior.storeVersion === null) throw new Error('Offline')- return { json: async () => ({ results: [{ version: behavior.storeVersion }] }) }- },})const updates = new Updates(host)const sent: { window: number; channel: string; state: UpdateState }[] = []diff --git a/apps/desktop/src/shared/updates.test.ts b/apps/desktop/src/shared/updates.test.tsindex 5bb29df9..4bd6af71 100644--- a/apps/desktop/src/shared/updates.test.ts+++ b/apps/desktop/src/shared/updates.test.ts@@ -251,46 +251,6 @@ for (const block of ['disabled', 'focused', 'recentInput', 'busyHost'] as const)})}-test('paired iPhones hold an incompatible release until the App Store catches up', async () => {- const f = updaterFixture()- f.updates.check()- await f.emit('update-available', { ...release, minApp: '2.11.0' })- assert.equal(f.updates.state.waitingForApp, '2.11.0')- assert.match(f.updates.state.error!, /iPhone app 2.11.0/)- assert.equal(f.calls.download, 0)- f.behavior.storeVersion = '2.11.0'- f.updates.check()- await f.emit('update-available', { ...release, minApp: '2.11.0' })- assert.equal(f.updates.state.waitingForApp, null)- assert.equal(f.calls.download, 1)-})--for (const condition of ['noPhones', 'compatibleHost', 'manualOffline'] as const) {- test(`compatibility permits download with ${condition}`, async () => {- const f = updaterFixture()- if (condition === 'noPhones') f.behavior.devices = []- if (condition === 'compatibleHost') f.behavior.minApp = '2.11.0'- if (condition === 'manualOffline') f.behavior.storeVersion = null- f.updates.check()- await f.emit('update-available', { ...release, minApp: '2.11.0' })- assert.equal(f.updates.state.waitingForApp, null)- assert.equal(f.calls.download, 1)- })-}--test('unattended updates wait when App Store or paired-device information is unknown', async () => {- const f = updaterFixture({ prefs: { updatesAutoDownload: true } })- f.behavior.storeVersion = null- f.behavior.hostFactsFail = true- await f.emit('update-available', { ...release, minApp: '2.11.0' })- assert.equal(f.calls.download, 0)- assert.equal(f.updates.state.waitingForApp, '2.11.0')- assert.equal(f.updates.state.error, null)- f.advance(3600_000)- await f.tick(3600_000)- assert.equal(f.calls.check, 1, 'held releases recheck hourly')-})-test('repeated clicks during host shutdown must invoke the installer once', async () => {const f = updaterFixture()const stopped = deferred()diff --git a/docs/architecture/desktop-app.md b/docs/architecture/desktop-app.mdindex ce89449a..34634c06 100644--- a/docs/architecture/desktop-app.md+++ b/docs/architecture/desktop-app.md@@ -89,9 +89,10 @@ The TUI connects to one host at a time, so it keeps its single roster.- **Other computers in the account** are reached through this computer's own host and SSHtunnels only. The encrypted channel to account computers (`ChannelTransport`) wasn't ported:the product targets one computer, so "Ask for access" rows show status only.-- **Updates**: electron-updater from GitHub releases (`latest-mac.yml` carries `minApp`, the same- iPhone gate as before). Installs of the SwiftUI app get the first desktop release through one- more Sparkle appcast, generated for the zip by the release workflow (deprecated, removed after+- **Updates**: electron-updater reads the release GitHub marks latest, and only the release gate+ (`tools/release-gate.py`) sets that mark+ ([holding releases](../reference/compatibility.md#holding-releases-for-the-app-store)).+ Installs of the SwiftUI app get the first desktop release through one more Sparkle appcast, generated for the zip by the release workflow (deprecated, removed after2026-11-06: [updates guide](../guides/updates.md#deprecated-the-sparkle-migration-appcast-remove-after-2026-11-06)).On macOS the app removes an idle installer job (`<appId>.ShipIt`) whose update request is gone:launchd would otherwise restart it every 2 seconds, forever.diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.mdindex 22af4856..2f7ab0b9 100644--- a/docs/design/ui-conventions.md+++ b/docs/design/ui-conventions.md@@ -28,8 +28,8 @@ whole flow (`apps/desktop/src/shared/update-action.ts`, the same label in the trUpdates page and the update-needed card): **Check for updates** → **Update to <version>**→ **Downloading… N%** (the Updates page adds a progress bar) → **Restart to update** →**Restarting…**. A finished download never quits the app on its own; the person restarts,-or it installs once idle. While a release is available (and not waiting for the iPhone-app), a filled arrow badge sits right of **Extensions** in the sidebar footer (under the+or it installs once idle. While a release is available, a filled arrow badge sits right+of **Extensions** in the sidebar footer (under theExtensions icon in the collapsed rail), tooltip **Update**; it asks **Update to Codync<version>?** and then restarts into the release, downloading it first if needed, and itis gone once the app runs the latest version. The TUI action list has **Check for updates**. Download anddiff --git a/docs/guides/updates.md b/docs/guides/updates.mdindex 1cd14d64..b863d3de 100644--- a/docs/guides/updates.md+++ b/docs/guides/updates.md@@ -22,15 +22,15 @@ preference asks for it).While a release is available, an **Update** badge sits right of **Extensions** in thechat window's sidebar (`UpdateBadge`). After a confirmation it restarts into the release(`updates.install()`): straight away when it is staged, otherwise once its download-finishes, without a second click. The badge hides while the release waits for the iPhone-app and disappears once Codync runs the latest version.+finishes, without a second click. The badge disappears once Codync runs the latest version.-The app checks daily (hourly while a release waits for the iPhone app, below).+The app checks daily.Automatic installation waits until no Codync window is focused, there has been nokeyboard/mouse input for ten minutes, and the local host reports that it is idle.A staged update also installs when quitting. Manual installation can interrupt work.-A release whose `latest-mac.yml` (`latest.yml` on Windows) names a `minApp` newer than the App Store's iPhone-app waits while an iPhone is paired with this host.+The release it finds is the one the release gate marked latest, so it always works with the+iPhone app in the App Store+([holding releases](../reference/compatibility.md#holding-releases-for-the-app-store)).Before replacement on macOS, Codync unregisters its screen helper and stops the host(`codync-host stop`), which runs from inside the app; on Linux the installed host keeps@@ -115,9 +115,9 @@ Run `cd apps/desktop && npm run typecheck && npm test`. The updater tests load tactual main-process modules with fake Electron, service commands, network andtimers; they never stop a real host or replace an installed app. Coverage includesmanual and idle installation, renderer state broadcasts, download errors, repeated-clicks, errors during shutdown, staged Quit, host restart markers and binary health-checks, development-build exclusion, and iPhone compatibility holds. The native-quit event ordering has a separate regression test and an updater integration test.+clicks, errors during shutdown, staged Quit, host restart markers, binary health+checks and development-build exclusion. The native quit event ordering has a+separate regression test and an updater integration test.The macOS and Windows bundled-host branches and Linux's externally managed hostbranch run against simulated OS boundaries. These tests do not replace a signed@@ -143,11 +143,10 @@ move to the desktop app; 2.7.1 is the first release they accept. Support endsneed a manual download of the desktop app. Remove together:- the Sparkle part of **Update feeds** in `.github/workflows/release-desktop.yml`- (`generate_appcast`, `annotate-appcast.py`, `verify-appcast.py`) and `build/appcast.xml`- in the macOS artifact upload and in **Publish** (keep the step's `minApp` line for- `latest-mac.yml`, electron-updater reads it)+ (`generate_appcast`, `verify-appcast.py`) and `build/appcast.xml` in the macOS artifact+ upload and in **Publish**- `SUPublicEDKey` in `apps/desktop/electron-builder.yml`-- `packaging/updates/annotate-appcast.py`, `verify-appcast.py`, `macos-public-key.txt`+- `packaging/updates/verify-appcast.py`, `macos-public-key.txt`- the `SPARKLE_PRIVATE_KEY` secret (row below) and the appcast mentions in`docs/architecture/desktop-app.md` and `docs/reference/compatibility.md`@@ -211,9 +210,9 @@ already distributed clients. Repository Actions secrets:| `HOST_UPDATE_SIGNING_KEY` | Separate base64 32-byte Ed25519 seed for host manifests || `TAP_TOKEN` | Token that pushes `leepokai/homebrew-codync` (release gate) and the version tags (Auto Tag) |-The desktop workflow signs and notarizes the Mac app, builds its DMG and zip, adds-`minApp` to `latest-mac.yml` and generates `appcast.xml` for the zip; it builds the-Linux AppImage, deb and tar.gz on x86_64 and arm64. The host+The desktop workflow signs and notarizes the Mac app, builds its DMG and zip and+generates `appcast.xml` for the zip; it builds the Linux AppImage, deb and tar.gz+on x86_64 and arm64. The hostworkflow emits `codync-host-<platform>.update.json` and `.update.json.sig` alongsideeach archive. Signing fails if a private key does not match the committed publickey. Never commit private keys or put them in command-line arguments.diff --git a/docs/reference/compatibility.md b/docs/reference/compatibility.mdindex d85769c6..dc5def43 100644--- a/docs/reference/compatibility.md+++ b/docs/reference/compatibility.md@@ -84,34 +84,10 @@ follows the App Store:Before the gate, 2.18.0 (the first real raise) went straight to the website: in its firstday 33 new computers were paired by the App Store's iPhone 2.17.0 and received no messagefrom it.-- **Each updater** also asks the App Store before installing a release that raises `minApp`.- It predates the gate, which now keeps such releases from updaters, so this second check- rarely decides anything:--| Situation | Host update |-|---|---|-| The release doesn't raise `minApp` (almost always) | Installs; the App Store isn't asked |-| No iPhone was ever paired with this computer | Installs |-| The App Store has that iPhone version or newer | Installs |-| The App Store has an older version (in review) | Waits; retried on the next check |-| The App Store can't be asked or has no answer | Automatic update waits; a person can install anyway |--- **Standalone hosts** (`host/src/update`): each release publishes a signed- `codync-host-<platform>.compat.json` (`{"version", "minApp"}`, ~50 bytes, same key as the- manifest, written by `sign-host-release.py` from `MIN_APP`), so the updater decides before- downloading anything; for a release without one it runs the verified download- (`codync-host compat`) instead. The signed manifest itself is unchanged, as old hosts- expect it. Waiting shows as phase `waitingForApp` with `requiredApp` and `appStoreVersion`- in the update status; `codync-host update --skip-app-check` (API- `installHostUpdate {"skipAppCheck": true}`) installs anyway. With automatic updates on, a waiting host asks the App Store hourly and updates as- soon as the app is there.-- **Desktop app** (electron-updater): the release workflow adds `minApp` to `latest-mac.yml`,- and `Updates.available` (`apps/desktop/src/main/updates.ts`) holds the release while the- local host's `minApp` is lower, an iPhone is paired and the App Store is behind, before- anything downloads. A check the person starts shows why. While waiting it checks hourly. The Sparkle appcast kept for the- SwiftUI Mac app's installs carries `<codync:minApp>` (`packaging/updates/annotate-appcast.py`);- it is deprecated and removed after 2026-11-06 ([updates guide](../guides/updates.md#deprecated-the-sparkle-migration-appcast-remove-after-2026-11-06)).-- Hosts released before 2.5.0 don't ask; the release gate keeps such releases from them.+- **Updaters** only compare versions with the latest release; they don't ask the App Store+ themselves (they did from 2.5.0 to 2.19.2, before the gate). The hidden `codync-host compat`+ command stays: the desktop app runs it to read `environment` before installing the host, and+ those older hosts run it on a downloaded update to read its `minApp`.On the iPhone, the *Update Codync* button of an *Update this app* notice is greyed out with"still in App Store review" while the App Store has an older version; an unanswered lookupdiff --git a/host/src/api/host.rs b/host/src/api/host.rsindex bd053415..e990a03f 100644--- a/host/src/api/host.rs+++ b/host/src/api/host.rs@@ -22,11 +22,10 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value"installHostUpdate" => {let port = hub.port;let force = b["force"].as_bool().unwrap_or(false);- let skip_app_check = b["skipAppCheck"].as_bool().unwrap_or(false);if !force && hub.busy() {bail!("host is busy; retry when idle or explicitly allow interruption");}- tokio::task::spawn_blocking(move || crate::update::spawn_worker(port, force, skip_app_check)).await??;+ tokio::task::spawn_blocking(move || crate::update::spawn_worker(port, force)).await??;json!({"scheduled": true})}"voiceStatus" => crate::voice::status(&hub.store)?,diff --git a/host/src/compat.rs b/host/src/compat.rsindex 2b88d9b6..1102d0a1 100644--- a/host/src/compat.rs+++ b/host/src/compat.rs@@ -5,56 +5,14 @@use serde_json::Value;/// The oldest client (iPhone, desktop app, terminal client) this host still serves correctly.-/// Raise it only after that client version is out (App Store included), and only when this-/// host stops sending or accepting something older clients depend on.+/// Raise it only when this host stops sending or accepting something older clients depend on;+/// the release gate (tools/release-gate.py) then offers the release once the App Store has that+/// iPhone app.pub const MIN_APP: &str = "2.18.0";/// The oldest host the terminal client works with.pub const MIN_HOST: &str = "2.12.0";-/// The iPhone app in the App Store, looked up to hold back host updates that need a newer-/// app than the store has (still in review).-pub const APP_STORE_ID: &str = "6760984418";--/// The iPhone app version live in the App Store; `None` when the lookup has no result.-pub async fn app_store_version() -> anyhow::Result<Option<String>> {- let url = format!("https://itunes.apple.com/lookup?id={APP_STORE_ID}");- let res: Value = crate::http()- .get(url)- .timeout(std::time::Duration::from_secs(10))- .send()- .await?- .error_for_status()?- .json()- .await?;- Ok(res["results"][0]["version"].as_str().map(str::to_owned))-}--/// Whether installing a release that needs `new_min_app` would lock out iPhones.-#[derive(Debug, PartialEq, Eq)]-pub enum Gate {- Proceed,- /// The App Store doesn't have that app yet (`store`), or couldn't be asked (`None`).- WaitForApp {- required: String,- store: Option<String>,- },-}--/// Decides a host update: only a release that raises `minApp`, on a computer with iPhones,-/// waits until the App Store has an app that new. An unanswered lookup waits too: going ahead-/// on a guess is what this gate exists to prevent (a person can still choose to).-pub fn gate(current_min_app: &str, new_min_app: &str, iphones: bool, store: &anyhow::Result<Option<String>>) -> Gate {- if !below(current_min_app, new_min_app) || !iphones {- return Gate::Proceed;- }- match store {- Ok(Some(version)) if !below(version, new_min_app) && parse(version).is_some() => Gate::Proceed,- Ok(Some(version)) => Gate::WaitForApp { required: new_min_app.to_owned(), store: Some(version.clone()) },- _ => Gate::WaitForApp { required: new_min_app.to_owned(), store: None },- }-}-/// Which side has to update before a client and a host can work together.#[derive(Debug, Clone, PartialEq, Eq)]pub enum Mismatch {@@ -66,7 +24,7 @@ pub enum Mismatch {/// `major.minor.patch`, ignoring a leading `v` and any pre-release or build suffix; missing/// parts count as 0. `None` for anything else, which never blocks a connection.-pub fn parse(version: &str) -> Option<(u64, u64, u64)> {+fn parse(version: &str) -> Option<(u64, u64, u64)> {let core = version.trim().trim_start_matches('v');let core = core.split(['-', '+']).next()?;let mut parts = core.split('.');@@ -80,7 +38,7 @@ pub fn parse(version: &str) -> Option<(u64, u64, u64)> {}/// Whether `version` is below `minimum`; unreadable versions never are.-pub fn below(version: &str, minimum: &str) -> bool {+fn below(version: &str, minimum: &str) -> bool {matches!((parse(version), parse(minimum)), (Some(v), Some(m)) if v < m)}@@ -131,23 +89,6 @@ mod tests {assert!(!below("2.4.0-dev", "2.4.0"));}- #[test]- fn host_updates_wait_for_the_iphone_app_only_when_needed() {- let ok = |v: &str| -> anyhow::Result<Option<String>> { Ok(Some(v.to_owned())) };- let wait = |store: Option<&str>| Gate::WaitForApp { required: "2.6.0".into(), store: store.map(Into::into) };- // Same floor, or no iPhone here: the App Store doesn't matter.- assert_eq!(gate("2.6.0", "2.6.0", true, &Err(anyhow::anyhow!("offline"))), Gate::Proceed);- assert_eq!(gate("2.3.0", "2.6.0", false, &ok("2.2.1")), Gate::Proceed);- // A raised floor waits for the App Store.- assert_eq!(gate("2.3.0", "2.6.0", true, &ok("2.6.0")), Gate::Proceed);- assert_eq!(gate("2.3.0", "2.6.0", true, &ok("2.7.1")), Gate::Proceed);- assert_eq!(gate("2.3.0", "2.6.0", true, &ok("2.5.9")), wait(Some("2.5.9")));- // No answer, or one that can't be read, isn't permission.- assert_eq!(gate("2.3.0", "2.6.0", true, &Err(anyhow::anyhow!("offline"))), wait(None));- assert_eq!(gate("2.3.0", "2.6.0", true, &Ok(None)), wait(None));- assert_eq!(gate("2.3.0", "2.6.0", true, &ok("soon")), wait(Some("soon")));- }-#[test]fn decides_which_side_updates() {let host = |version: &str, min_app: Option<&str>| {diff --git a/host/src/main.rs b/host/src/main.rsindex d54c93ed..ad4bd609 100644--- a/host/src/main.rs+++ b/host/src/main.rs@@ -140,10 +140,6 @@ enum Sub {/// Allow a manual update to interrupt active bots (their sessions resume).#[arg(long)]force: bool,- /// Install even if the App Store doesn't have the iPhone app this release needs yet- /// (paired iPhones then ask for an update they may not get until review is done).- #[arg(long)]- skip_app_check: bool,#[arg(long, default_value_t = service::DEFAULT_PORT)]port: u16,#[arg(long)]@@ -151,7 +147,9 @@ enum Sub {#[arg(long, hide = true)]worker: bool,},- /// The versions this host works with (JSON), asked of a downloaded update before installing it.+ /// The versions and environment of this host (JSON). The desktop app reads `environment`+ /// from it before installing the host; hosts before 2.19.3 also read `minApp` from a+ /// downloaded update.#[command(hide = true)]Compat,/// Show whether the host is installed and running.@@ -402,7 +400,7 @@ async fn main() -> Result<()> {);Ok(())}- Sub::Update { check, status, auto, force, skip_app_check, port, json, worker } => {+ Sub::Update { check, status, auto, force, port, json, worker } => {let status = if let Some(auto) = auto {update::set_automatic(auto == "on")?} else if status {@@ -410,10 +408,10 @@ async fn main() -> Result<()> {} else if check {update::check().await?} else if !worker && service::installed() {- tokio::task::spawn_blocking(move || update::spawn_worker(port, force, skip_app_check)).await??;+ tokio::task::spawn_blocking(move || update::spawn_worker(port, force)).await??;update::status()?} else {- update::apply(port, force, skip_app_check, worker).await?+ update::apply(port, force, worker).await?};if json {println!("{}", serde_json::to_string_pretty(&status)?);@@ -427,18 +425,6 @@ async fn main() -> Result<()> {if let Some(version) = status["state"]["availableVersion"].as_str() {println!("Available version: {version}");}- if let Some(required) = status["state"]["requiredApp"].as_str() {- match status["state"]["appStoreVersion"].as_str() {- Some(store) => println!(- "Waiting for the iPhone app {required} (the App Store has {store}); \- it installs once that passes review"- ),- None => println!(- "Waiting for the iPhone app {required}: couldn't check the App Store. \- `codync-host update --skip-app-check` installs anyway"- ),- }- }if let Some(error) = status["state"]["error"].as_str() {println!("Last error: {error}");}diff --git a/host/src/tui/app/events.rs b/host/src/tui/app/events.rsindex ccb85af5..a7a8c8d9 100644--- a/host/src/tui/app/events.rs+++ b/host/src/tui/app/events.rs@@ -192,7 +192,12 @@ impl App {}};match after {- After::Nothing | After::Tracked | After::Answered(_) | After::Sheet(_) | After::Sent(_) | After::Connection(_, _) => {}+ After::Nothing+ | After::Tracked+ | After::Answered(_)+ | After::Sheet(_)+ | After::Sent(_)+ | After::Connection(_, _) => {}After::Installed => {self.error = None;self.flash("Host installed; connecting…");@@ -211,18 +216,9 @@ impl App {self.backends = v["backends"].as_array().cloned().unwrap_or_default();self.flash("Agents refreshed");}- After::Update => match (v["state"]["availableVersion"].as_str(), v["state"]["requiredApp"].as_str()) {- (Some(version), Some(app)) => self.flash(&match v["state"]["appStoreVersion"].as_str() {- Some(store) => format!(- "Version {version} waits for the iPhone app {app} (App Store has {store}); it installs after review"- ),- None => format!(- "Version {version} waits: couldn't check the App Store for the iPhone app {app}. \- codync-host update --skip-app-check installs anyway"- ),- }),- (Some(version), None) => self.flash(&format!("Version {version} is available: run codync-host update")),- (None, _) => self.flash("The host is up to date."),+ After::Update => match v["state"]["availableVersion"].as_str() {+ Some(version) => self.flash(&format!("Version {version} is available: run codync-host update")),+ None => self.flash("The host is up to date."),},After::Thread => {for e in v["entries"].as_array().into_iter().flatten() {diff --git a/host/src/update/install.rs b/host/src/update/install.rsindex 722e00fe..3fecd9be 100644--- a/host/src/update/install.rs+++ b/host/src/update/install.rs@@ -108,64 +108,8 @@ whereOk(())}-/// Whether iPhones use this host: asked of the running host, assumed when it can't answer.-async fn iphones_paired(port: u16) -> bool {- let devices = async {- let token = std::fs::read_to_string(service::data_dir().join("token")).ok()?;- let res: serde_json::Value = crate::http()- .post(format!("http://127.0.0.1:{port}/api/devices"))- .bearer_auth(token.trim())- .json(&serde_json::json!({}))- .timeout(Duration::from_secs(5))- .send()- .await- .ok()?- .error_for_status()- .ok()?- .json()- .await- .ok()?;- Some(res["devices"].as_array()?.iter().any(|d| d["platform"] == "ios"))- };- devices.await.unwrap_or(true)-}--/// The `minApp` a downloaded (verified) executable declares.-async fn staged_min_app(stage: &Path) -> Result<String> {- let output = tokio::process::Command::new(stage).arg("compat").kill_on_drop(true).output();- let output = tokio::time::timeout(Duration::from_secs(10), output).await??;- ensure!(output.status.success(), "the downloaded host couldn't report the iPhone app it needs");- let compat: serde_json::Value = serde_json::from_slice(&output.stdout)?;- compat["minApp"].as_str().map(str::to_owned).context("the downloaded host reported no minimum app version")-}--/// Whether a release needing `new_min_app` waits for the App Store (only if it raises the floor).-async fn app_store_gate(new_min_app: &str, port: u16) -> crate::compat::Gate {- if !crate::compat::below(crate::compat::MIN_APP, new_min_app) {- return crate::compat::Gate::Proceed;- }- let iphones = iphones_paired(port).await;- let store = if iphones { crate::compat::app_store_version().await } else { Ok(None) };- crate::compat::gate(crate::compat::MIN_APP, new_min_app, iphones, &store)-}--pub async fn apply(- release: &release::Release,- target: &Path,- port: u16,- force: bool,- skip_app_check: bool,-) -> Result<crate::compat::Gate> {+pub async fn apply(release: &release::Release, target: &Path, port: u16, force: bool) -> Result<()> {require_standalone(target)?;- // The release's signed compat file answers before anything is downloaded; releases- // without one are asked after download (below).- let early_min_app = if skip_app_check { None } else { release::min_app(release).await.ok() };- if let Some(min_app) = &early_min_app {- let gate = app_store_gate(min_app, port).await;- if gate != crate::compat::Gate::Proceed {- return Ok(gate);- }- }let managed = service::installed();if managed {service::require_executable(target)?;@@ -198,14 +142,6 @@ pub async fn apply(&& String::from_utf8_lossy(&output.stdout).trim() == format!("codync-host {}", release.version),"downloaded executable reported the wrong version");- // Before anything stops: a release that needs a newer iPhone app than the App Store- // has waits, so paired iPhones aren't asked for an update they can't get yet.- if !skip_app_check && early_min_app.is_none() {- let gate = app_store_gate(&staged_min_app(&stage).await?, port).await;- if gate != crate::compat::Gate::Proceed {- return Ok(gate);- }- }let old_hash = release::sha256(&std::fs::read(target)?);let new_hash = release::sha256(&std::fs::read(&stage)?);let identity = old_health.as_ref().and_then(|h| h["computerId"].as_str());@@ -249,8 +185,7 @@ pub async fn apply(Ok(())},)- .await?;- Ok(crate::compat::Gate::Proceed)+ .await}.await;let _ = std::fs::remove_file(stage);diff --git a/host/src/update/mod.rs b/host/src/update/mod.rsindex 8cc1ef5a..4c02178c 100644--- a/host/src/update/mod.rs+++ b/host/src/update/mod.rs@@ -44,10 +44,6 @@ struct State {available_version: Option<String>,checked_at: Option<i64>,error: Option<String>,- /// `waitingForApp`: the iPhone app the available release needs.- required_app: Option<String>,- /// `waitingForApp`: what the App Store has (`None`: couldn't ask it).- app_store_version: Option<String>,}fn read<T: serde::de::DeserializeOwned + Default>(name: &str) -> Result<T> {@@ -116,13 +112,7 @@ pub async fn check() -> Result<Value> {let available = (semver::Version::parse(&release.version)?> semver::Version::parse(env!("CARGO_PKG_VERSION"))?).then_some(release.version);- // Still the release that waits for the iPhone app: keep saying why.- let waiting = state.phase == "waitingForApp" && available.is_some() && available == state.available_version;- if !waiting {- state.phase = if available.is_some() { "available" } else { "upToDate" }.into();- state.required_app = None;- state.app_store_version = None;- }+ state.phase = if available.is_some() { "available" } else { "upToDate" }.into();state.available_version = available;state.error = None;}@@ -137,7 +127,7 @@ pub async fn check() -> Result<Value> {status()}-pub async fn apply(port: u16, force: bool, skip_app_check: bool, worker: bool) -> Result<Value> {+pub async fn apply(port: u16, force: bool, worker: bool) -> Result<Value> {crate::environment::Environment::current().require_release_updates()?;let deadline = tokio::time::Instant::now() + Duration::from_secs(5);let _lock = loop {@@ -162,15 +152,8 @@ pub async fn apply(port: u16, force: bool, skip_app_check: bool, worker: bool) -state.available_version = Some(release.version.clone());state.phase = "installing".into();write("update-state.json", &state)?;- match install::apply(&release, &target, port, force, skip_app_check).await? {- crate::compat::Gate::Proceed => state.phase = "complete".into(),- // Not a failure: the next check installs it once the App Store has that app.- crate::compat::Gate::WaitForApp { required, store } => {- state.phase = "waitingForApp".into();- state.required_app = Some(required);- state.app_store_version = store;- }- }+ install::apply(&release, &target, port, force).await?;+ state.phase = "complete".into();Ok::<_, anyhow::Error>(())}.await;@@ -191,7 +174,7 @@ pub async fn apply(port: u16, force: bool, skip_app_check: bool, worker: bool) -/// The updater must live outside the daemon's job/cgroup. Otherwise stopping/// the host would also kill the process responsible for starting its replacement.-pub fn spawn_worker(port: u16, force: bool, skip_app_check: bool) -> Result<()> {+pub fn spawn_worker(port: u16, force: bool) -> Result<()> {crate::environment::Environment::current().require_release_updates()?;let _lock = lock()?;let previous: State = read("update-state.json")?;@@ -207,13 +190,8 @@ pub fn spawn_worker(port: u16, force: bool, skip_app_check: bool) -> Result<()>if force {args.push("--force".to_owned());}- if skip_app_check {- args.push("--skip-app-check".to_owned());- }let mut state = State { phase: "scheduled".into(), checked_at: Some(crate::store::now_ms()), ..previous };state.error = None;- state.required_app = None;- state.app_store_version = None;write("update-state.json", &state)?;if let Err(error) = spawn_job(&executable, &args) {state.phase = "failed".into();@@ -263,27 +241,12 @@ pub async fn automatic_loop(hub: Arc<Hub>) {return;}let mut last_check = None;- let mut last_store_probe = None;loop {tokio::time::sleep(Duration::from_secs(60)).await;let enabled = read::<Config>("update-config.json").is_ok_and(|c| c.automatic);if !enabled || hub.busy() {continue;}- // Waiting for the iPhone app: look at the App Store hourly and update as soon as it's- // there, instead of at the next daily check.- if let Ok(state) = read::<State>("update-state.json")- && state.phase == "waitingForApp"- && let Some(required) = state.required_app- && last_store_probe.is_none_or(|at: tokio::time::Instant| at.elapsed() >= Duration::from_secs(60 * 60))- {- last_store_probe = Some(tokio::time::Instant::now());- if let Ok(Some(store)) = crate::compat::app_store_version().await- && !crate::compat::below(&store, &required)- {- last_check = None;- }- }if last_check.is_some_and(|at: tokio::time::Instant| at.elapsed() < Duration::from_secs(24 * 60 * 60)) {continue;}@@ -294,7 +257,7 @@ pub async fn automatic_loop(hub: Arc<Hub>) {match check().await {Ok(status) if status["state"]["availableVersion"].is_string() => {let port = hub.port;- match tokio::task::spawn_blocking(move || spawn_worker(port, false, false)).await {+ match tokio::task::spawn_blocking(move || spawn_worker(port, false)).await {Ok(Ok(())) => {}result => tracing::warn!(?result, "could not start automatic host update"),}diff --git a/host/src/update/release.rs b/host/src/update/release.rsindex 08b25971..17334ebb 100644--- a/host/src/update/release.rs+++ b/host/src/update/release.rs@@ -62,28 +62,6 @@ pub fn verify_manifest(bytes: &[u8], signature: &str, public_key: &str, platformOk(release)}-/// The signed compat file published beside a release: the iPhone app version it needs,-/// readable before downloading the release (docs/reference/compatibility.md).-pub fn verify_compat(bytes: &[u8], signature: &str, public_key: &str, version: &str) -> Result<String> {- let key: [u8; 32] =- B64.decode(public_key.trim())?.try_into().map_err(|_| anyhow::anyhow!("invalid update public key"))?;- let signature = Signature::from_slice(&B64.decode(signature.trim())?)?;- VerifyingKey::from_bytes(&key)?.verify_strict(bytes, &signature).context("compat signature is invalid")?;- let compat: serde_json::Value = serde_json::from_slice(bytes).context("reading the signed compat file")?;- ensure!(compat["version"] == version, "compat file is for another release");- let min_app = compat["minApp"].as_str().context("compat file has no minApp")?;- ensure!(crate::compat::parse(min_app).is_some(), "compat file has an invalid minApp");- Ok(min_app.to_owned())-}--/// `release`'s `minApp` from its signed compat file (releases before 2.5.0 have none).-pub async fn min_app(release: &Release) -> Result<String> {- let url = format!("{RELEASES}/download/v{}/codync-host-{}.compat.json", release.version, release.platform);- let bytes = download(&url, 4 * 1024).await?;- let signature = download(&format!("{url}.sig"), 1024).await?;- verify_compat(&bytes, std::str::from_utf8(&signature)?, PUBLIC_KEY, &release.version)-}-pub async fn download(url: &str, limit: usize) -> Result<Vec<u8>> {let mut response = crate::http().get(url)diff --git a/host/src/update/tests.rs b/host/src/update/tests.rsindex a860e71d..38910750 100644--- a/host/src/update/tests.rs+++ b/host/src/update/tests.rs@@ -50,27 +50,6 @@ fn only_signed_platform_matched_manifests_are_accepted() {assert!(release::verify_manifest(&redirected, &signature, &public, "linux-arm64").is_err());}-#[test]-fn only_signed_compat_files_for_the_release_are_accepted() {- let key = SigningKey::from_bytes(&[17; 32]);- let public = B64.encode(key.verifying_key().as_bytes());- let sign = |bytes: &[u8]| B64.encode(key.sign(bytes).to_bytes());- let compat = br#"{"version": "3.0.0", "minApp": "2.9.0"}"#;- assert_eq!(release::verify_compat(compat, &sign(compat), &public, "3.0.0").unwrap(), "2.9.0");- // Another release's file, a forged one, or one without a readable minApp is refused.- assert!(release::verify_compat(compat, &sign(compat), &public, "3.0.1").is_err());- let other = B64.encode(SigningKey::from_bytes(&[18; 32]).verifying_key().as_bytes());- assert!(release::verify_compat(compat, &sign(compat), &other, "3.0.0").is_err());- let mut altered = compat.to_vec();- altered[30] = b'8';- assert!(release::verify_compat(&altered, &sign(compat), &public, "3.0.0").is_err());- let bad = br#"{"version": "3.0.0", "minApp": "soon"}"#;- assert!(release::verify_compat(bad, &sign(bad), &public, "3.0.0").is_err());- // A signed release manifest isn't a compat file.- let manifest = serde_json::to_vec(&manifest()).unwrap();- assert!(release::verify_compat(&manifest, &sign(&manifest), &public, "3.0.0").is_err());-}-fn archive(symlink: bool) -> Vec<u8> {let gzip = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::default());let mut tar = tar::Builder::new(gzip);diff --git a/packaging/updates/annotate-appcast.py b/packaging/updates/annotate-appcast.pydeleted file mode 100755index b89a2ed0..00000000--- a/packaging/updates/annotate-appcast.py+++ /dev/null@@ -1,28 +0,0 @@-#!/usr/bin/env python3-"""Add the iPhone app version a release needs (codync:minApp) to its Sparkle appcast item.--The Mac app reads it from the item before installing (docs/reference/compatibility.md).-The feed itself isn't signed; Sparkle signs the archive, so editing the XML is safe.-"""-import sys-import xml.etree.ElementTree as ET--SPARKLE = "http://www.andymatuschak.org/xml-namespaces/sparkle"-CODYNC = "https://codync.dev/xml-namespaces/appcast"---def main():- feed, min_app = sys.argv[1:]- ET.register_namespace("sparkle", SPARKLE)- ET.register_namespace("dc", "http://purl.org/dc/elements/1.1/")- ET.register_namespace("codync", CODYNC)- tree = ET.parse(feed)- items = tree.getroot().findall("./channel/item")- assert len(items) == 1, "expected one current release"- element = ET.SubElement(items[0], f"{{{CODYNC}}}minApp")- element.text = min_app- tree.write(feed, xml_declaration=True, encoding="utf-8")---if __name__ == "__main__":- main()diff --git a/packaging/updates/sign-host-release.py b/packaging/updates/sign-host-release.pyindex a427d9cd..d4320dfd 100644--- a/packaging/updates/sign-host-release.py+++ b/packaging/updates/sign-host-release.py@@ -1,7 +1,5 @@#!/usr/bin/env python3-"""Create a signed manifest for one standalone host release archive, and a signed-compat file (the iPhone app version the release needs) that updaters read before-downloading anything (docs/reference/compatibility.md).+"""Create a signed manifest for one standalone host release archive.HOST_UPDATE_SIGNING_KEY contains a base64 Ed25519 seed. Only the public key iscommitted. Requires cryptography (installed by the release workflow).@@ -48,15 +46,6 @@ def main():output.write_bytes(data)output.with_suffix(output.suffix + ".sig").write_text(base64.b64encode(key.sign(data)).decode() + "\n")print(f"Signed {output.name}")- source = Path(__file__).parents[2].joinpath("host/src/compat.rs").read_text()- min_app = re.search(r'pub const MIN_APP: &str = "([0-9]+\.[0-9]+\.[0-9]+)";', source)- if not min_app:- raise SystemExit("MIN_APP not found in host/src/compat.rs")- data = (json.dumps({"version": version, "minApp": min_app[1]}, indent=2) + "\n").encode()- output = args.archive.with_name(f"codync-host-{args.platform}.compat.json")- output.write_bytes(data)- output.with_suffix(output.suffix + ".sig").write_text(base64.b64encode(key.sign(data)).decode() + "\n")- print(f"Signed {output.name}")if __name__ == "__main__":diff --git a/packaging/updates/verify-appcast.py b/packaging/updates/verify-appcast.pyindex 4946c226..ddc50e41 100644--- a/packaging/updates/verify-appcast.py+++ b/packaging/updates/verify-appcast.py@@ -30,8 +30,6 @@ def main():archive.read_bytes(),)assert info["SUPublicEDKey"] == public_key, "app has the wrong Sparkle public key"- min_app = item.findtext("{https://codync.dev/xml-namespaces/appcast}minApp")- assert min_app and all(part.isdigit() for part in min_app.split(".")), "appcast needs codync:minApp"print("Sparkle appcast matches the signed app and release archive")