Deployment
This page is for operators — the person who sets up the shared infrastructure. You do this once. Individual users never touch these steps.
Prerequisites
| Item | Where to get it |
|---|---|
| Two VMs — one for the publish server, one for the messaging router | exe.dev dashboard or your preferred provider |
| Cloudflare account | cloudflare.com — free tier is fine |
| Cloudflare API token with Cloudflare Pages: Edit | Cloudflare dashboard → My Profile → API Tokens |
| Discord bot token | Discord developer portal → Applications → your bot → Bot tab |
| TOTP authenticator app | Google Authenticator, Authy, 1Password, etc. |
Step 1: Clone the repo
On the hub VM:
git clone https://github.com/butaud/claude-harness.git
cd claude-harness
Step 2: Deploy the publish server
The publish server accepts build uploads from harness VMs and deploys them to Cloudflare Pages.
sudo bash publish-server/scripts/setup.sh
The script will ask for:
- Cloudflare Account ID — shown in the top-right corner of any Cloudflare dashboard page
- Cloudflare API Token — with Cloudflare Pages: Edit permission
After the script finishes, open the VM's public URL (e.g. https://publish-vm.exe.dev) in a browser. You'll see a QR code — scan it with your authenticator app. That TOTP secret is how you provision publish tokens for each user VM.
Step 3: Deploy the messaging router
The messaging router holds the Discord bot connection and routes DMs to the right user VM. It shares the /srv/publish-platform/config directory with the publish server so pairings persist across restarts.
sudo bash messaging-router/scripts/setup.sh
The script will ask for your Discord bot token. The bot needs to be added to at least one Discord server that users are in (or users can add it to their own server during onboarding).
Step 4: Note the hub URLs
When provisioning each user VM you'll need:
| Value | Example |
|---|---|
| Publish server URL | https://publish-vm.exe.dev |
| Messaging router URL | https://router-vm.exe.dev |
| Discord bot invite link | From the Discord developer portal → OAuth2 → URL Generator |
Adding a new user VM
Once the hub is up, adding a user is just running session-manager/scripts/setup.sh on the new VM and entering the hub URLs when prompted. See the New VM Setup guide for the full walkthrough.
Architecture note
The only persistent state is:
- Publish server VM:
/srv/publish-platform/config/secrets.json— publish tokens, Cloudflare credentials, TOTP secret - Messaging router VM:
/srv/publish-platform/config/pairings.json— container ↔ Discord user mappings
Both setup scripts check for existing files before writing, so re-running setup.sh on the same VM is safe. The deploy.sh scripts only rebuild Docker images and restart containers — they never touch config files.
The only situation where you'd lose this state is migrating to a different VM. Copy the relevant file to the new machine before running setup there.