Repository navigation
Publish stable Research download links through the updates Worker - #1073
Conversation
AnthonyRonning
left a comment
There was a problem hiding this comment.
Reviewed against maple-marketing#39 and the companion maple-marketing#41. The overall design is solid:
- installer assets are pinned by checksum
- publishing is gated on a successful
release.ymlrun for the exact tag and commit - everything is re-checked right before deploy and verified live after
- visitor input never influences the redirect target, and
/installers.jsonitself isn't publicly exposed
Verified locally: bun test in services/updates passes 49/49 and tsc --noEmit is clean. The HEAD availability check works against real assets: following the redirect for v3.4.1/Maple_3.4.1_universal.dmg gives 200, Content-Length: 124795793, and Content-Disposition: attachment; filename=....
Main points, inline:
- Publishing coupling:
latest.json, and therefore desktop auto-updates, now only advances if all six installers are found and pass their checks. - Fallback behavior: consider a 302 to the releases page instead of a plain-text 503 when the catalog is missing or invalid.
- Minor: the shorter post-deploy verification window.
Also worth checking, though it's not in this diff: marketing#41 notes that Cloudflare filters some automated clients on the new paths. Linux users often download with wget/curl, and download managers hit these links too, while the publisher's verification uses its own User-Agent. Consider a WAF/bot-protection skip rule for /download/*, and confirm that plain curl -I and wget get the 302.
Generated by Claude Code
| bun run prepare:installers prepare ../../release-metadata/release.json \ | ||
| ../../release-metadata/latest.json ../../release-metadata/runs.json "$1" public/installers.json | ||
| ' -- "${release_sha}" | ||
| cp release-metadata/latest.json services/updates/public/latest.json |
There was a problem hiding this comment.
Desktop auto-updates are now blocked whenever the installer catalog can't be built. latest.json is copied into the bundle only after prepare:installers prepare succeeds. That command requires exactly one matching asset for all six installer kinds, plus a HEAD check against each one. Under set -e, any of the following now stops the updater pointer from advancing:
- a release missing its DMG or APK
- a filename change, e.g. an RPM release number or a new arm64 DMG making the match ambiguous
- a transient GitHub failure that outlasts the retries
The README's statement that "Download catalog failures cannot break this endpoint" holds for live requests but not for publishing.
Suggestion: publish latest.json independently, and treat a catalog failure as a separate, loud failure that leaves the previous installers.json in place. Or, if the coupling is intended, say so in the README.
Generated by Claude Code
| // A missing or corrupt installer catalog must never affect latest.json. | ||
| } | ||
| return textResponse( | ||
| "Download temporarily unavailable. Please try again.\n", |
There was a problem hiding this comment.
Consider redirecting to the releases page instead of returning a plain-text 503. These routes are the download buttons on www.trymaple.ai. When installers.json is missing or invalid — during the initial cutover window, or after a bad publish — visitors get a bare text page. A 302 to the fixed https://github.com/${GITHUB_REPOSITORY}/releases/latest is still safe, because no visitor input reaches the URL. It degrades to the old behavior instead of to a dead end, and also takes the hard ordering requirement off the marketing merge.
Generated by Claude Code
| if: steps.release.outputs.publish == 'true' | ||
| run: | | ||
| set -euo pipefail | ||
| for attempt in $(seq 1 12); do |
There was a problem hiding this comment.
Minor: the propagation window after deploy dropped from 10 minutes (60 × 10s) to 2 minutes (12 × 10s). The deploy has already happened by this point, so a slow custom-domain rollout will now show up as a failed publish that someone has to investigate by hand. Unless there's a reason for the shorter window, consider keeping the old one.
Generated by Claude Code
Research download buttons currently depend on a visitor-side GitHub API lookup and can open the release listing before it resolves. Add permanent
/download/research/stable/{macos,windows,linux-appimage,linux-deb,linux-rpm,android}redirects to the existing updates Worker, backed by a validated catalog of the actual release assets. Successful releases advance both the catalog and original Tauri metadata in one deployment; marketing does not need rebuilding for each release.The publisher requires a successful same-repository Release run matching the stable tag and resolved commit for automatic and manual publication, validates the complete six-installer inventory, checks availability, and rechecks identities before deployment. Redirects accept only deployment-owned canonical asset URLs and are uncached. Cloudflare secrets remain confined to the deployment step on trusted master.
/latest.jsonkeeps its original bytes, schema, headers and failure behavior and does not depend on the installer catalog. A default-only Worker entrypoint also fixes a runtime rejection of the previously exportedGITHUB_REPOSITORYconstant that dry-run bundling did not catch. CI now exercises the actual workerd runtime.Publication is intentionally all-or-nothing: a failed installer preflight leaves the previous bundle, including updater metadata, in place even if the new desktop metadata is valid. The live Tauri endpoint remains independent of catalog failures. Postdeployment verification retains the previous 60-attempt tolerance.
Validation:
nix flake check --no-update-lock-file: all 12 checks passed on aarch64-darwin.Rollout order matters. Merge this PR first, cancel obsolete queued publishers, remove the existing
updates-productionreviewer gate while retaining exact-master restrictions, and dispatch once for the existing successful release. Verify public updater bytes and all download routes before merging the companion marketing PR. Future successful releases then need no extra approval or marketing deployment. Browser-style edge probes currently reach the Worker, but ordinary curl is blocked on new paths; inspect the existing narrow Cloudflare exception during cutover. No live configuration or deployment was changed by this PR.Companion marketing change: maple-marketing #41, held as a draft until the Worker cutover is verified.
Refs MaplePrivacyLabs/maple-marketing#39.