Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Keep test prereleases off the production update feed and sign the feed - #924

Draft
FuJacob wants to merge 1 commit into
mainfrom
security/appcast-channel
Draft

FuJacob wants to merge 1 commit into
mainfrom
security/appcast-channel

Conversation

@FuJacob

@FuJacob FuJacob commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Summary

Every publish, prereleases included, overwrites the single appcast that every install polls with automatic updates on. The feed itself is unsigned. Republish Pages also accepted a free-form CNAME and redeployed the newest successful Release run from any ref. This keeps test prereleases off the production feed, signs the feed, and limits what Republish Pages can deploy.

Skipping the appcast for every prerelease would break updates for everyone. All 22 releases so far, including the one the live feed serves now (0.6.2-beta), are vX.Y.Z-beta, and the workflow already classes those as prereleases. So this PR narrows the rule instead:

  • release.yml computes production_channel in the metadata step. It is true for X.Y.Z and plain X.Y.Z-beta (optionally with +build metadata) and false for any other pre-release suffix (-rc.1, -beta.2, -alpha, …). Test prereleases still get a GitHub prerelease with the DMG. They skip Sparkle signing, the appcast and the Pages deploy, and update-homebrew-cask skips them too, because the cask is also a production channel. The run summary says whether the feed was updated.
  • The feed is signed. Sparkle 2.9.1, the version pinned in project.yml, supports signed feeds: given an .xml file, sign_update appends an EdDSA signature block as a trailing XML comment. Publish now runs sign_update --ed-key-file … --disable-signing-warning build/appcast.xml and then sign_update --verify on the result. --disable-signing-warning avoids re-serializing the XML, so the generated bytes are signed unchanged. SURequireSignedFeed is not set (see Risk).
  • republish-pages.yml:
    • The domain is hardcoded to updates.cotabby.app (it was a free-form custom_domain input).
    • The job fails unless dispatched from main or a v* tag. The github-pages environment already enforces this.
    • It only uses successful Release runs that were tag pushes or manual runs from main. For a tag-push run, the tag must exist and point at the run's headSha, so a branch named like a tag doesn't count.
    • It walks back to the newest such run that has an appcast.xml, so dry runs and test prereleases are skipped instead of ending the search.
  • The release.yml metadata outputs are written in one grouped redirect, which clears the existing shellcheck SC2129 note. RELEASING.md documents the channel rule.

Validation

  • actionlint: republish-pages.yml is clean. release.yml shows only the SC2046 note already on main, in the certificate import step, which this PR doesn't touch.
  • I ran the production-channel regex in bash against 0.6.2-beta, 1.0.0, 0.7.0-beta+build.5 (production) and 1.0.0-rc.1, 0.7.0-beta.2, 0.7.0-alpha, 0.7.0-betax, 0.7.0-Beta (test). Each came out as listed.
  • I extracted the republish selection script and ran it locally against this repo with read-only gh calls. The run filter returns tag-push and main-dispatch runs. The tag check matched v0.6.2-beta to its run's commit and skipped older runs whose tags have since moved. The script then exited with the intended error, because no retained run still has an appcast.xml (see Risk).
  • I read sign_update's feed signing and verification paths and the client's feed loading in Sparkle 2.9.1 (sign_update/main.swift, common_cli/Signing.swift, SPUExtractSignedFeed.m, SUAppcastDriver.m). Without SURequireSignedFeed, the client parses the downloaded bytes as before, and the signature block is an ordinary trailing XML comment.
  • Not built or run locally (no disk space on the authoring machine); CI build and tests are the compile check. PR CI doesn't run release.yml or republish-pages.yml. The feed-signing step first runs on the next real publish: check that https://updates.cotabby.app/appcast.xml ends with a <!-- sparkle-signatures: block, and that an existing install still sees the update.

Linked issues

None filed. Addresses L13 from a static security review of 8cdbea2.

Risk / rollout notes

  • Beta testers / channel follow-up. Nothing changes for the way releases ship today: vX.Y.Z-beta still reaches every install and the cask. A tag with any other suffix now reaches nobody automatically; testers have to download it from the GitHub prerelease. A real beta channel would be a natural follow-up: Sparkle channels (sparkle:channel items plus allowedChannels(for:) in an updater delegate) or a second feed.
  • Signed feed is not enforced yet. Turning on SURequireSignedFeed (Sparkle then also requires SUVerifyUpdateBeforeExtraction) before signed feeds have been served in production could strand installs on a feed they reject. Suggested follow-up, after one or two releases with a verified signed feed: set both keys in CotabbyInfo.plist and ship that build.
  • Republish Pages can only restore a retained run. Run artifacts expire after 90 days by default. The run behind the live 0.6.2-beta feed (July 20) has none left, so today this workflow cannot restore the current feed. If you want a durable source, attach appcast.xml to each GitHub Release, or raise artifact retention.
  • Conflicts. This PR conflicts in release.yml with Gate release signing behind a reviewed environment and commits on main #916, which moves appcast signing from publish into notarize, and with Pin release DMG tooling by hash and keep signing keys out of reach in the build job #920, which adds the key check and cleanup steps to publish. Whichever merges later needs a rebase. With Gate release signing behind a reviewed environment and commits on main #916 in, the production_channel conditions and the "Sign the update feed" step go with the signing steps into notarize, the Pages steps stay in publish, and notarize's signing condition becomes publish == 'true' && production_channel == 'true'.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
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