REHOSTED DOCS

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
      
NODE SETUP GUIDES
RESEARCH
NODE AGENT

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.

The agent does two things:

  1. Sync loop — polls the controller's manifest API, diffs against local files, downloads changes, deletes removed files.
  2. HTTP server — serves the synced files on a configurable port. Nginx on the controller proxies incoming requests here.
  [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:

  {
    "controller_url": "http://192.168.4.48:8080",
    "hardware_id": "wii-001",
    "port": 8080,
    "sync_interval": 60,
    "sites_dir": "sites"
  }