Skip to content

feat(download): OS-detected TunaOS Media Writer button on /download - #788

Merged
hanthor merged 1 commit into
mainfrom
docs-download-os-detect
Nov 20, 2026
Merged

hanthor merged 1 commit into
mainfrom
docs-download-os-detect

Conversation

@hanthor

@hanthor hanthor commented Nov 20, 2026

Copy link
Copy Markdown
Member

What

Top of /download now has an OS-detected primary action (src/components/MediaWriterDownload):

Visitor Primary button Secondary
Windows Get TunaOS Media Writer for Windows → mediaWriter.assets["windows-x64"] (.msi) Or build an ISO in your browser → https://iso.tunaos.org/ · Install from Windows without a USB stick (wootc) → /wootc
macOS …for macOS → assets.macos (.dmg) browser builder
Linux …for Linux → assets["linux-x86_64"] or ["linux-aarch64"] (from the UA) browser builder · the other architecture
Android / iOS / iPadOS no app button; explains to open the page on the computer to install on —
ChromeOS / unknown / server render Get TunaOS Media Writer → GitHub latest release browser builder

Version, file type and size come from downloads.json; for unsigned builds a one-line SmartScreen / Gatekeeper note is shown. The existing chooser banner, factory health, ISO list and USB instructions stay below unchanged (the USB note now also mentions Media Writer).

Detection and parsing of downloads.json live in src/data/media-writer.ts (pure, unit-tested in media-writer.test.ts). Only https:// asset URLs for the four known keys are used.

CORS

curl -I -H 'Origin: https://tunaos.org' https://iso.tunaos.org/downloads.json (and GET) currently returns no Access-Control-Allow-Origin, so in production today the fetch fails and every button falls back to https://github.com/tuna-os/iso-builder/releases/latest. The header is being added in tuna-os/iso-builder; once that ships, the direct per-OS asset links appear with no change here.

Tested

  • npx tsc — clean
  • npx vitest run src/data/media-writer.test.ts — 5/5 pass (Windows/macOS/Linux x86_64/aarch64, Android, iPhone, iPadOS desktop-UA, ChromeOS, parser filtering)
  • scripts/checks/*.mjs — pass
  • npm run build — success (only pre-existing broken-link/anchor warnings on other pages)
  • Served the build (docusaurus serve) and loaded /download in headless Chromium with Windows, macOS, Linux and Android user agents:
    • live (no CORS): buttons say "…for Windows/macOS/Linux" and link to the GitHub release; wootc only on Windows; Android shows the use-a-computer message
    • with downloads.json intercepted and served with Access-Control-Allow-Origin: *: buttons link to TunaOS-Media-Writer-Windows-x64.msi, …-macOS.dmg, …-Linux-x86_64.flatpak (+ aarch64 secondary link), with "Version 0.1.0 · .msi installer · 81 MB" etc.

Detect Windows, macOS, Linux (x86_64/aarch64) and mobile from the user
agent and offer the matching Media Writer build from
iso.tunaos.org/downloads.json, with the browser builder as the second
choice and wootc as a Windows-only secondary link. If downloads.json
cannot be fetched, the button points at the latest GitHub release.
@hanthor
hanthor enabled auto-merge (squash) November 20, 2026 03:03
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tunaos-org e19b932 Commit Preview URL

Branch Preview URL
Nov 20 2026, 03:04 AM

@hanthor
hanthor merged commit 4de88c6 into main Nov 20, 2026
13 of 14 checks passed
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