Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/mihaip/infinite-mac/llms.txt

Use this file to discover all available pages before exploring further.

Infinite Mac runs entirely on Cloudflare’s edge infrastructure. The React frontend and server-side rendering logic are packaged as a Cloudflare Worker, while the chunked disk images are stored in Cloudflare R2 and served directly to the browser. Deploying a new version requires two coordinated steps: syncing the disk images to R2, then building and deploying the Worker that references them.

Prerequisites

Before deploying you will need:
  • A Cloudflare account with Workers and R2 enabled
  • wrangler — included as a devDependency in package.json; available after npm install
  • rclone — used by sync-disks to transfer disk image chunks to R2; install it with:
    sudo -v ; curl https://rclone.org/install.sh | sudo bash
    
  • An rclone configuration file at scripts/rclone.conf authorised to read and write the infinite-mac-disk R2 bucket — copy scripts/rclone.conf.example as a starting point
A scripts/rclone.conf.example template is included in the repository. Copy it to scripts/rclone.conf and fill in your Cloudflare account ID and R2 API credentials before running sync-disks.

Deployment Steps

1

Rebuild disk images

Generate fresh disk image chunks and the disk manifest that the Worker will serve. For a full production build, run without any flags:
npm run import-disks
This copies base OS images, imports the full Library/ software collection into the “Infinite HD” disk image, chunks all images, and writes a manifest to src/Data/. For the minimal development subset see the Setup guide.
2

Sync disk images to Cloudflare R2

Upload the chunked disk images from Images/build to the infinite-mac-disk R2 bucket using rclone:
npm run sync-disks
Internally this runs scripts/sync-disks.sh, which calls:
rclone \
  --config=scripts/rclone.conf \
  sync \
  --progress \
  --fast-list \
  --exclude "/media/**" \
  --s3-no-check-bucket \
  --no-update-modtime \
  --size-only \
  --transfers 32 \
  --checkers 32 \
  Images/build \
  cf:infinite-mac-disk
The --size-only flag skips re-uploading files whose byte count has not changed, making incremental syncs fast. The --transfers 32 and --checkers 32 flags parallelise the upload aggressively.
sync-disks must complete successfully before running worker-deploy. The Worker reads disk chunk URLs from the manifest generated by import-disks. If the R2 bucket does not contain the chunks that the new manifest references, the emulator will fail to load disk data at runtime.
3

Build and deploy the Cloudflare Worker

Compile and publish the Worker in one command:
npm run worker-deploy
This runs scripts/worker-deploy.sh, which performs the following in sequence:
  1. TypeScript checktsc --noEmit for the app, then tsc --noEmit --project worker/tsconfig.json for the Worker; the deploy aborts if either fails
  2. Vite buildCLOUDFLARE_ENV=production vite build compiles the frontend and Worker into build/
  3. wrangler deploywrangler deploy uploads the Worker and its static assets to Cloudflare
# Equivalent to what worker-deploy.sh runs:
tsc --noEmit && \
  tsc --noEmit --project worker/tsconfig.json && \
  CLOUDFLARE_ENV=production vite build && \
  wrangler deploy

Worker Configuration

The Worker is configured in wrangler.jsonc at the repository root. Key settings:
  • nameinfinite-mac
  • mainworker/index.ts
  • assets.directory./build (the Vite build output)
  • assets.not_found_handlingsingle-page-application, so deep URLs fall back to index.html
  • durable_objects — an EthernetZone Durable Object class (ETHERNET_ZONE binding) manages per-session emulator-to-emulator networking zones
  • kv_namespaces — a VARZ KV namespace for metrics
  • r2_buckets (production env only) — the DISK_BUCKET binding points to the infinite-mac-disk bucket
  • routes (production env only) — the Worker is routed to all domains: infinitemac.org, system6.app, system7.app, macos8.app, macos9.app, and kanjitalk7.app (including *. subdomains of each)
  • cache.enabledfalse in the default environment, true in the production environment

Local Worker Preview

To test the full Worker stack locally before deploying, use:
npm run build          # Compile the app into build/
npm run worker-dev     # Start wrangler dev on http://localhost:3128
worker-dev runs wrangler dev --port=3128 and serves the Worker with R2 and Durable Object bindings resolved against your Cloudflare account’s preview resources (as defined by preview_id in wrangler.jsonc). This lets you verify Worker-side SSR, routing, and disk-serving logic before pushing to production.

Build docs developers (and LLMs) love