Repository navigation
feat(desktop): downloads from a configured public GitHub releases repo - #116
Conversation
SELFHOST_DESKTOP_RELEASES_REPO (owner/repository, unset by default) turns on GET /api/v1/desktop/releases: the newest non-draft release in the downloads card's manifest shape, for installs without the signed Desktop feed (a local Kind stack publishes its Desktop to a public GitHub releases repo). - Fixed hosts: only https://api.github.com/repos/<owner>/<repo>/releases (the list and each sidecar's API asset URL, one redirect allowed only to *.githubusercontent.com). No token, size caps, 8s deadline, 5-minute cache (failures included), release:null instead of 5xx. - Assets need a matching .sha256 sidecar from the same release (and agree with GitHub's digest when reported); download URLs are kept only on github.com / objects.githubusercontent.com under /<owner>/<repo>/releases/download/. - Unset: 404 and no change for anyone else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 seconds. View limit details
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. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 921a594b8e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…release - The release list is a conditional request (ETag); a 304 does not count against the unauthenticated quota. Verified sidecar digests are kept per asset id + updated_at, so unchanged assets are never re-read. - A sidecar read failure makes the release unavailable (not smaller); any failure serves the last complete answer, else release:null. - owner/repository is compared case-insensitively in download URLs. - An over-declared response body is cancelled before it is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
The dashboard's Desktop downloads card (now on Settings > Workspace) reads only the signed Desktop feed. That feed needs AWS KMS and S3 in production, so a local Kind stack shows "There are no Desktop downloads". The Kind Desktop is published to a public GitHub releases repo and updates from it, so the card can show that instead.
What
SELFHOST_DESKTOP_RELEASES_REPO=<owner>/<repo>(strict^[A-Za-z0-9-]+/[A-Za-z0-9._-]+$, unset by default) turns onGET /api/v1/desktop/releasesfor any signed-in member. It returns{ source: { kind: "github", repo, releasesUrl }, release }, wherereleaseis the newest non-draft release (pre-releases included) in the card's manifest shape. Installer namesDesktop-<profile>-<version>-<OS>-<arch>[-probe|-Setup].<ext>map toplatform,arch,kindand the macOSos_floor; anything else is skipped.Bounds
https://api.github.com/repos/<owner>/<repo>/releases: the release list, and each.sha256sidecar through its API asset URL. That URL's single redirect may only go to*.githubusercontent.com.release: null, never a 5xx.Integrity
sha256:digest for the asset, it must agree with the sidecar.URLs:
urlis kept only if it'shttps://github.comorhttps://objects.githubusercontent.comunder/<owner>/<repo>/releases/download/.Unset: 404, so nothing changes for any other install. Kind sets it in its own overlay.
Tests
test/desktop-releases.test.ts:release: null, with the failure cached for 5 minutes.test/sessions.test.ts: 404 when unset, 401 without a token, 200 for a member withno-store, and exactly one GitHub call.npm testpasses locally (1226). Companion webapp PR: relay-webapp branchfeat/downloads-github-releases.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Adds
GET /api/v1/desktop/releasesso the downloads card can show the latest release from a public GitHub repo when the signed Desktop feed has nothing, such as on a local Kind stack. It's gated by a newSELFHOST_DESKTOP_RELEASES_REPOsetting, unset by default, in which case the route answers 404 and nothing changes.Security and integrity bounds
api.github.com(release list plus each.sha256sidecar's asset URL), with one redirect allowed only to*.githubusercontent.com; no token, size caps, 8-second deadline, and a 5-minute cache that includes failures.github.comandobjects.githubusercontent.comunder/<owner>/<repo>/releases/download/, with the repo compared case-insensitively.release: nullonly when none exists — never a 5xx — and the dashboard labels the source as GitHub releases rather than the signed feed.Written for commit 0ff71c8. Summary will update on new commits.