feat: permanent download links for the Longshot Launcher, per channel, at /download #7
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Site:download-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Forgejo's
/releases/latestcovers stable releases only, and there is no stable Longshot Launcher yet, so the READMEs and release pages have no link that always gives players the newest launcher. This adds permanent download links per channel on magicbean.dev, and a download page that picks the file for the visitor's computer.What changed
src/index.jsanswers/download*(everything else is still a file ofpublic/). It reads LongshotLauncher's release list from git.magicbean.dev's API (with a User-Agent, cached 60 s with the Cache API) and picks each channel's newest by the launcher's own rules (Core/ReleaseManifest.cs,release.py newest): never a draft; stable the newestvX.Y.Zthat isn't a pre-release; rc the newestvX.Y.Z-rc.NorvX.Y.Z; nightly the newest by its count./download: a page with a big button for the visitor's system (by User-Agent), the other files, every channel, and "download the launcher, not the builder"./download/launcher/<windows|windows-portable|linux>: 302 to that file of the best channel there is (stable, else rc, else nightly). The READMEs' big buttons use these./download/launcher/<stable|rc|nightly>: 302 to the channel's newest release page./download/launcher/<channel>/<os>: 302 to that file of the channel's newest release. Longshot's release pages use these, on their own channel.wrangler.jsonc:main, theASSETSbinding, andrun_worker_firstfor/downloadand/download/*.test/download.test.mjs(npm test, Node, no network): the channel rules, the same cases astests/test_release.py's.Used by MagicBeanDev/Longshot#148 and MagicBeanDev/LongshotLauncher#15.
Flags and settings
None.
Measurements
What each link answers under
wrangler dev, against the real release list (LongshotLauncher has v1.0.0-rc.1 and nightlies, no stable).main:
96b00863(2026-11-13)this PR: download-links @
e42d2206Hardware: CachyOS (Linux 7.3), Wrangler 4.160.1, Node 26
Scene: none
Method:
npx wrangler dev, thencurl -s -o /dev/null -w '%{http_code} %{redirect_url}'on each link, twiceHow to reproduce:
npm install,npm run dev, the curl above96b00863e42d2206//download/download/launcher/windows,windows-portable,linux/download/launcher/rc/download/launcher/rc/windows,/rc/windows-portable,/rc/linux/download/launcher/nightly,/nightly/<os>/download/launcher/stable,/stable/windows/download/launcher/beta,/nightly/macnpm testTesting
Tested: every link above under
wrangler dev(HEAD too), a redirect followed to the file (200), the pages in a browser (screenshots), the cache (later requests answer in about 10 ms without asking git.magicbean.dev),npm test.Not tested: the deployed Worker on magicbean.dev (Cloudflare's edge cache and the custom domain): only a deploy shows it. The 502 page (git.magicbean.dev unreachable) was not forced. Nothing here is deployed; the preview needs the
previewlabel, since this PR is from a fork.Needs other testers: None
Screenshots
/download(Linux browser; no stable yet, so the rc):/download/launcher/stable/linuxwhile there is no stable:Risk and rollback
Merging deploys it:
.forgejo/workflows/deploy.ymlrunswrangler deployon every push tomain. This is the first Worker code on the site; if it breaks,/and the other files are still served by the static assets (only/download*runs the Worker first). A broken Worker script would fail the deploy, leaving the current site up. Rollback: revert the commit (the next deploy removes the Worker code), ornpx wrangler rollbackto the previous version. Merge this before the Longshot and LongshotLauncher PRs, whose READMEs link these URLs.Reviewer notes
Start with
newestanddownloadinsrc/index.js. The release list is read with no token (public releases only, so never a draft).This repository has no
tests/run_all.py: the checklist's run_all box stands fornpm testand the link sweep above.Issues
None.
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
mainand passing here.HumanBean referenced this pull request from MagicBeanDev/Longshot2026-11-13 07:10:24 +00:00
WIP: feat: permanent download links for the Longshot Launcher, per channel, at /downloadto feat: permanent download links for the Longshot Launcher, per channel, at /downloadHumanBean referenced this pull request from MagicBeanDev/LongshotLauncher2026-11-13 07:10:42 +00:00
Closing: the permanent launcher links live on longshot.magicbean.dev instead (the Longshot website,
/download/launcher/<channel>/<os>).Pull request closed