Simford.Dong
commited on
Commit
·
eb76166
1
Parent(s):
35e3473
feat: add Feishu channel support and persistent plugin storage
Browse files- Dockerfile +14 -3
Dockerfile
CHANGED
|
@@ -18,12 +18,13 @@ RUN update-ca-certificates && \
|
|
| 18 |
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
|
| 19 |
|
| 20 |
# 4. 全局安装 OpenClaw
|
|
|
|
| 21 |
RUN npm install -g openclaw@latest --unsafe-perm
|
|
|
|
| 22 |
|
| 23 |
# 5. 设置环境变量
|
| 24 |
ENV PORT=7860 \
|
| 25 |
-
OPENCLAW_GATEWAY_MODE=local
|
| 26 |
-
HOME=/root
|
| 27 |
|
| 28 |
# 6. 核心同步引擎 (sync.py)
|
| 29 |
# 针对 OpenClaw 新版 MEMORY.md 机制进行了全路径覆盖
|
|
@@ -61,7 +62,7 @@ def backup():\n\
|
|
| 61 |
print(f"--- [SYNC] 正在执行全量备份: {name} ---")\n\
|
| 62 |
with tarfile.open(name, "w:gz") as tar:\n\
|
| 63 |
# 路径说明:sessions(网关历史), workspace(记忆文件), agents(配置), memory(旧版目录)\n\
|
| 64 |
-
for target in ["sessions", "workspace", "agents", "memory", "openclaw.json"]:\n\
|
| 65 |
full_path = f"/root/.openclaw/{target}"\n\
|
| 66 |
if os.path.exists(full_path):\n\
|
| 67 |
tar.add(full_path, arcname=target)\n\
|
|
@@ -79,6 +80,7 @@ RUN echo "#!/bin/bash\n\
|
|
| 79 |
set -e\n\
|
| 80 |
mkdir -p /root/.openclaw/sessions\n\
|
| 81 |
mkdir -p /root/.openclaw/workspace\n\
|
|
|
|
| 82 |
\n\
|
| 83 |
# 启动前执行数据恢复\n\
|
| 84 |
python3 /usr/local/bin/sync.py restore\n\
|
|
@@ -105,6 +107,15 @@ cat > /root/.openclaw/openclaw.json <<EOF\n\
|
|
| 105 |
\"trustedProxies\": [\"0.0.0.0/0\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\"],\n\
|
| 106 |
\"auth\": { \"mode\": \"token\", \"token\": \"\$OPENCLAW_GATEWAY_PASSWORD\" },\n\
|
| 107 |
\"controlUi\": { \"allowInsecureAuth\": true }\n\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
}\n\
|
| 109 |
}\n\
|
| 110 |
EOF\n\
|
|
|
|
| 18 |
git config --global url."https://github.com/".insteadOf ssh://git@github.com/
|
| 19 |
|
| 20 |
# 4. 全局安装 OpenClaw
|
| 21 |
+
ENV HOME=/root
|
| 22 |
RUN npm install -g openclaw@latest --unsafe-perm
|
| 23 |
+
RUN openclaw plugins install @openclaw/feishu
|
| 24 |
|
| 25 |
# 5. 设置环境变量
|
| 26 |
ENV PORT=7860 \
|
| 27 |
+
OPENCLAW_GATEWAY_MODE=local
|
|
|
|
| 28 |
|
| 29 |
# 6. 核心同步引擎 (sync.py)
|
| 30 |
# 针对 OpenClaw 新版 MEMORY.md 机制进行了全路径覆盖
|
|
|
|
| 62 |
print(f"--- [SYNC] 正在执行全量备份: {name} ---")\n\
|
| 63 |
with tarfile.open(name, "w:gz") as tar:\n\
|
| 64 |
# 路径说明:sessions(网关历史), workspace(记忆文件), agents(配置), memory(旧版目录)\n\
|
| 65 |
+
for target in ["sessions", "workspace", "agents", "memory", "plugins", "openclaw.json"]:\n\
|
| 66 |
full_path = f"/root/.openclaw/{target}"\n\
|
| 67 |
if os.path.exists(full_path):\n\
|
| 68 |
tar.add(full_path, arcname=target)\n\
|
|
|
|
| 80 |
set -e\n\
|
| 81 |
mkdir -p /root/.openclaw/sessions\n\
|
| 82 |
mkdir -p /root/.openclaw/workspace\n\
|
| 83 |
+
mkdir -p /root/.openclaw/plugins\n\
|
| 84 |
\n\
|
| 85 |
# 启动前执行数据恢复\n\
|
| 86 |
python3 /usr/local/bin/sync.py restore\n\
|
|
|
|
| 107 |
\"trustedProxies\": [\"0.0.0.0/0\", \"10.0.0.0/8\", \"172.16.0.0/12\", \"192.168.0.0/16\"],\n\
|
| 108 |
\"auth\": { \"mode\": \"token\", \"token\": \"\$OPENCLAW_GATEWAY_PASSWORD\" },\n\
|
| 109 |
\"controlUi\": { \"allowInsecureAuth\": true }\n\
|
| 110 |
+
},\n\
|
| 111 |
+
\"channels\": {\n\
|
| 112 |
+
\"feishu\": {\n\
|
| 113 |
+
\"enabled\": \${FEISHU_ENABLED:-false},\n\
|
| 114 |
+
\"appId\": \"\$FEISHU_APP_ID\",\n\
|
| 115 |
+
\"appSecret\": \"\$FEISHU_APP_SECRET\",\n\
|
| 116 |
+
\"domain\": \"\${FEISHU_DOMAIN:-feishu}\",\n\
|
| 117 |
+
\"connectionMode\": \"\${FEISHU_CONNECTION_MODE:-websocket}\"\n\
|
| 118 |
+
}\n\
|
| 119 |
}\n\
|
| 120 |
}\n\
|
| 121 |
EOF\n\
|