Skip to content

Commit 4e662e7

Browse files
authored
Merge branch 'main' into dappnodebot/bump-upstream/openclaw/openclaw@v2026.4.14
2 parents 0ce134c + 3b5d8ff commit 4e662e7

4 files changed

Lines changed: 1574 additions & 113 deletions

File tree

dappnode_package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@
77
"shortDescription": "Personal AI assistant gateway with multi-LLM support",
88
"description": "OpenClaw is a powerful, self-hosted AI agent gateway that runs on your own devices. It provides a unified interface for interacting with multiple LLM providers (OpenAI, Anthropic Claude, Google Gemini, local models via Ollama). Features include:\n\n- **Web UI & API**: Full-featured web interface at port 18789\n- **Multi-Channel Messaging**: WhatsApp, Telegram, Slack, Discord, Matrix, and more\n- **Agent Orchestration**: Claude AI integration with tool use and autonomous agents\n- **Code Execution**: Sandboxed environment for running code\n- **Canvas UI**: Visual interactions and image generation\n- **Voice Support**: Text-to-speech and speech-to-text capabilities\n\nRun your own AI infrastructure with full control over your data and API keys.",
99
"type": "service",
10-
"architectures": ["linux/amd64", "linux/arm64"],
10+
"architectures": [
11+
"linux/amd64",
12+
"linux/arm64"
13+
],
1114
"author": "DAppNode Association <admin@dappnode.io>",
1215
"license": "Apache-2.0",
13-
"categories": ["AI", "Developer tools", "Communications"],
16+
"categories": [
17+
"AI",
18+
"Developer tools",
19+
"Communications"
20+
],
1421
"keywords": [
1522
"ai",
1623
"llm",
@@ -89,4 +96,4 @@
8996
"featuredBackground": "linear-gradient(135deg, #667eea 0%, #764ba2 100%)",
9097
"featuredColor": "white"
9198
}
92-
}
99+
}

entrypoint.sh

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ EOF
3232
else
3333
node -e "
3434
const fs = require('fs');
35-
const JSON5 = require('json5');
3635
const configPath = '$CONFIG_FILE';
3736
const envToken = process.env.OPENCLAW_GATEWAY_TOKEN || 'openclaw';
3837
try {
39-
const config = JSON5.parse(fs.readFileSync(configPath, 'utf8'));
38+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
4039
const gw = (config.gateway = config.gateway || {});
4140
const cui = (gw.controlUi = gw.controlUi || {});
4241
const auth = (gw.auth = gw.auth || {});
4342
let changed = false;
43+
44+
// DAppNode gateway settings
4445
if (gw.port !== 18789) { gw.port = 18789; changed = true; }
4546
if (gw.bind !== 'lan') { gw.bind = 'lan'; changed = true; }
4647
if (!('dangerouslyAllowHostHeaderOriginFallback' in cui) && !('allowedOrigins' in cui)) {
@@ -50,6 +51,48 @@ try {
5051
if (!('allowInsecureAuth' in cui)) { cui.allowInsecureAuth = true; changed = true; }
5152
if (!('dangerouslyDisableDeviceAuth' in cui)) { cui.dangerouslyDisableDeviceAuth = true; changed = true; }
5253
if (auth.token !== envToken) { auth.token = envToken; changed = true; }
54+
55+
// Migrate legacy channel keys that openclaw doctor --fix cannot fully resolve in one pass:
56+
// streamMode (string) → streaming (string)
57+
// streaming (boolean) → streaming (string: true→\"partial\", false→\"off\")
58+
// discord.botToken → discord.token (Telegram keeps botToken; Discord uses token)
59+
// discord guild channel: allow (bool) → enabled (bool)
60+
const channels = config.channels || {};
61+
for (const [chName, ch] of Object.entries(channels)) {
62+
if (!ch || typeof ch !== 'object') continue;
63+
// streamMode → streaming string
64+
if ('streamMode' in ch) {
65+
ch.streaming = ch.streamMode;
66+
delete ch.streamMode;
67+
changed = true;
68+
}
69+
// boolean streaming → string
70+
if (typeof ch.streaming === 'boolean') {
71+
ch.streaming = ch.streaming ? 'partial' : 'off';
72+
changed = true;
73+
}
74+
// Discord: botToken is not valid — migrate to token (plain string)
75+
if (chName === 'discord' && 'botToken' in ch) {
76+
if (!ch.token) ch.token = ch.botToken;
77+
delete ch.botToken;
78+
changed = true;
79+
}
80+
// discord guild channel: allow (bool) → enabled (bool)
81+
if (ch.guilds && typeof ch.guilds === 'object') {
82+
for (const guild of Object.values(ch.guilds)) {
83+
if (guild && guild.channels && typeof guild.channels === 'object') {
84+
for (const chan of Object.values(guild.channels)) {
85+
if (chan && 'allow' in chan) {
86+
chan.enabled = chan.allow;
87+
delete chan.allow;
88+
changed = true;
89+
}
90+
}
91+
}
92+
}
93+
}
94+
}
95+
5396
if (changed) {
5497
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
5598
console.log('Updated OpenClaw config for DAppNode HTTP deployment');
@@ -58,6 +101,20 @@ try {
58101
" || true
59102
fi
60103

104+
# ---------------------------------------------------------------------------
105+
# Run doctor --fix for any remaining migrations not handled above
106+
# ---------------------------------------------------------------------------
107+
echo "Running openclaw doctor --fix..."
108+
OPENCLAW_STATE_DIR="$OPENCLAW_DIR" openclaw doctor --fix || true
109+
110+
# ---------------------------------------------------------------------------
111+
# Ensure WhatsApp plugin is installed (from npm, no interactive prompts)
112+
# ---------------------------------------------------------------------------
113+
echo "Ensuring WhatsApp plugin is installed..."
114+
if ! OPENCLAW_STATE_DIR="$OPENCLAW_DIR" openclaw plugins list 2>/dev/null | grep -q "@openclaw/whatsapp"; then
115+
OPENCLAW_STATE_DIR="$OPENCLAW_DIR" openclaw plugins install @openclaw/whatsapp || true
116+
fi
117+
61118
# ---------------------------------------------------------------------------
62119
# Start setup wizard web UI in the background on port 8080
63120
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)