Docs / Relay & website

Developer docs

ForkMesh Cloudflare Python Relay

This Python Worker serves the ForkMesh public site from public/ and hosts encrypted ForkMesh mainnode rooms at:

/api/repo/{owner}/{repo}/rooms/{room}/ws

The older /api/room/{room}/ws path remains as a temporary compatibility endpoint.

The static site is deployed with Cloudflare Workers Static Assets. API and health routes run through the Python Worker first, while / is served from public/index.html.

Selected desktop mirrors are published to a Durable Object repository catalog at:

/api/repositories

The public website fetches this endpoint and renders the network repository list. The catalog stores signed metadata only, not local filesystem paths or Git object data.

Clients encrypt room payloads with AES-256-GCM before sending. For default rooms, the Worker derives a shared passphrase from DATA_KEY and releases it to authenticated accounts or signed nodes, so the relay operator can derive the room key and decrypt messages. Frames marked persist: true are kept for at most 7 days, with only the newest 500 retained per room; other frames are broadcast without history storage.

There are no npm, npx, TypeScript, or package-lock dependencies in this worker project.

Local Development

uvx --from workers-py pywrangler dev

Then use this server URL in the Qt client:

ws://127.0.0.1:8787/api/repo/mainnode/forkmesh/rooms/general/ws

The deployed mainnode URL is:

wss://forkmesh.com/api/repo/mainnode/forkmesh/rooms/general/ws

Deploy

The website (static assets in public/) and the relay Worker ship together in one deploy:

./deploy.sh            # deploy to production
./deploy.sh dry-run    # validate without uploading

Deploys use pywrangler. If neither uv nor pywrangler is on PATH, the script installs workers-py into a local .pywrangler/ venv and runs that copy automatically.

Set NODE_NAME and NODE_SOLANA_ADDRESS in wrangler.toml or as dashboard environment variables for the health response.

Mainnode Binding

The Durable Object binding is FORKMESH_MAINNODE_ROOM. Each object is keyed by repository and room:

repo:{owner}/{repo}:room:{room}

The repository catalog binding is FORKMESH_CATALOG; it stores the public catalog records shown on the website.