@ssdavidai/zoclaw 1.3.0-next.6 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,78 +1,92 @@
1
1
  # zoclaw
2
2
 
3
- Set up [OpenClaw](https://openclaw.ai) on a [Zo](https://zo.computer) instance with Tailscale access in one command.
3
+ Run AI agents on your [Zo](https://zo.computer) machine and control them from anywhere on your private network.
4
4
 
5
- ## Quick start
5
+ zoclaw connects [OpenClaw](https://openclaw.ai) (an open-source AI agent platform) to [Tailscale](https://tailscale.com) (a private mesh VPN) on a Zo machine. After setup, you get:
6
6
 
7
- On a fresh Zo instance:
7
+ - **A terminal UI** to chat with your AI agent over SSH or directly on the machine
8
+ - **A browser Control UI** accessible from any device on your tailnet (laptop, phone, tablet) — no port forwarding, no public exposure
9
+ - **A supervised gateway** that auto-restarts on crash or container reboot
10
+ - **Zo-native secrets management** — API keys and tokens stored in `/root/.zo_secrets`, not scattered across config files
8
11
 
9
- ```bash
10
- npm install -g @ssdavidai/zoclaw && zoclaw init
11
- ```
12
-
13
- Or via git:
12
+ ## Quick start
14
13
 
15
14
  ```bash
16
- git clone https://github.com/ssdavidai/zoclaw.git
17
- cd zoclaw
18
- ./setup.sh
15
+ npm install -g @ssdavidai/zoclaw
16
+ zoclaw init
19
17
  ```
20
18
 
21
- That's it. The setup script walks you through everything:
19
+ The setup walks you through five steps:
22
20
 
23
- 1. Prompts for your Tailscale auth key (or uses the one already in zo secrets)
24
- 2. Installs and configures Tailscale via [zotail](https://github.com/ssdavidai/zotail)
25
- 3. Installs OpenClaw
26
- 4. Runs the OpenClaw onboarding wizard
27
- 5. Patches the config for secure Tailscale access
28
- 6. Prints your Control UI URL and offers to launch the TUI
21
+ 1. **Tailscale auth key** — prompts for one, or reuses the key already in zo secrets
22
+ 2. **Tailscale install** sets up the VPN sidecar via [zotail](https://github.com/ssdavidai/zotail)
23
+ 3. **OpenClaw install** — installs the agent platform
24
+ 4. **Onboarding** interactive wizard to pick your AI provider and model
25
+ 5. **Bootstrap** — configures the gateway for secure tailnet access and registers it as a service
29
26
 
30
- ### After setup
27
+ At the end, you'll see your Control UI URL and can launch the TUI immediately.
31
28
 
32
- On first browser load, the Control UI will request device pairing. Approve it once from the CLI:
29
+ ### First browser connection
30
+
31
+ The first time you open the Control UI from another device on your tailnet, you need to approve the device once:
33
32
 
34
33
  ```bash
35
34
  openclaw devices list
36
35
  openclaw devices approve <request-id>
37
36
  ```
38
37
 
39
- After that, the browser is permanently paired.
38
+ Refresh the browser and you're in. This is a one-time step per device.
40
39
 
41
- ## Why this exists
40
+ ## Development channel
42
41
 
43
- After a fresh `openclaw configure` on Zo, the default gateway config doesn't work with Tailscale. You'll hit a series of issues:
42
+ To test in-development versions:
44
43
 
45
- 1. **"requires HTTPS or localhost"** -- Tailscale Serve terminates TLS externally and proxies to the gateway as plain HTTP on loopback. The gateway sees a localhost socket but a non-local `Host` header (your `.ts.net` hostname), so it treats the connection as remote and rejects it.
44
+ ```bash
45
+ npm install -g @ssdavidai/zoclaw@next
46
+ zoclaw init --next
47
+ ```
46
48
 
47
- 2. **"device identity required"** -- The Control UI in the browser needs to complete device pairing, but the gateway doesn't recognize the browser as a trusted client without proper proxy configuration.
49
+ The `--next` flag pulls `@next` versions of dependencies. Without it, stable `@latest` versions are used.
48
50
 
49
- 3. **CLI pairing scope mismatch** -- The initial onboarding pairs the CLI with read-only scopes (`operator.read`), but the CLI needs full admin scopes (`operator.admin`, `operator.approvals`, `operator.pairing`) to function.
51
+ ## Managing the gateway
50
52
 
51
- 4. **Security audit failures** -- The default config ships with invalid `denyCommands` entries and overly permissive credentials directory permissions.
53
+ The gateway runs as a supervised service it starts automatically and restarts on failure.
52
54
 
53
- ## What the bootstrap patches
55
+ ```bash
56
+ # Check status
57
+ supervisorctl -c /etc/zo/supervisord-user.conf status openclaw-gateway
54
58
 
55
- | Issue | Fix |
56
- |---|---|
57
- | Gateway doesn't trust Tailscale Serve | Sets `gateway.auth.allowTailscale: true` |
58
- | `.ts.net` Host header rejected as remote | Sets `gateway.trustedProxies: ["127.0.0.1/32"]` so the gateway trusts Tailscale Serve's forwarded headers |
59
- | Control UI not enabled | Sets `gateway.controlUi.enabled: true` |
60
- | CLI paired with read-only scopes | Upgrades paired device scopes to full admin |
61
- | Invalid `denyCommands` entries | Removes the ineffective default entries |
62
- | Credentials dir readable by others | `chmod 700 ~/.openclaw/credentials` |
59
+ # Restart
60
+ supervisorctl -c /etc/zo/supervisord-user.conf restart openclaw-gateway
61
+
62
+ # View logs
63
+ tail /dev/shm/openclaw-gateway.log
64
+ ```
63
65
 
64
- The script does **not** set `allowInsecureAuth` or `dangerouslyDisableDeviceAuth` -- those are insecure workarounds. Instead, it configures `trustedProxies` so the gateway properly recognizes Tailscale Serve connections as secure, and the browser goes through proper Ed25519 device pairing.
66
+ ## How it works
65
67
 
66
- ## Scripts
68
+ A fresh `openclaw configure` on Zo doesn't work with Tailscale out of the box. Tailscale Serve terminates TLS on the edge and proxies to your gateway as plain HTTP on loopback. The gateway sees a localhost socket but a remote-looking `Host` header (your `.ts.net` hostname), misclassifies the connection, and rejects it.
67
69
 
68
- | Script | Purpose |
69
- |---|---|
70
- | `zoclaw init` | Full setup from scratch (Tailscale + OpenClaw + bootstrap) |
71
- | `zoclaw bootstrap` | Config patches only (if OpenClaw and Tailscale are already installed) |
70
+ zoclaw fixes this by patching the gateway config to:
72
71
 
73
- ## Security
72
+ - Use OpenClaw's native Tailscale Serve integration (`gateway.tailscale.mode: "serve"`)
73
+ - Trust Tailscale identity headers for browser connections (`gateway.auth.allowTailscale`)
74
+ - Trust localhost as a reverse proxy (`gateway.trustedProxies`) so forwarded headers are honored
75
+ - Enable the browser Control UI
76
+ - Set the agent workspace to `/home/workspace/` (Zo standard)
77
+ - Migrate secrets (gateway token, API keys) to zo secrets
74
78
 
75
- Running `openclaw security audit` after setup should show **0 critical findings**. The setup uses `trustedProxies` + proper device pairing instead of insecure bypasses.
79
+ The bootstrap uses a **two-phase restart** because `trustedProxies` and local device auto-pairing conflict. When `127.0.0.1` is listed as a trusted proxy, the gateway treats direct CLI connections as proxy traffic and can't auto-pair them. So the bootstrap starts the gateway *without* `trustedProxies` first (allowing the local CLI to auto-pair), then adds it and restarts.
80
+
81
+ No insecure flags (`allowInsecureAuth`, `dangerouslyDisableDeviceAuth`) are used. Browser access goes through proper Ed25519 device pairing.
82
+
83
+ ## Commands
84
+
85
+ | Command | What it does |
86
+ |---|---|
87
+ | `zoclaw init` | Full setup from scratch |
88
+ | `zoclaw init --next` | Full setup using development channel |
89
+ | `zoclaw bootstrap` | Re-apply config patches only (if already installed) |
76
90
 
77
91
  ## License
78
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssdavidai/zoclaw",
3
- "version": "1.3.0-next.6",
3
+ "version": "1.3.0",
4
4
  "description": "Set up OpenClaw on Zo with Tailscale access in one command",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -215,13 +215,24 @@ else
215
215
  echo " Logs: tail /dev/shm/openclaw-gateway.log /dev/shm/openclaw-gateway_err.log"
216
216
  fi
217
217
 
218
- # ─── 6. Print access info ─────────────────────────────────────────────
218
+ # ─── 6. Provision HTTPS certificate ───────────────────────────────────
219
219
 
220
220
  TS_HOSTNAME=$(tailscale status --json 2>/dev/null | node -pe "
221
221
  const s = JSON.parse(require('fs').readFileSync('/dev/stdin','utf8'));
222
222
  (s.Self.DNSName || '').replace(/\\.\$/g, '')
223
223
  " 2>/dev/null || true)
224
224
 
225
+ if [ -n "$TS_HOSTNAME" ]; then
226
+ echo ""
227
+ echo "Provisioning HTTPS certificate..."
228
+ if tailscale cert "$TS_HOSTNAME" 2>/dev/null; then
229
+ echo " Certificate ready for ${TS_HOSTNAME}"
230
+ else
231
+ echo " Warning: certificate provisioning failed."
232
+ echo " Ensure HTTPS certificates are enabled at https://login.tailscale.com/admin/dns"
233
+ fi
234
+ fi
235
+
225
236
  echo ""
226
237
  echo "Ready!"
227
238
  echo " TUI: openclaw tui"