Skip to content

Commit d500238

Browse files
canyugsclaude
andcommitted
Update template: rename devbox, add pairing flow, retry on disconnect
- Rename DevBox → devbox throughout - Service name → openclaw-devbox - Add GATEWAY_HOST as template variable - Add device pairing approval steps to setup instructions - Retry connection on pairing rejection to avoid container restart loop - Set exec ask: off, remove readonly from env vars - Update zh-TW localization Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 25ebca4 commit d500238

2 files changed

Lines changed: 47 additions & 41 deletions

File tree

PLAN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# OpenClaw DevBox Node - Implementation Plan
1+
# OpenClaw devbox Node - Implementation Plan
22

33
## Overview
44

@@ -10,7 +10,7 @@ Create a container based on the **OpenClaw Docker image** that runs as a **remot
1010

1111
```
1212
┌─────────────────────┐ WebSocket ┌──────────────────────────┐
13-
│ OpenClaw Gateway │◄───────────────────────► │ DevBox Node │
13+
│ OpenClaw Gateway │◄───────────────────────► │ devbox Node │
1414
│ (port 18789) │ │ │
1515
│ AI Agent ─────────┤ node.invoke.request │ System (in image): │
1616
│ "run python ..." ─┤ node.invoke.result │ python3, node, go │
@@ -126,7 +126,7 @@ mkdir -p "$HOME/workspace"
126126
exec node /app/dist/index.js node run \
127127
--host "${GATEWAY_HOST:-OpenClaw}" \
128128
--port "${GATEWAY_PORT:-18789}" \
129-
--display-name "${NODE_DISPLAY_NAME:-DevBox}"
129+
--display-name "${NODE_DISPLAY_NAME:-devbox}"
130130
```
131131

132132
### Environment variables:
@@ -136,7 +136,7 @@ exec node /app/dist/index.js node run \
136136
| `HOME` | `/home/node` | readonly |
137137
| `GATEWAY_HOST` | `OpenClaw` | Zeabur internal DNS name of the gateway |
138138
| `GATEWAY_PORT` | `18789` | readonly |
139-
| `NODE_DISPLAY_NAME` | `DevBox` | Display name shown in node list |
139+
| `NODE_DISPLAY_NAME` | `devbox` | Display name shown in node list |
140140

141141
### Resource recommendation:
142142
- CPU: 2 vCPU
@@ -168,7 +168,7 @@ docker push ghcr.io/canyugs/openclaw-devbox:latest
168168
1. **`exec.security: "full"`** — Server-side container, no interactive approval needed
169169
2. **System runtimes in image** — python3, go, rustc, gcc always available regardless of volume state
170170
3. **User packages on volume** — pip, npm, go, cargo installs persist across container restarts
171-
4. **No exposed ports**DevBox initiates outbound WebSocket, no inbound traffic needed
171+
4. **No exposed ports**devbox initiates outbound WebSocket, no inbound traffic needed
172172

173173
## Verification
174174

@@ -179,7 +179,7 @@ docker push ghcr.io/canyugs/openclaw-devbox:latest
179179
node /app/dist/index.js node run --host host.docker.internal --port 18789
180180
```
181181

182-
2. **Check node appears:** `openclaw nodes list` should show "DevBox"
182+
2. **Check node appears:** `openclaw nodes list` should show "devbox"
183183

184184
3. **Test language execution:**
185185
- `python3 -c "print('hello')"`

zeabur-template-openclaw-devbox.yaml

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22
apiVersion: zeabur.com/v1
33
kind: Template
44
metadata:
5-
name: OpenClaw DevBox 🦞
5+
name: OpenClaw devbox 🦞
66
spec:
77
description: |
8-
OpenClaw DevBox is a remote execution node for OpenClaw with programming languages and dev tools pre-installed (Python, Go, Rust, gcc, git, jq). User-installed packages persist across restarts via a persistent volume.
8+
OpenClaw devbox is a remote execution node for OpenClaw with programming languages and dev tools pre-installed (Python, Go, Rust, gcc, git, jq). User-installed packages persist across restarts via a persistent volume.
99
icon: https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/pixel-lobster.svg
1010
coverImage: https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/openclaw-logo-text.png
1111
variables:
1212
- key: GATEWAY_TOKEN
1313
type: STRING
1414
name: Gateway Token
1515
description: The gateway authentication token of your OpenClaw instance
16+
- key: GATEWAY_HOST
17+
type: STRING
18+
name: Gateway Host
19+
description: The Zeabur service name of your OpenClaw instance
1620
tags:
1721
- AI
1822
- DevTools
1923

2024
readme: |
21-
# OpenClaw DevBox 🦞
25+
# OpenClaw devbox 🦞
2226
2327
A remote execution node for OpenClaw with programming languages and dev tools pre-installed.
2428
@@ -39,26 +43,31 @@ spec:
3943
4044
## Setup
4145
1. Deploy this template to the **same Zeabur project** as your OpenClaw instance
42-
2. Enter the **Gateway Token** from your OpenClaw service
43-
3. The DevBox node will automatically connect to OpenClaw via internal DNS
46+
2. Enter the **Gateway Token** and **Gateway Host** (the Zeabur service name of your OpenClaw instance)
47+
3. The devbox node will connect to OpenClaw and send a pairing request
48+
4. Approve the pairing request in your OpenClaw service terminal:
49+
```
50+
openclaw devices list # find the pending request ID
51+
openclaw devices approve <requestId>
52+
```
4453
4554
## Recommended Resources
4655
- **CPU**: 2 vCPU
4756
- **Memory**: 2048 MB
4857
- **Volume**: 10 GB
4958
5059
## Verification
51-
After deployment, check that the DevBox node appears in OpenClaw:
60+
After deployment, check that the devbox node appears in OpenClaw:
5261
- Run `openclaw nodes list` in your OpenClaw service terminal
5362
- Or check the Nodes page in the OpenClaw Web UI
5463
5564
## Architecture
56-
- No exposed ports — the DevBox initiates an outbound WebSocket connection to the OpenClaw gateway
65+
- No exposed ports — the devbox initiates an outbound WebSocket connection to the OpenClaw gateway
5766
- `exec.security` is set to `full` — no interactive approval needed for command execution
5867
- System runtimes are baked into the image; user packages live on the persistent volume
5968
6069
services:
61-
- name: DevBox
70+
- name: openclaw-devbox
6271
icon: https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/pixel-lobster.svg
6372
template: PREBUILT
6473
spec:
@@ -82,20 +91,19 @@ spec:
8291
CONFIG_DIR="$HOME/.openclaw"
8392
CONFIG_FILE="$CONFIG_DIR/openclaw.json"
8493
85-
# Create config with full exec security (no approval needed for server-side container)
86-
if [ ! -f "$CONFIG_FILE" ]; then
87-
mkdir -p "$CONFIG_DIR"
88-
cat > "$CONFIG_FILE" << 'CONF'
94+
# Create config: full exec without approval (tool availability is gateway-side)
95+
mkdir -p "$CONFIG_DIR"
96+
cat > "$CONFIG_FILE" << 'CONF'
8997
{
9098
"tools": {
9199
"exec": {
92-
"security": "full"
100+
"security": "full",
101+
"ask": "off"
93102
}
94103
}
95104
}
96105
CONF
97-
chmod 600 "$CONFIG_FILE"
98-
fi
106+
chmod 600 "$CONFIG_FILE"
99107
100108
# Ensure user-level directories exist on persistent volume
101109
mkdir -p "$HOME/.local/bin"
@@ -104,57 +112,55 @@ spec:
104112
mkdir -p "$HOME/.cargo/bin"
105113
mkdir -p "$HOME/workspace"
106114
107-
# Start node host — connects to OpenClaw gateway via internal DNS
108-
exec node /app/dist/index.js node run \
109-
--host "${GATEWAY_HOST:-OpenClaw}" \
110-
--port "${GATEWAY_PORT:-18789}" \
111-
--display-name "${NODE_DISPLAY_NAME:-DevBox}"
115+
# Start node host — retry on pairing rejection to avoid container restart loop
116+
RETRY_DELAY=10
117+
while true; do
118+
echo "Connecting to gateway ${GATEWAY_HOST:-OpenClaw}:${GATEWAY_PORT:-18789}..."
119+
node /app/dist/index.js node run \
120+
--host "${GATEWAY_HOST:-OpenClaw}" \
121+
--port "${GATEWAY_PORT:-18789}" \
122+
--display-name "${NODE_DISPLAY_NAME:-devbox}" && break
123+
echo "Connection lost. Retrying in ${RETRY_DELAY}s..."
124+
sleep "$RETRY_DELAY"
125+
done
112126
env:
113127
OPENCLAW_GATEWAY_TOKEN:
114128
default: ${GATEWAY_TOKEN}
115129
HOME:
116130
default: /home/node
117-
readonly: true
118131
GATEWAY_HOST:
119-
default: OpenClaw
132+
default: ${GATEWAY_HOST}
120133
GATEWAY_PORT:
121134
default: "18789"
122-
readonly: true
123135
NODE_DISPLAY_NAME:
124-
default: DevBox
136+
default: devbox
125137
NODE_ENV:
126138
default: production
127-
readonly: true
128139
NODE_OPTIONS:
129140
default: --max-old-space-size=1024
130-
readonly: true
131141
PIP_USER:
132142
default: "1"
133-
readonly: true
134143
PYTHONUSERBASE:
135144
default: /home/node/.local
136-
readonly: true
137145
NPM_CONFIG_PREFIX:
138146
default: /home/node/.npm-global
139-
readonly: true
140147
GOPATH:
141148
default: /home/node/go
142-
readonly: true
143149
RUSTUP_HOME:
144150
default: /home/node/.rustup
145-
readonly: true
146151
CARGO_HOME:
147152
default: /home/node/.cargo
148-
readonly: true
149153
PATH:
150154
default: /home/node/.local/bin:/home/node/.npm-global/bin:/home/node/go/bin:/home/node/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
151-
readonly: true
152155

153156
localization:
154157
zh-TW:
155-
name: OpenClaw DevBox 🦞
156-
description: OpenClaw DevBox 是 OpenClaw 的遠端執行節點,預裝多種程式語言與開發工具(Python、Go、Rust、gcc、git、jq)。使用者安裝的套件透過持久化磁碟保留。
158+
name: OpenClaw devbox 🦞
159+
description: OpenClaw devbox 是 OpenClaw 的遠端執行節點,預裝多種程式語言與開發工具(Python、Go、Rust、gcc、git、jq)。使用者安裝的套件透過持久化磁碟保留。
157160
variables:
158161
- key: GATEWAY_TOKEN
159162
name: Gateway Token
160163
description: 您的 OpenClaw 實例的 Gateway 認證令牌
164+
- key: GATEWAY_HOST
165+
name: Gateway Host
166+
description: 您的 OpenClaw 實例的 Zeabur 服務名稱

0 commit comments

Comments
 (0)