From 02d7e286ea83c376334b7366454fcbdecff88bb8 Mon Sep 17 00:00:00 2001 From: jeffersonwarrior Date: Sat, 3 Jan 2026 23:04:55 -0600 Subject: [PATCH] docs: add remote gateway SSH tunnel setup guide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add SSH config setup for remote gateway access - Document step-by-step setup process - Include auto-start LaunchAgent configuration - Add troubleshooting section 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- docs/remote-gateway-readme.md | 148 ++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 docs/remote-gateway-readme.md diff --git a/docs/remote-gateway-readme.md b/docs/remote-gateway-readme.md new file mode 100644 index 000000000..289bcc09d --- /dev/null +++ b/docs/remote-gateway-readme.md @@ -0,0 +1,148 @@ +# Running Clawdis.app with a Remote Gateway + +Clawdis.app uses SSH tunneling to connect to a remote gateway. This guide shows you how to set it up. + +## Overview + +``` +┌─────────────────────────────────────────────────────────────┐ +│ MacBook │ +│ │ +│ Clawdis.app ──► ws://127.0.0.1:18789 (local port) │ +│ │ │ +│ ▼ │ +│ SSH Tunnel ────────────────────────────────────────────────│ +│ │ │ +└─────────────────────┼──────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────────────┐ +│ Remote Machine │ +│ │ +│ Gateway WebSocket ──► ws://127.0.0.1:18789 ──► │ +│ │ +└─────────────────────────────────────────────────────────────┘ +``` + +## Quick Setup + +### Step 1: Add SSH Config + +Edit `~/.ssh/config` and add: + +```ssh +Host remote-gateway + HostName # e.g., 172.27.187.184 + User # e.g., jefferson + LocalForward 18789 127.0.0.1:18789 + IdentityFile ~/.ssh/id_rsa +``` + +Replace `` and `` with your values. + +### Step 2: Copy SSH Key + +Copy your public key to the remote machine (enter password once): + +```bash +ssh-copy-id -i ~/.ssh/id_rsa @ +``` + +### Step 3: Set Gateway Token + +```bash +launchctl setenv CLAWDIS_GATEWAY_TOKEN "" +``` + +### Step 4: Start SSH Tunnel + +```bash +ssh -N remote-gateway & +``` + +### Step 5: Restart Clawdis.app + +```bash +killall Clawdis +open /path/to/Clawdis.app +``` + +The app will now connect to the remote gateway through the SSH tunnel. + +--- + +## Auto-Start Tunnel on Login + +To have the SSH tunnel start automatically when you log in, create a Launch Agent. + +### Create the PLIST file + +Save this as `~/Library/LaunchAgents/com.clawdis.ssh-tunnel.plist`: + +```xml + + + + + Label + com.clawdis.ssh-tunnel + ProgramArguments + + /usr/bin/ssh + -N + remote-gateway + + KeepAlive + + RunAtLoad + + + +``` + +### Load the Launch Agent + +```bash +launchctl load ~/Library/LaunchAgents/com.clawdis.ssh-tunnel.plist +``` + +The tunnel will now: +- Start automatically when you log in +- Restart if it crashes +- Keep running in the background + +--- + +## Troubleshooting + +**Check if tunnel is running:** + +```bash +ps aux | grep "ssh -N remote-gateway" | grep -v grep +lsof -i :18789 +``` + +**Restart the tunnel:** + +```bash +launchctl restart com.clawdis.ssh-tunnel +``` + +**Stop the tunnel:** + +```bash +launchctl unload ~/Library/LaunchAgents/com.clawdis.ssh-tunnel.plist +``` + +--- + +## How It Works + +| Component | What It Does | +|-----------|--------------| +| `LocalForward 18789 127.0.0.1:18789` | Forwards local port 18789 to remote port 18789 | +| `ssh -N` | SSH without executing remote commands (just port forwarding) | +| `KeepAlive` | Automatically restarts tunnel if it crashes | +| `RunAtLoad` | Starts tunnel when the agent loads | + +Clawdis.app connects to `ws://127.0.0.1:18789` on your MacBook. The SSH tunnel forwards that connection to port 18789 on the remote machine where the Gateway is running.