Technical documentation for the rehosted.net platform — how the nodes work, how to set them up, and how to add new hardware to the network.
Rehosted turns retro hardware into web servers. Each machine runs a lightweight node agent that syncs site files from the central controller (a Raspberry Pi 4) and serves them over HTTP. The controller handles DNS, SSL termination, and failover.
[ARCHITECTURE] Internet | Router ──> Pi 4 (controller) ├── Django + Nginx ├── PostgreSQL └── SSL termination | LAN ─────┼────────────────── | | | Wii Node PS3 Node Amiga Node (8080) (8080) (8080) Nodes pull files from controller via /api/node/manifest/ Controller proxies requests to nodes, falls back to local copy
Every node runs node_agent.py — a single-file Python script with zero external dependencies, compatible with Python 2.7+ and 3.2+. This matters because retro platforms often ship ancient Python builds.
node_agent.py
The agent does two things:
[SYNC CYCLE] 1. POST /api/node/manifest/ Authorization: Bearer {hardware_id} Response: { buckets: { "mysite": { files: [{path, md5, size}] } } } 2. Diff local files against manifest - New/changed files --> GET /api/node/file/?bucket=mysite&path=index.html - Removed files --> delete locally - Unchanged files --> skip 3. Sleep (sync_interval seconds), repeat
Configuration lives in config.json alongside the agent:
config.json
{ "controller_url": "http://192.168.4.48:8080", "hardware_id": "wii-001", "port": 8080, "sync_interval": 60, "sites_dir": "sites" }