From 89f8fc7c196b77d87d1baf45d2d2a7c668f706bb Mon Sep 17 00:00:00 2001 From: zhaojing1987 Date: Fri, 13 Mar 2026 16:00:35 +0800 Subject: [PATCH] feat: replace moltbot with openclaw app --- apps/moltbot/.env | 53 -------------- apps/moltbot/docker-compose.yml | 50 ------------- apps/moltbot/variables.json | 21 ------ apps/openclaw/.env | 87 +++++++++++++++++++++++ apps/{moltbot => openclaw}/CHANGELOG.md | 0 apps/{moltbot => openclaw}/Notes.md | 0 apps/openclaw/docker-compose.yml | 89 ++++++++++++++++++++++++ apps/{moltbot => openclaw}/src/README.md | 0 apps/openclaw/variables.json | 21 ++++++ 9 files changed, 197 insertions(+), 124 deletions(-) delete mode 100644 apps/moltbot/.env delete mode 100644 apps/moltbot/docker-compose.yml delete mode 100644 apps/moltbot/variables.json create mode 100644 apps/openclaw/.env rename apps/{moltbot => openclaw}/CHANGELOG.md (100%) rename apps/{moltbot => openclaw}/Notes.md (100%) create mode 100644 apps/openclaw/docker-compose.yml rename apps/{moltbot => openclaw}/src/README.md (100%) create mode 100644 apps/openclaw/variables.json diff --git a/apps/moltbot/.env b/apps/moltbot/.env deleted file mode 100644 index 5c7b8ff60..000000000 --- a/apps/moltbot/.env +++ /dev/null @@ -1,53 +0,0 @@ -W9_REPO="wordpress" -W9_DIST=community -W9_VERSION="latest" - -W9_POWER_PASSWORD="1PrMxExC45LsCT" - -# Environments which for user settings when create application -# Named expression: W9_xxx_xxx_SET, xxx refer to file fields -W9_HTTP_PORT_SET=9001 -# W9_HTTPS_PORT_SET=9002 -# W9_DB_PORT_SET=3306 -# W9_SSH_PORT_SET=23 -W9_KEY_SET="dfsjdkjf77xjxcjcj" - -#### -- Not allowed to edit below environments when recreate app based on existing data -- #### - -W9_ID=moltbot - -# W9_HTTP_PORT or W9_HTTPS_PORT is need at leaset and used for proxy for web application -# Some container (e.g teleport) need HTTPS access, then need to set this pra -W9_HTTP_PORT=80 -W9_HTTPS_PORT=81 - -W9_LOGIN_USER=admin -# use https://1password.com/zh-cn/password-generator/ to genarate 14 bit password -# this password can also use password file -W9_LOGIN_PASSWORD=$W9_POWER_PASSWORD -W9_ADMIN_PATH="/wp-login" - -# Container name's suffix must use one of the value -W9_DB_EXPOSE="mysql,postgresql,mariadb,mongodb,redis" - -# It is used when the application APP needs to set an external URL, which can be IP(or domain), IP:PORT -# If have protocols, should be set it in the APP's ENV -W9_URL=internet_ip:$W9_HTTP_PORT_SET -# modifies W9_URL on init when it is true -W9_URL_REPLACE=true - -W9_NETWORK=websoft9 - -#### ----------------------------------------------------------------------------------------- #### - - -# Below environment is created by this app - -WORDPRESS_DB_HOST=$W9_ID-mariadb -WORDPRESS_DB_USER=wordpress #if use postgresql, it need set to postgres -WORDPRESS_DB_PASSWORD=$W9_POWER_PASSWORD -WORDPRESS_DB_NAME=wordpress - - -#W9_NAME="" -#W9_RCODE="" \ No newline at end of file diff --git a/apps/moltbot/docker-compose.yml b/apps/moltbot/docker-compose.yml deleted file mode 100644 index 1c1948688..000000000 --- a/apps/moltbot/docker-compose.yml +++ /dev/null @@ -1,50 +0,0 @@ -# image,docs: https://hub.docker.com/_/wordpress/ - -services: - - wordpress: - image: $W9_REPO:$W9_VERSION - container_name: $W9_ID - restart: unless-stopped - #This is for access host from container - # extra_hosts: ["host.docker.internal:host-gateway"] - # command: | - # /bin/bash -c "ping -c 3 host.docker.internal" - logging: - driver: "json-file" - options: - max-file: "5" - max-size: 10m - deploy: - resources: - limits: - memory: 5g - cpus: '0.7' - ports: - - $W9_HTTP_PORT_SET:80 - env_file: .env - volumes: - - wordpress:/var/www/html - - ./src/php_exra.ini:/usr/local/etc/php/conf.d/php_exra.ini - - mariadb: - image: mariadb:10.4 - container_name: $W9_ID-mariadb - restart: unless-stopped - command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_log_buffer_size=30M - volumes: - - mysql_data:/var/lib/mysql - environment: - MYSQL_DATABASE: $WORDPRESS_DB_NAME - MYSQL_USER: $WORDPRESS_DB_USER - MYSQL_PASSWORD: $W9_POWER_PASSWORD - MYSQL_ROOT_PASSWORD: $W9_POWER_PASSWORD - -volumes: - wordpress: - mysql_data: - -networks: - default: - name: $W9_NETWORK - external: true diff --git a/apps/moltbot/variables.json b/apps/moltbot/variables.json deleted file mode 100644 index 629a52117..000000000 --- a/apps/moltbot/variables.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "moltbot", - "trademark": "Moltbot", - "release": false, - "fork_url": "https://github.com/moltbot/moltbot", - "version_from": "ghcr.io/moltbot/clawdbot:main", - "edition": [ - { - "dist": "community", - "version": [ - "latest" - ] - } - ], - "requirements": { - "cpu": "2", - "memory": "4", - "disk": "10", - "url": "https://clawd.bot" - } -} diff --git a/apps/openclaw/.env b/apps/openclaw/.env new file mode 100644 index 000000000..9e4e5b11c --- /dev/null +++ b/apps/openclaw/.env @@ -0,0 +1,87 @@ +W9_REPO=websoft9dev/openclaw +W9_DIST='community' +W9_VERSION='2026.3.11-wecom' + +# ========================================================= +# Authentication +# W9_POWER_PASSWORD is used as OPENCLAW_GATEWAY_TOKEN +# After startup, paste this token in the Control UI (Settings → Token) +# ========================================================= +W9_POWER_PASSWORD=1PrMxExC45LsCT + +# ========================================================= +# Ports +# W9_HTTP_PORT_SET: host port for Gateway Control UI + WS API (internal: 18789) +# W9_BRIDGE_PORT_SET: host port for browser/bridge control service (internal: 18790) +# Access Control UI: http://localhost:$W9_HTTP_PORT_SET/ +# ========================================================= +W9_HTTP_PORT_SET='9001' +W9_BRIDGE_PORT_SET='18790' + +#### -- Not allowed to edit below environments when recreate app based on existing data -- #### + +# ========================================================= +# System (managed by Websoft9, do not modify) +# ========================================================= +W9_ID='openclaw' +W9_HTTP_PORT=18789 +W9_BRIDGE_PORT=18790 +W9_URL='internet_ip:$W9_HTTP_PORT_SET' +W9_NETWORK=websoft9 + +#### ---------------------------------------------------------------------------- #### + +# ========================================================= +# Application-specific settings +# ========================================================= + +# Gateway token (= W9_POWER_PASSWORD). Paste in Control UI → Settings → Token +OPENCLAW_GATEWAY_TOKEN=$W9_POWER_PASSWORD + +# Gateway bind mode. 'lan' is required for Docker port mapping to work. +OPENCLAW_GATEWAY_BIND=lan + +# Allow insecure private WebSocket connections (leave empty unless needed) +OPENCLAW_ALLOW_INSECURE_PRIVATE_WS= + +# ========================================================= +# AI Providers (国内主流大模型 API 配置) +# 填写任意一个模型的 API Key 即可启用,支持多个同时配置 +# W9_*_SET 变量会在应用商店 UI 中显示,用户可直接填写 +# ========================================================= + +# DeepSeek — 国产高性价比大模型 +# Get key: https://platform.deepseek.com/api_keys +W9_DEEPSEEK_API_KEY_SET= + +# 百度文心一言 (Baidu ERNIE) +# Get key: https://console.bce.baidu.com/qianfan/ais/console/applicationConsole/application +W9_BAIDU_API_KEY_SET= +W9_BAIDU_SECRET_KEY_SET= + +# 阿里通义千问 (Alibaba Qwen) +# Get key: https://dashscope.console.aliyun.com/apiKey +W9_ALIBABA_API_KEY_SET= + +# Moonshot/Kimi — 长文本专家 (200K context) +# Get key: https://platform.moonshot.cn/console/api-keys +W9_MOONSHOT_API_KEY_SET= + +# ───────────────────────────────────────────────────────── +# 企业微信 (WeCom) — @sunnoy/wecom (社区增强插件) +# ───────────────────────────────────────────────────────── +# WebSocket 长连接模式,无需回调 URL 和 Token/AESKey +# 创建位置: 企业微信管理后台 → 应用管理 → 智能机器人 → 创建机器人 → 长连接模式 +# 参考文档: https://open.work.weixin.qq.com/help2/pc/cat?doc_id=21657 +W9_WECOM_BOT_ID_SET= +W9_WECOM_BOT_SECRET_SET= + +# 私聊准入策略: open=所有成员免审批 | pairing=新用户需管理员approve | disabled=禁用私聊 +W9_WECOM_DM_POLICY_SET=open + +# 自建应用 (Agent) — 可选,用于发送文件/图片/主动推送到部门/标签 +# 创建位置: 企业微信管理后台 → 应用管理 → 自建 → 创建应用 +# 注意: 需在「企业可信IP」中添加服务器 IP,无需配置接收消息回调 +W9_WECOM_AGENT_CORP_ID_SET= +W9_WECOM_AGENT_SECRET_SET= +W9_WECOM_AGENT_ID_SET= diff --git a/apps/moltbot/CHANGELOG.md b/apps/openclaw/CHANGELOG.md similarity index 100% rename from apps/moltbot/CHANGELOG.md rename to apps/openclaw/CHANGELOG.md diff --git a/apps/moltbot/Notes.md b/apps/openclaw/Notes.md similarity index 100% rename from apps/moltbot/Notes.md rename to apps/openclaw/Notes.md diff --git a/apps/openclaw/docker-compose.yml b/apps/openclaw/docker-compose.yml new file mode 100644 index 000000000..7869d7c9e --- /dev/null +++ b/apps/openclaw/docker-compose.yml @@ -0,0 +1,89 @@ +# image: https://github.com/openclaw/openclaw/pkgs/container/openclaw +# docs: https://docs.openclaw.ai/install/docker + +services: + openclaw: + image: $W9_REPO:$W9_VERSION + container_name: $W9_ID + restart: unless-stopped + init: true + user: root + entrypoint: [ "/docker-entrypoint.sh" ] + command: [ "node", "dist/index.js", "gateway", "--bind", "${OPENCLAW_GATEWAY_BIND:-lan}", "--port", "18789" ] + ports: + - $W9_HTTP_PORT_SET:18789 + - $W9_BRIDGE_PORT_SET:18790 + env_file: .env + environment: + - HOME=/home/node + - TERM=xterm-256color + - OPENCLAW_GATEWAY_TOKEN=$W9_POWER_PASSWORD + - OPENCLAW_GATEWAY_BIND=${OPENCLAW_GATEWAY_BIND} + - OPENCLAW_GATEWAY_PORT=18789 + - OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=${OPENCLAW_ALLOW_INSECURE_PRIVATE_WS:-} + volumes: + - openclaw_agents:/home/node/.openclaw/agents + - openclaw_workspace:/home/node/.openclaw/workspace + - openclaw_canvas:/home/node/.openclaw/canvas + - openclaw_cron:/home/node/.openclaw/cron + - openclaw_queue:/home/node/.openclaw/delivery-queue + - ./src/init.js:/init.js:ro + healthcheck: + test: + - "CMD" + - "node" + - "-e" + - "fetch('http://127.0.0.1:18789/healthz').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" + interval: 30s + timeout: 10s + retries: 3 + start_period: 30s + + # Optional CLI service for channel setup and management commands. + # Not started by default. Usage: + # docker compose --profile cli run --rm openclaw-cli channels login + # docker compose --profile cli run --rm openclaw-cli config set + # docker compose --profile cli run --rm openclaw-cli devices list + openclaw-cli: + image: $W9_REPO:$W9_VERSION + container_name: ${W9_ID}-cli + network_mode: "service:openclaw" + profiles: + - cli + cap_drop: + - NET_RAW + - NET_ADMIN + security_opt: + - no-new-privileges:true + environment: + - HOME=/home/node + - TERM=xterm-256color + - OPENCLAW_GATEWAY_TOKEN=$W9_POWER_PASSWORD + - OPENCLAW_GATEWAY_BIND=${OPENCLAW_GATEWAY_BIND} + - OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=${OPENCLAW_ALLOW_INSECURE_PRIVATE_WS:-} + - BROWSER=echo + volumes: + - openclaw_agents:/home/node/.openclaw/agents + - openclaw_workspace:/home/node/.openclaw/workspace + - openclaw_canvas:/home/node/.openclaw/canvas + - openclaw_cron:/home/node/.openclaw/cron + - openclaw_queue:/home/node/.openclaw/delivery-queue + stdin_open: true + tty: true + init: true + entrypoint: [ "node", "dist/index.js" ] + depends_on: + - openclaw + +volumes: + openclaw_agents: + openclaw_workspace: + openclaw_canvas: + openclaw_cron: + openclaw_queue: + + +networks: + default: + name: ${W9_NETWORK} + external: true diff --git a/apps/moltbot/src/README.md b/apps/openclaw/src/README.md similarity index 100% rename from apps/moltbot/src/README.md rename to apps/openclaw/src/README.md diff --git a/apps/openclaw/variables.json b/apps/openclaw/variables.json new file mode 100644 index 000000000..15889820b --- /dev/null +++ b/apps/openclaw/variables.json @@ -0,0 +1,21 @@ +{ + "name": "openclaw", + "trademark": "OpenClaw", + "release": true, + "fork_url": "https://github.com/openclaw/openclaw", + "version_from": "https://github.com/openclaw/openclaw/releases", + "edition": [ + { + "dist": "community", + "version": [ + "2026.3.11-wecom" + ] + } + ], + "requirements": { + "cpu": "2", + "memory": "2", + "disk": "10", + "url": "https://openclaw.ai" + } +} \ No newline at end of file