create-openclaw-bot 5.1.15 → 5.2.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/CHANGELOG.md +181 -161
- package/CHANGELOG.vi.md +275 -255
- package/README.md +12 -11
- package/README.vi.md +12 -11
- package/cli.js +155 -34
- package/package.json +1 -1
- package/setup.js +288 -152
- package/style.css +168 -37
- package/tests/smoke-cli-logic.mjs +41 -11
- package/upgrade.ps1 +90 -0
- package/upgrade.sh +93 -0
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🦞 OpenClaw Setup
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.
|
|
6
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.2.0-0EA5E9?style=for-the-badge" alt="Version 5.2.0" /></a>
|
|
7
7
|
<a href="https://github.com/tuanminhhole/openclaw-setup?tab=MIT-1-ov-file"><img src="https://img.shields.io/badge/LICENSE-MIT-success?style=for-the-badge" alt="MIT License" /></a>
|
|
8
8
|
<a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/v/create-openclaw-bot?style=for-the-badge&label=CLI&color=2563EB&logo=npm&logoColor=white" alt="NPM Version" /></a>
|
|
9
9
|
<a href="https://github.com/tuanminhhole/openclaw-setup/stargazers"><img src="https://img.shields.io/github/stars/tuanminhhole/openclaw-setup?style=for-the-badge&color=eab308&logo=github&logoColor=white" alt="GitHub Stars" /></a>
|
|
@@ -24,18 +24,19 @@ An interactive **CLI tool** and **Setup Wizard** to deploy your own free AI Bot
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
## 🆕 What's new in v5.
|
|
27
|
+
## 🆕 What's new in v5.2.0
|
|
28
28
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
29
|
+
- 🔄 **One-command upgrade** — Run `npx create-openclaw-bot@latest upgrade` in your bot folder to update OpenClaw without re-running the wizard. Auto-detects Docker vs Native mode.
|
|
30
|
+
- 🪟 **Windows upgrade shortcut** — `upgrade.ps1` ships with the repo. Double-click it to upgrade instantly (no terminal knowledge required).
|
|
31
|
+
- 🐧 **Linux / macOS / Ubuntu upgrade** — `upgrade.sh` for Unix users. Run `bash upgrade.sh` locally or pipe via `curl` / `wget` directly from GitHub.
|
|
32
|
+
- 🛡️ **All user data preserved** — `.env`, memory, sessions, credentials, and 9Router OAuth tokens are never touched during upgrade.
|
|
32
33
|
|
|
33
34
|
<details>
|
|
34
|
-
<summary><b>Previous: What's new in v5.
|
|
35
|
+
<summary><b>Previous: What's new in v5.2.0</b></summary>
|
|
35
36
|
|
|
36
|
-
-
|
|
37
|
-
- 🐳 **
|
|
38
|
-
-
|
|
37
|
+
- 🔒 **Pinned OpenClaw version** — The OpenClaw update published on `April 8, 2026` is currently broken, so setup now stays on `openclaw@2026.4.5` for stability.
|
|
38
|
+
- 🐳 **Dockerfile fixes** — Fixed the Windows Docker flow so startup no longer breaks on bad command escaping or invalid generated `allowedOrigins`.
|
|
39
|
+
- 🟢 **Stable Node.js note** — Added guidance to use `Node.js 20` through `24`, and to avoid `Node.js 25` for now due to reported OpenClaw issues.
|
|
39
40
|
|
|
40
41
|
</details>
|
|
41
42
|
|
|
@@ -109,7 +110,7 @@ Run in your terminal → follow the interactive prompts → startup script is ge
|
|
|
109
110
|
2. Open this repo as your workspace
|
|
110
111
|
3. Paste into chat:
|
|
111
112
|
```
|
|
112
|
-
Read SETUP.md and set up OpenClaw v5.
|
|
113
|
+
Read SETUP.md and set up OpenClaw v5.2.0 for me.
|
|
113
114
|
My bot token is X. Use 9Router (no API key).
|
|
114
115
|
My project folder: <YOUR_PATH>
|
|
115
116
|
```
|
package/README.vi.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
3
|
# 🦞 OpenClaw Setup
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.
|
|
6
|
+
<a href="https://github.com/tuanminhhole/openclaw-setup/releases"><img src="https://img.shields.io/badge/RELEASE-v5.2.0-0EA5E9?style=for-the-badge" alt="Version 5.2.0" /></a>
|
|
7
7
|
<a href="https://github.com/tuanminhhole/openclaw-setup?tab=MIT-1-ov-file"><img src="https://img.shields.io/badge/LICENSE-MIT-success?style=for-the-badge" alt="MIT License" /></a>
|
|
8
8
|
<a href="https://www.npmjs.com/package/create-openclaw-bot"><img src="https://img.shields.io/npm/v/create-openclaw-bot?style=for-the-badge&label=CLI&color=2563EB&logo=npm&logoColor=white" alt="NPM Version" /></a>
|
|
9
9
|
<a href="https://github.com/tuanminhhole/openclaw-setup/stargazers"><img src="https://img.shields.io/github/stars/tuanminhhole/openclaw-setup?style=for-the-badge&color=eab308&logo=github&logoColor=white" alt="GitHub Stars" /></a>
|
|
@@ -24,18 +24,19 @@ Công cụ **CLI tương tác** và **Setup Wizard** để tự triển khai Bot
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
-
## 🆕 Có gì mới trong v5.
|
|
27
|
+
## 🆕 Có gì mới trong v5.2.0
|
|
28
28
|
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
29
|
+
- 🔄 **Upgrade 1 lệnh** — Chạy `npx create-openclaw-bot@latest upgrade` trong thư mục bot để cập nhật OpenClaw mà không cần chạy lại wizard. Tự động nhận diện Docker hay Native.
|
|
30
|
+
- 🪟 **Windows: double-click để upgrade** — File `upgrade.ps1` có sẵn trong repo. Nhấp đúp là xong — không cần biết terminal.
|
|
31
|
+
- 🐧 **Linux / macOS / Ubuntu** — `upgrade.sh` cho người dùng Unix. Chạy `bash upgrade.sh` hoặc pipe trực tiếp qua `curl` / `wget` từ GitHub.
|
|
32
|
+
- 🛡️ **Dữ liệu cũ giữ nguyên hoàn toàn** — `.env`, memory, sessions, credentials, OAuth token 9Router không bao giờ bị xoá khi upgrade.
|
|
32
33
|
|
|
33
34
|
<details>
|
|
34
|
-
<summary><b>Trước đó: Có gì mới ở v5.
|
|
35
|
+
<summary><b>Trước đó: Có gì mới ở v5.2.0</b></summary>
|
|
35
36
|
|
|
36
|
-
-
|
|
37
|
-
- 🐳 **
|
|
38
|
-
-
|
|
37
|
+
- 🔒 **Pin lại OpenClaw** — Bản OpenClaw cập nhật ngày `08/04/2026` đang lỗi, nên setup được fix để giữ ở `openclaw@2026.4.5` cho ổn định.
|
|
38
|
+
- 🐳 **Fix Dockerfile** — Sửa luồng Docker cho Windows để không còn lỗi startup do command/escaping sai và tránh lỗi `allowedOrigins` bị sinh ra không hợp lệ.
|
|
39
|
+
- 🟢 **Ghi chú Node.js ổn định** — Thêm note khuyên dùng `Node.js 20` đến `24`, tạm tránh `Node.js 25` vì có report lỗi với OpenClaw.
|
|
39
40
|
|
|
40
41
|
</details>
|
|
41
42
|
|
|
@@ -109,7 +110,7 @@ Chạy lệnh trên trong Terminal → làm theo các prompt tương tác → sc
|
|
|
109
110
|
2. Mở repo này làm workspace
|
|
110
111
|
3. Paste vào chat:
|
|
111
112
|
```
|
|
112
|
-
Read SETUP.md and set up OpenClaw v5.
|
|
113
|
+
Read SETUP.md and set up OpenClaw v5.2.0 for me.
|
|
113
114
|
My bot token is X. Use 9Router (no API key).
|
|
114
115
|
My project folder: <THƯ_MỤC_CỦA_BẠN>
|
|
115
116
|
```
|
package/cli.js
CHANGED
|
@@ -9,6 +9,7 @@ import { spawn, execSync, execFileSync } from 'child_process';
|
|
|
9
9
|
const TELEGRAM_RELAY_PLUGIN_RUNTIME_ID = 'telegram-multibot-relay';
|
|
10
10
|
const TELEGRAM_RELAY_PLUGIN_PACKAGE = 'openclaw-telegram-multibot-relay';
|
|
11
11
|
const OPENCLAW_NPM_SPEC = 'openclaw@2026.4.5';
|
|
12
|
+
const OPENCLAW_RUNTIME_PACKAGES = 'grammy @grammyjs/runner @grammyjs/transformer-throttler @buape/carbon @larksuiteoapi/node-sdk @slack/web-api';
|
|
12
13
|
// Use plain npm package name — clawhub: protocol not supported in all OpenClaw versions
|
|
13
14
|
const TELEGRAM_RELAY_PLUGIN_SPEC = TELEGRAM_RELAY_PLUGIN_PACKAGE;
|
|
14
15
|
|
|
@@ -1026,17 +1027,17 @@ const CHANNELS = {
|
|
|
1026
1027
|
'zalo-personal': { name: 'Zalo Personal (Quét QR)', type: 'zalo-personal', icon: '📱' }
|
|
1027
1028
|
};
|
|
1028
1029
|
|
|
1029
|
-
const PROVIDERS = {
|
|
1030
|
-
'9router': { name: '9Router Proxy (Khuyên dùng)', icon: '🔀', isProxy: true },
|
|
1031
|
-
'openai': { name: 'OpenAI (ChatGPT)', icon: '🧠', envKey: 'OPENAI_API_KEY' },
|
|
1032
|
-
'ollama': { name: 'Local Ollama', icon: '🏠', isLocal: true },
|
|
1033
|
-
'google': { name: 'Google (Gemini)', icon: '⚡', envKey: 'GEMINI_API_KEY' },
|
|
1034
|
-
'anthropic': { name: 'Anthropic (Claude)', icon: '🦄', envKey: 'ANTHROPIC_API_KEY' },
|
|
1035
|
-
'xai': { name: 'xAI (Grok)', icon: '✖️', envKey: 'XAI_API_KEY' },
|
|
1036
|
-
'groq': { name: 'Groq (LPU)', icon: '🏎️', envKey: 'GROQ_API_KEY' }
|
|
1037
|
-
};
|
|
1038
|
-
|
|
1039
|
-
const SKILLS = [
|
|
1030
|
+
const PROVIDERS = {
|
|
1031
|
+
'9router': { name: '9Router Proxy (Khuyên dùng)', icon: '🔀', isProxy: true, supportsEmbeddings: false },
|
|
1032
|
+
'openai': { name: 'OpenAI (ChatGPT)', icon: '🧠', envKey: 'OPENAI_API_KEY', supportsEmbeddings: true },
|
|
1033
|
+
'ollama': { name: 'Local Ollama', icon: '🏠', isLocal: true, supportsEmbeddings: true },
|
|
1034
|
+
'google': { name: 'Google (Gemini)', icon: '⚡', envKey: 'GEMINI_API_KEY', supportsEmbeddings: true },
|
|
1035
|
+
'anthropic': { name: 'Anthropic (Claude)', icon: '🦄', envKey: 'ANTHROPIC_API_KEY', supportsEmbeddings: false },
|
|
1036
|
+
'xai': { name: 'xAI (Grok)', icon: '✖️', envKey: 'XAI_API_KEY', supportsEmbeddings: false },
|
|
1037
|
+
'groq': { name: 'Groq (LPU)', icon: '🏎️', envKey: 'GROQ_API_KEY', supportsEmbeddings: false }
|
|
1038
|
+
};
|
|
1039
|
+
|
|
1040
|
+
const SKILLS = [
|
|
1040
1041
|
// Web Search removed — OpenClaw has native search built-in
|
|
1041
1042
|
{ value: 'browser', name: '🌐 Browser Automation (Playwright) (⭐ Khuyên dùng)', checked: false, slug: null },
|
|
1042
1043
|
{ value: 'memory', name: '🧠 Long-term Memory (⭐ Khuyên dùng)', checked: false, slug: 'memory' },
|
|
@@ -1046,10 +1047,124 @@ const SKILLS = [
|
|
|
1046
1047
|
{ value: 'code-interpreter', name: '💻 Code Interpreter (Python/JS)', checked: false, slug: 'code-interpreter' },
|
|
1047
1048
|
{ value: 'email', name: '📧 Email Assistant', checked: false, slug: 'email-assistant' },
|
|
1048
1049
|
{ value: 'tts', name: '🔊 Text-To-Speech (OpenAI/ElevenLabs)', checked: false, slug: 'tts' },
|
|
1049
|
-
];
|
|
1050
|
+
];
|
|
1051
|
+
|
|
1052
|
+
function providerSupportsMemoryEmbeddings(providerKey) {
|
|
1053
|
+
return !!PROVIDERS[providerKey]?.supportsEmbeddings;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
function getCliSkillChoices({ providerKey, isVi }) {
|
|
1057
|
+
return SKILLS.map((skill) => {
|
|
1058
|
+
if (skill.value !== 'memory') return { ...skill };
|
|
1059
|
+
const recommended = providerSupportsMemoryEmbeddings(providerKey);
|
|
1060
|
+
return {
|
|
1061
|
+
...skill,
|
|
1062
|
+
name: recommended
|
|
1063
|
+
? (isVi ? '🧠 Long-term Memory (⭐ Khuyên dùng)' : '🧠 Long-term Memory (⭐ Recommended)')
|
|
1064
|
+
: '🧠 Long-term Memory'
|
|
1065
|
+
};
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1050
1069
|
|
|
1070
|
+
|
|
1071
|
+
// ─── Upgrade Mode ──────────────────────────────────────────────────────────
|
|
1072
|
+
// Usage: npx create-openclaw-bot@latest upgrade
|
|
1073
|
+
// Auto-detects Docker vs Native, updates OpenClaw, rebuilds/restarts.
|
|
1074
|
+
// Does NOT touch .env, memory, sessions, credentials.
|
|
1075
|
+
async function runUpgrade() {
|
|
1076
|
+
console.log(chalk.red('\n=================================='));
|
|
1077
|
+
console.log(chalk.redBright(LOGO));
|
|
1078
|
+
console.log(chalk.cyan(' 🔄 OpenClaw Upgrade Mode '));
|
|
1079
|
+
console.log(chalk.red('==================================\n'));
|
|
1080
|
+
|
|
1081
|
+
const projectDir = process.cwd();
|
|
1082
|
+
const dockerComposePath = path.join(projectDir, 'docker', 'openclaw', 'docker-compose.yml');
|
|
1083
|
+
const dockerfilePath = path.join(projectDir, 'docker', 'openclaw', 'Dockerfile');
|
|
1084
|
+
const dockerDir = path.join(projectDir, 'docker', 'openclaw');
|
|
1085
|
+
const nativeOpenClawDir = path.join(projectDir, '.openclaw');
|
|
1086
|
+
const dotEnvPath = path.join(projectDir, '.env');
|
|
1087
|
+
|
|
1088
|
+
const isDockerSetup = fs.existsSync(dockerComposePath);
|
|
1089
|
+
const isNativeSetup = fs.existsSync(nativeOpenClawDir) &&
|
|
1090
|
+
(fs.existsSync(dotEnvPath) || fs.existsSync(path.join(nativeOpenClawDir, 'openclaw.json')));
|
|
1091
|
+
|
|
1092
|
+
if (!isDockerSetup && !isNativeSetup) {
|
|
1093
|
+
console.log(chalk.red('\n❌ Khong tim thay project OpenClaw trong thu muc hien tai.'));
|
|
1094
|
+
console.log(chalk.gray(' Da kiem tra: ' + projectDir));
|
|
1095
|
+
console.log(chalk.yellow('\n💡 Di chuyen vao thu muc bot roi chay lai:'));
|
|
1096
|
+
console.log(chalk.white(' npx create-openclaw-bot@latest upgrade'));
|
|
1097
|
+
console.log(chalk.gray('\n Windows: double-click upgrade.ps1'));
|
|
1098
|
+
console.log(chalk.gray(' Linux/Mac: bash upgrade.sh'));
|
|
1099
|
+
process.exit(1);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
const mode = isDockerSetup ? 'docker' : 'native';
|
|
1103
|
+
const modeLabel = mode === 'docker' ? '🐳 Docker' : '⚡ Native / PM2';
|
|
1104
|
+
console.log(chalk.green('\n✅ Phat hien: ' + modeLabel));
|
|
1105
|
+
console.log(chalk.gray(' Project: ' + projectDir));
|
|
1106
|
+
console.log(chalk.cyan('\n📦 Cap nhat len ' + OPENCLAW_NPM_SPEC + '...\n'));
|
|
1107
|
+
|
|
1108
|
+
if (mode === 'docker') {
|
|
1109
|
+
// Patch Dockerfile: update pinned openclaw version + force CACHEBUST
|
|
1110
|
+
if (fs.existsSync(dockerfilePath)) {
|
|
1111
|
+
let fc = fs.readFileSync(dockerfilePath, 'utf8');
|
|
1112
|
+
const patched = fc
|
|
1113
|
+
.replace(/npm install -g openclaw@\S+/g, 'npm install -g ' + OPENCLAW_NPM_SPEC)
|
|
1114
|
+
.replace(/ARG CACHEBUST=\d+/g, 'ARG CACHEBUST=' + Date.now());
|
|
1115
|
+
if (patched !== fc) {
|
|
1116
|
+
fs.writeFileSync(dockerfilePath, patched);
|
|
1117
|
+
console.log(chalk.green(' ✅ Dockerfile updated → ' + OPENCLAW_NPM_SPEC));
|
|
1118
|
+
} else {
|
|
1119
|
+
const refreshed = fc.replace(/ARG CACHEBUST=\d+/g, 'ARG CACHEBUST=' + Date.now());
|
|
1120
|
+
if (refreshed !== fc) fs.writeFileSync(dockerfilePath, refreshed);
|
|
1121
|
+
console.log(chalk.gray(' ℹ️ Dockerfile da o ' + OPENCLAW_NPM_SPEC + ', refresh CACHEBUST'));
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
console.log(chalk.cyan('\n🐳 Dang rebuild container...'));
|
|
1125
|
+
try {
|
|
1126
|
+
execSync('docker compose build --no-cache', { cwd: dockerDir, stdio: 'inherit', shell: true });
|
|
1127
|
+
execSync('docker compose up -d', { cwd: dockerDir, stdio: 'inherit', shell: true });
|
|
1128
|
+
console.log(chalk.green('\n✅ Upgrade hoan tat! Bot dang chay voi phien ban moi.'));
|
|
1129
|
+
} catch {
|
|
1130
|
+
console.log(chalk.red('\n❌ Loi Docker. Chay thu cong:'));
|
|
1131
|
+
console.log(chalk.white(' cd "' + dockerDir + '"'));
|
|
1132
|
+
console.log(chalk.white(' docker compose build --no-cache && docker compose up -d'));
|
|
1133
|
+
process.exit(1);
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
if (mode === 'native') {
|
|
1138
|
+
const osChoice = process.platform === 'win32' ? 'windows' : process.platform === 'darwin' ? 'macos' : 'vps';
|
|
1139
|
+
const installed = installGlobalPackage(OPENCLAW_NPM_SPEC, { isVi: true, osChoice, displayName: 'openclaw' });
|
|
1140
|
+
if (installed) console.log(chalk.green(' ✅ openclaw → ' + OPENCLAW_NPM_SPEC));
|
|
1141
|
+
try {
|
|
1142
|
+
execSync('npm install -g 9router', { stdio: 'ignore', shell: true, env: process.env });
|
|
1143
|
+
console.log(chalk.green(' ✅ 9router → latest'));
|
|
1144
|
+
} catch { console.log(chalk.gray(' ℹ️ 9router update skipped')); }
|
|
1145
|
+
console.log(chalk.cyan('\n♻️ Restarting PM2...'));
|
|
1146
|
+
try {
|
|
1147
|
+
execSync('pm2 restart all', { stdio: 'inherit', shell: true });
|
|
1148
|
+
console.log(chalk.green('\n✅ Upgrade hoan tat! PM2 da duoc restart.'));
|
|
1149
|
+
} catch {
|
|
1150
|
+
console.log(chalk.yellow('\n⚠️ Khong the tu restart PM2. Chay thu cong: pm2 restart all'));
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
const gatewayUrls = getReachableDashboardHosts(18791);
|
|
1155
|
+
console.log(chalk.yellow('\n🧭 Dashboard: ' + (gatewayUrls[0] || 'http://localhost:18791')));
|
|
1156
|
+
if (gatewayUrls.length > 1) console.log(chalk.gray(' Hoac: ' + gatewayUrls.slice(1).join(' , ')));
|
|
1157
|
+
console.log(chalk.gray('\n 💡 Data cu (memory, sessions, 9Router OAuth) duoc giu nguyen.'));
|
|
1158
|
+
console.log(chalk.gray(' 💡 De thay doi config bot, mo lai index.html hoac chay npx create-openclaw-bot\n'));
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
async function main() {
|
|
1162
|
+
// Upgrade subcommand: npx create-openclaw-bot@latest upgrade
|
|
1163
|
+
if (process.argv[2] === 'upgrade' || process.argv.includes('--upgrade')) {
|
|
1164
|
+
await runUpgrade();
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1051
1167
|
|
|
1052
|
-
async function main() {
|
|
1053
1168
|
console.log(chalk.red('\n=================================='));
|
|
1054
1169
|
console.log(chalk.redBright(LOGO));
|
|
1055
1170
|
console.log(chalk.greenBright(' OpenClaw Auto Setup CLI '));
|
|
@@ -1301,10 +1416,10 @@ async function main() {
|
|
|
1301
1416
|
}
|
|
1302
1417
|
|
|
1303
1418
|
// 4. Skills
|
|
1304
|
-
const selectedSkills = await checkbox({
|
|
1305
|
-
message: isVi ? 'Bật tính năng bổ sung (Space để chọn):' : 'Enable extra skills (Space to select):',
|
|
1306
|
-
choices:
|
|
1307
|
-
});
|
|
1419
|
+
const selectedSkills = await checkbox({
|
|
1420
|
+
message: isVi ? 'Bật tính năng bổ sung (Space để chọn):' : 'Enable extra skills (Space to select):',
|
|
1421
|
+
choices: getCliSkillChoices({ providerKey, isVi })
|
|
1422
|
+
});
|
|
1308
1423
|
|
|
1309
1424
|
let tavilyKey = '';
|
|
1310
1425
|
// (web-search removed — native search built-in)
|
|
@@ -1434,7 +1549,7 @@ async function main() {
|
|
|
1434
1549
|
}
|
|
1435
1550
|
|
|
1436
1551
|
|
|
1437
|
-
const patchScript = `const fs=require('fs'),os=require('os'),p='/root/.openclaw/openclaw.json';if(fs.existsSync(p)){const c=JSON.parse(fs.readFileSync(p,'utf8'));const a=new Set(['http://localhost:18791','http://127.0.0.1:18791','http://0.0.0.0:18791']);for(const entries of Object.values(os.networkInterfaces()||{})){for(const entry of entries||[]){if(!entry||entry.internal||entry.family!=='IPv4'||!entry.address)continue;a.add('http://' + entry.address + ':18791');}}c.tools=Object.assign({},c.tools,{profile:'full',exec:{host:'gateway',security:'full',ask:'off'}});c.gateway=Object.assign({},c.gateway,{port:18791,bind:'
|
|
1552
|
+
const patchScript = `const fs=require('fs'),os=require('os'),p='/root/.openclaw/openclaw.json';if(fs.existsSync(p)){const c=JSON.parse(fs.readFileSync(p,'utf8'));const a=new Set(['http://localhost:18791','http://127.0.0.1:18791','http://0.0.0.0:18791']);for(const entries of Object.values(os.networkInterfaces()||{})){for(const entry of entries||[]){if(!entry||entry.internal||entry.family!=='IPv4'||!entry.address)continue;a.add('http://' + entry.address + ':18791');}}c.tools=Object.assign({},c.tools,{profile:'full',exec:{host:'gateway',security:'full',ask:'off'}});c.gateway=Object.assign({},c.gateway,{port:18791,bind:'loopback',controlUi:Object.assign({},c.gateway?.controlUi,{allowedOrigins:Array.from(a).filter(Boolean)})});delete c.gateway.customBindHost;fs.writeFileSync(p,JSON.stringify(c,null,2));}`;
|
|
1438
1553
|
const b64Patch = Buffer.from(patchScript).toString('base64');
|
|
1439
1554
|
|
|
1440
1555
|
// Browser Playwright (both desktop & server modes need chromium)
|
|
@@ -1447,8 +1562,9 @@ async function main() {
|
|
|
1447
1562
|
].join('\n')
|
|
1448
1563
|
: '';
|
|
1449
1564
|
// socat only for Desktop mode (bridge to host Chrome)
|
|
1450
|
-
const socatApt =
|
|
1451
|
-
const socatBridge = hasBrowserDesktop ? 'socat TCP-LISTEN:9222,fork,reuseaddr TCP:host.docker.internal:9222 & ' : '';
|
|
1565
|
+
const socatApt = ' socat';
|
|
1566
|
+
const socatBridge = hasBrowserDesktop ? 'socat TCP-LISTEN:9222,fork,reuseaddr TCP:host.docker.internal:9222 & ' : '';
|
|
1567
|
+
const gatewayBridge = 'socat TCP-LISTEN:18791,fork,reuseaddr TCP:127.0.0.1:18791 & ';
|
|
1452
1568
|
|
|
1453
1569
|
// Skills install at RUNTIME (not build-time — requires openclaw config + ClawHub auth)
|
|
1454
1570
|
const skillSlugs = SKILLS
|
|
@@ -1472,7 +1588,7 @@ async function main() {
|
|
|
1472
1588
|
dockerfileLines.push(
|
|
1473
1589
|
'',
|
|
1474
1590
|
`ARG CACHEBUST=${Date.now()}`,
|
|
1475
|
-
`RUN npm install -g ${OPENCLAW_NPM_SPEC}
|
|
1591
|
+
`RUN npm install -g ${OPENCLAW_NPM_SPEC} ${OPENCLAW_RUNTIME_PACKAGES}`,
|
|
1476
1592
|
'',
|
|
1477
1593
|
'# Fix chat.send dropping resolved agent timeout into reply pipeline.',
|
|
1478
1594
|
'# Without this, Telegram/WebChat paths fall back to an internal 300s default even when',
|
|
@@ -1483,7 +1599,7 @@ async function main() {
|
|
|
1483
1599
|
'',
|
|
1484
1600
|
'EXPOSE 18791',
|
|
1485
1601
|
'',
|
|
1486
|
-
`CMD sh -c "node -e \\"eval(Buffer.from('${b64Patch}','base64').toString())\\" && ${skillInstallCmd}${relayInstallCmd}${socatBridge}(while true; do sleep 5; openclaw devices approve --latest 2>/dev/null || true; done) & openclaw gateway run"`
|
|
1602
|
+
`CMD sh -c "node -e \\"eval(Buffer.from('${b64Patch}','base64').toString())\\" && ${skillInstallCmd}${relayInstallCmd}${socatBridge}${gatewayBridge}(while true; do sleep 5; openclaw devices approve --latest 2>/dev/null || true; done) & openclaw gateway run"`
|
|
1487
1603
|
);
|
|
1488
1604
|
const dockerfile = dockerfileLines.join('\n');
|
|
1489
1605
|
|
|
@@ -1899,19 +2015,21 @@ ${hasBrowserDesktop ? ` extra_hosts:
|
|
|
1899
2015
|
gateway: {
|
|
1900
2016
|
port: 18791,
|
|
1901
2017
|
mode: 'local',
|
|
1902
|
-
bind: '
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
},
|
|
1907
|
-
|
|
1908
|
-
},
|
|
2018
|
+
bind: 'loopback',
|
|
2019
|
+
controlUi: {
|
|
2020
|
+
allowedOrigins: getGatewayAllowedOrigins(18791),
|
|
2021
|
+
},
|
|
2022
|
+
auth: { mode: 'token', token: 'cli-dummy-token-xyz123' },
|
|
2023
|
+
},
|
|
1909
2024
|
};
|
|
1910
2025
|
sharedConfig.plugins = {
|
|
1911
2026
|
entries: {
|
|
1912
2027
|
[TELEGRAM_RELAY_PLUGIN_RUNTIME_ID]: { enabled: true },
|
|
1913
2028
|
},
|
|
1914
2029
|
};
|
|
2030
|
+
if (!selectedSkills.includes('memory')) {
|
|
2031
|
+
sharedConfig.plugins.slots = { ...(sharedConfig.plugins.slots || {}), memory: 'none' };
|
|
2032
|
+
}
|
|
1915
2033
|
|
|
1916
2034
|
if (hasBrowserDesktop) {
|
|
1917
2035
|
sharedConfig.browser = {
|
|
@@ -2143,11 +2261,14 @@ ${hasBrowserDesktop ? ` extra_hosts:
|
|
|
2143
2261
|
channels: {},
|
|
2144
2262
|
tools: { profile: 'full', exec: { host: 'gateway', security: 'full', ask: 'off' } },
|
|
2145
2263
|
gateway: {
|
|
2146
|
-
port: 18791 + (isMultiBot ? bIndex : 0), mode: 'local', bind: '
|
|
2147
|
-
controlUi: { allowedOrigins: getGatewayAllowedOrigins(18791 + (isMultiBot ? bIndex : 0)) },
|
|
2148
|
-
auth: { mode: 'token', token: 'cli-dummy-token-xyz123' }
|
|
2149
|
-
}
|
|
2150
|
-
};
|
|
2264
|
+
port: 18791 + (isMultiBot ? bIndex : 0), mode: 'local', bind: 'loopback',
|
|
2265
|
+
controlUi: { allowedOrigins: getGatewayAllowedOrigins(18791 + (isMultiBot ? bIndex : 0)) },
|
|
2266
|
+
auth: { mode: 'token', token: 'cli-dummy-token-xyz123' }
|
|
2267
|
+
}
|
|
2268
|
+
};
|
|
2269
|
+
if (!selectedSkills.includes('memory')) {
|
|
2270
|
+
botConfig.plugins = { ...(botConfig.plugins || {}), slots: { ...((botConfig.plugins && botConfig.plugins.slots) || {}), memory: 'none' } };
|
|
2271
|
+
}
|
|
2151
2272
|
|
|
2152
2273
|
if (hasBrowserDesktop) {
|
|
2153
2274
|
botConfig.browser = {
|