fix: 严重问题修复 — Docker缺bash/allowBots/安装脚本

- Dockerfile: 添加 bash 到 apk install(Alpine 无 bash 导致容器无法启动)
- Dockerfile: 移除无用的 gui node_modules COPY(被 npm ci 覆盖)
- Dockerfile: --only=production → --omit=dev(旧 flag 已废弃)
- configs/tang-sansheng: allowBots: false → "mentions"(false 导致 bot 间通信全断)
- configs/modern-ceo: allowBots: true → "mentions"(true 可能导致消息循环)
- entrypoint.sh: 修复 set -e + wait 信号处理 + $@ 为空保护
- install-mac.sh: npm install -g openclaw 加 || true(set -e 下失败会跳过 fallback)
- install-lite.sh: $HOME → ${HOME:-}(set -u 下未定义会崩溃)
- install.ps1: 转义 $(curl ...) 防止 PowerShell 在 here-string 中执行

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chairman's chair
2026-03-27 01:42:36 +08:00
parent 4d1fe84570
commit a73f1b326b
7 changed files with 15 additions and 13 deletions

View File

@@ -31,6 +31,7 @@ LABEL maintainer="wanikua" \
# 安装系统依赖(合并为单层减小体积)
RUN apk add --no-cache \
bash \
curl \
git \
ca-certificates \
@@ -79,12 +80,11 @@ RUN chmod +x /entrypoint.sh /init-docker.sh
# 复制 GUI 构建产物
COPY --from=gui-builder /build/dist/ /opt/gui/dist/
COPY --from=gui-builder /build/node_modules/ /opt/gui/server/node_modules/
COPY gui/server/ /opt/gui/server/
COPY gui/package.json /opt/gui/package.json
# 安装 GUI 后端依赖
RUN cd /opt/gui/server && npm ci --only=production --loglevel=error && \
RUN cd /opt/gui/server && npm ci --omit=dev --loglevel=error && \
chown -R court:court /opt/gui
# 复制 Skills只读模板

View File

@@ -237,7 +237,7 @@
"enabled": true,
"dmPolicy": "open",
"groupPolicy": "open",
"allowBots": true,
"allowBots": "mentions",
"accounts": {
"board": {
"name": "Board",
@@ -334,7 +334,7 @@
"enabled": false,
"dmPolicy": "open",
"groupPolicy": "open",
"allowBots": true,
"allowBots": "mentions",
"accounts": {
"ceo": {
"appId": "YOUR_CEO_APP_ID",

View File

@@ -291,7 +291,7 @@
"enabled": true,
"dmPolicy": "open",
"groupPolicy": "open",
"allowBots": false,
"allowBots": "mentions",
"accounts": {
"silijian": {
"name": "司礼监",
@@ -374,7 +374,7 @@
"enabled": false,
"dmPolicy": "open",
"groupPolicy": "open",
"allowBots": false,
"allowBots": "mentions",
"accounts": {
"silijian": {
"appId": "YOUR_FEISHU_APP_ID",

View File

@@ -189,6 +189,8 @@ if command -v openclaw &>/dev/null && [ -f "$CONFIG_DIR/openclaw.json" ]; then
fi
fi
"$@" &
GATEWAY_PID=$!
wait $GATEWAY_PID
if [ $# -gt 0 ]; then
"$@" &
GATEWAY_PID=$!
wait $GATEWAY_PID || true
fi

View File

@@ -87,7 +87,7 @@ echo ""
echo -e "${YELLOW}[1/5] 初始化朝廷工作区...${NC}"
# 确保 HOME 变量有效(修复 Windows Git Bash 和非交互式 shell 环境)
if [ -z "$HOME" ]; then
if [ -z "${HOME:-}" ]; then
HOME=$(getent passwd "$(id -un)" | cut -d: -f6)
[ -z "$HOME" ] && HOME="/root"
export HOME

View File

@@ -97,7 +97,7 @@ if command -v openclaw &>/dev/null; then
echo -e " ${GREEN}✓ OpenClaw $(openclaw --version 2>/dev/null) 已安装${NC}"
else
echo -e " ${CYAN}→ 安装 OpenClaw...${NC}"
npm install -g openclaw 2>/dev/null
npm install -g openclaw 2>/dev/null || true
if command -v openclaw &>/dev/null; then
CLI_CMD="openclaw"
CONFIG_DIR="$HOME/.openclaw"

View File

@@ -278,13 +278,13 @@ Get-Content $env:APPDATA\..\Local\openclaw\logs\gateway.log -Tail 50
** A使 WSL2**
\`\`\`powershell
wsl bash -c "$(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/install-lite.sh)"
wsl bash -c "`$(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/install-lite.sh)"
\`\`\`
** B使 Git Bash**
Git for Windows Git Bash
\`\`\`bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/install-lite.sh)"
bash -c "`$(curl -fsSL https://raw.githubusercontent.com/wanikua/danghuangshang/main/install-lite.sh)"
\`\`\`
> [docs/windows-wsl.md](https://github.com/wanikua/danghuangshang/blob/main/docs/windows-wsl.md)