Somrat Sorkar commited on
Commit
c917d32
·
1 Parent(s): cb6b4ef

Use dmPolicy: open to disable pairing for headless/Docker

Browse files
Files changed (1) hide show
  1. start.sh +5 -2
start.sh CHANGED
@@ -157,6 +157,10 @@ if [ -n "$SPACE_HOST" ]; then
157
  CONFIG_JSON=$(echo "$CONFIG_JSON" | jq ".gateway.controlUi.allowedOrigins = [\"https://${SPACE_HOST}\"]")
158
  fi
159
 
 
 
 
 
160
  # Telegram (supports multiple user IDs, comma-separated)
161
  if [ -n "$TELEGRAM_BOT_TOKEN" ]; then
162
  CONFIG_JSON=$(echo "$CONFIG_JSON" | jq '.plugins.entries.telegram = {"enabled": true}')
@@ -241,8 +245,7 @@ echo "🚀 Launching OpenClaw gateway on port 7860..."
241
  echo ""
242
  # Set model via environment for the gateway
243
  export LLM_MODEL="$LLM_MODEL"
244
- # Disable pairing for Docker/headless environments via CLI flag
245
- openclaw gateway run --port 7860 --bind lan --verbose --no-pairing 2>&1 | tee -a /home/node/.openclaw/gateway.log &
246
  GATEWAY_PID=$!
247
 
248
  # Wait a moment for startup errors
 
157
  CONFIG_JSON=$(echo "$CONFIG_JSON" | jq ".gateway.controlUi.allowedOrigins = [\"https://${SPACE_HOST}\"]")
158
  fi
159
 
160
+ # Disable pairing for headless/Docker — allow open connections
161
+ # Note: This allows any client with the gateway token. Only use in trusted networks.
162
+ CONFIG_JSON=$(echo "$CONFIG_JSON" | jq ".channels.control_ui = {\"dmPolicy\": \"open\", \"allowFrom\": [\"*\"]}")
163
+
164
  # Telegram (supports multiple user IDs, comma-separated)
165
  if [ -n "$TELEGRAM_BOT_TOKEN" ]; then
166
  CONFIG_JSON=$(echo "$CONFIG_JSON" | jq '.plugins.entries.telegram = {"enabled": true}')
 
245
  echo ""
246
  # Set model via environment for the gateway
247
  export LLM_MODEL="$LLM_MODEL"
248
+ openclaw gateway run --port 7860 --bind lan --verbose 2>&1 | tee -a /home/node/.openclaw/gateway.log &
 
249
  GATEWAY_PID=$!
250
 
251
  # Wait a moment for startup errors