🔄 卡若AI 同步 2026-03-27 12:23 | 更新:金仓、运营中枢工作台 | 排除 >20MB: 12 个

This commit is contained in:
2026-03-27 12:23:36 +08:00
parent 38f16179e3
commit ea3289624a
7 changed files with 112 additions and 5 deletions

View File

@@ -11,13 +11,13 @@ if [ -f "/Users/karuo/Documents/开发/4、小工具/服务器管理/Steam/id_ed
echo ">>> 尝试密钥登录 (port 22022)..." echo ">>> 尝试密钥登录 (port 22022)..."
if ssh -p 22022 -o StrictHostKeyChecking=no -o ConnectTimeout=10 \ if ssh -p 22022 -o StrictHostKeyChecking=no -o ConnectTimeout=10 \
-i "/Users/karuo/Documents/开发/4、小工具/服务器管理/Steam/id_ed25519" \ -i "/Users/karuo/Documents/开发/4、小工具/服务器管理/Steam/id_ed25519" \
root@"$HOST" $CMD 2>/dev/null; then root@"$HOST" "bash -lc $(printf '%q' "$CMD")" 2>/dev/null; then
exit 0 exit 0
fi fi
echo ">>> 尝试密钥登录 (port 22)..." echo ">>> 尝试密钥登录 (port 22)..."
if ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=10 \ if ssh -p 22 -o StrictHostKeyChecking=no -o ConnectTimeout=10 \
-i "/Users/karuo/Documents/开发/4、小工具/服务器管理/Steam/id_ed25519" \ -i "/Users/karuo/Documents/开发/4、小工具/服务器管理/Steam/id_ed25519" \
root@"$HOST" $CMD 2>/dev/null; then root@"$HOST" "bash -lc $(printf '%q' "$CMD")" 2>/dev/null; then
exit 0 exit 0
fi fi
fi fi
@@ -27,12 +27,12 @@ echo ">>> 尝试密码登录 root@$HOST (port 22022)..."
if command -v sshpass >/dev/null 2>&1; then if command -v sshpass >/dev/null 2>&1; then
if sshpass -p 'Zhiqun1984' ssh -p 22022 -o StrictHostKeyChecking=no \ if sshpass -p 'Zhiqun1984' ssh -p 22022 -o StrictHostKeyChecking=no \
-o PubkeyAuthentication=no -o PreferredAuthentications=password \ -o PubkeyAuthentication=no -o PreferredAuthentications=password \
root@"$HOST" $CMD 2>/dev/null; then root@"$HOST" "bash -lc $(printf '%q' "$CMD")" 2>/dev/null; then
exit 0 exit 0
fi fi
echo ">>> 尝试密码登录 (port 22)..." echo ">>> 尝试密码登录 (port 22)..."
if sshpass -p 'Zhiqun1984' ssh -p 22 -o StrictHostKeyChecking=no \ if sshpass -p 'Zhiqun1984' ssh -p 22 -o StrictHostKeyChecking=no \
-o PubkeyAuthentication=no root@"$HOST" $CMD 2>/dev/null; then -o PubkeyAuthentication=no root@"$HOST" "bash -lc $(printf '%q' "$CMD")" 2>/dev/null; then
exit 0 exit 0
fi fi
fi fi

View File

@@ -1,7 +1,15 @@
{ {
"updated": "2026-03-26T16:08:36.831097+00:00", "updated": "2026-03-27T04:18:17.077964+00:00",
"conversations": [ "conversations": [
{ {
"对话ID": "8df1d11b-731f-43bd-aac9-2c3299e23557",
"名称": "Docker 容器默认自动启动",
"项目": "服务器",
"首条消息": "启动 Docker 的时候,是一些网站都要默认全部自动启动",
"创建时间": "2026-03-27T03:38:30.640000+00:00",
"消息数量": 22
},
{
"对话ID": "ff8edeb0-9797-4fd8-a98a-508499421b54", "对话ID": "ff8edeb0-9797-4fd8-a98a-508499421b54",
"名称": "五清单 APP 网址添加与任务规划", "名称": "五清单 APP 网址添加与任务规划",
"项目": "未分类", "项目": "未分类",

View File

@@ -447,3 +447,4 @@
| 2026-03-26 22:37:12 | 🔄 卡若AI 同步 2026-03-26 22:37 | 更新:金仓、水桥平台对接、水溪整理归档、卡木、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 | | 2026-03-26 22:37:12 | 🔄 卡若AI 同步 2026-03-26 22:37 | 更新:金仓、水桥平台对接、水溪整理归档、卡木、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 |
| 2026-03-27 00:01:33 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新Cursor规则、金仓、水桥平台对接、卡木、火炬、总索引与入口、运营中枢、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 | | 2026-03-27 00:01:33 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新Cursor规则、金仓、水桥平台对接、卡木、火炬、总索引与入口、运营中枢、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 |
| 2026-03-27 00:01:59 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新:金仓、火炬、运营中枢工作台 | 排除 >20MB: 12 个 | | 2026-03-27 00:01:59 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新:金仓、火炬、运营中枢工作台 | 排除 >20MB: 12 个 |
| 2026-03-27 00:09:17 | 🔄 卡若AI 同步 2026-03-27 00:09 | 更新:金仓、运营中枢工作台 | 排除 >20MB: 12 个 |

View File

@@ -450,3 +450,4 @@
| 2026-03-26 22:37:12 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-26 22:37 | 更新:金仓、水桥平台对接、水溪整理归档、卡木、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) | | 2026-03-26 22:37:12 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-26 22:37 | 更新:金仓、水桥平台对接、水溪整理归档、卡木、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
| 2026-03-27 00:01:33 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新Cursor规则、金仓、水桥平台对接、卡木、火炬、总索引与入口、运营中枢、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) | | 2026-03-27 00:01:33 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新Cursor规则、金仓、水桥平台对接、卡木、火炬、总索引与入口、运营中枢、运营中枢参考资料、运营中枢工作台 | 排除 >20MB: 12 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
| 2026-03-27 00:01:59 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新:金仓、火炬、运营中枢工作台 | 排除 >20MB: 12 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) | | 2026-03-27 00:01:59 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-27 00:01 | 更新:金仓、火炬、运营中枢工作台 | 排除 >20MB: 12 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |
| 2026-03-27 00:09:17 | 成功 | 成功 | 🔄 卡若AI 同步 2026-03-27 00:09 | 更新:金仓、运营中枢工作台 | 排除 >20MB: 12 个 | [仓库](http://open.quwanzhi.com:3000/fnvtk/karuo-ai) [百科](http://open.quwanzhi.com:3000/fnvtk/karuo-ai/wiki) |

View File

@@ -0,0 +1,53 @@
#!/usr/bin/env bash
# 在「能 SSH 到阿猫」的机器上执行:安装 LaunchAgent使龙虾网关登录自启 + 崩溃自动拉起。
# 默认ssh -p 22203 kr@macbook.quwanzhi.com
set -euo pipefail
AMIAO_SSH="${AMIAO_SSH:-ssh -p 22203 kr@macbook.quwanzhi.com}"
REPO_PLIST="$(cd "$(dirname "$0")" && pwd)/com.openclaw.gateway.longmao.plist"
if [[ ! -f "$REPO_PLIST" ]]; then
echo "缺少 $REPO_PLIST" >&2
exit 1
fi
echo ">>> 推 plist 并加载 LaunchAgent用户 kr…"
$AMIAO_SSH bash -s <<'ENDREMOTE'
set -euo pipefail
PLIST_SRC="$HOME/Library/LaunchAgents/com.openclaw.gateway.longmao.plist"
mkdir -p "$HOME/Library/LaunchAgents"
# 先卸载旧任务(忽略不存在)
launchctl bootout "gui/$(id -u)/com.openclaw.gateway.longmao" 2>/dev/null || true
launchctl unload "$PLIST_SRC" 2>/dev/null || true
# 结束旧的手动网关,避免占端口
pkill -f "/openclaw/dist/index.js gateway" 2>/dev/null || true
# 停用旧 Label「ai.openclaw.gateway」曾用错误 Node 版本,易与龙虾冲突)
UIDN="$(id -u)"
launchctl bootout "gui/$UIDN/ai.openclaw.gateway" 2>/dev/null || launchctl unload "$HOME/Library/LaunchAgents/ai.openclaw.gateway.plist" 2>/dev/null || true
if [[ -f "$HOME/Library/LaunchAgents/ai.openclaw.gateway.plist" ]]; then
mv "$HOME/Library/LaunchAgents/ai.openclaw.gateway.plist" "$HOME/Library/LaunchAgents/ai.openclaw.gateway.plist.off_autodisable"
fi
sleep 2
ENDREMOTE
# 上传 plist本机路径 → 远程)
$AMIAO_SSH "cat > /Users/kr/Library/LaunchAgents/com.openclaw.gateway.longmao.plist" < "$REPO_PLIST"
$AMIAO_SSH bash -s <<'ENDREMOTE'
set -euo pipefail
PLIST="$HOME/Library/LaunchAgents/com.openclaw.gateway.longmao.plist"
chmod 644 "$PLIST"
UID_NUM="$(id -u)"
# macOS 现代用法bootstrap + enable + kickstart
launchctl bootstrap "gui/$UID_NUM" "$PLIST" 2>/dev/null || launchctl load -w "$PLIST"
launchctl enable "gui/$UID_NUM/com.openclaw.gateway.longmao" 2>/dev/null || true
launchctl kickstart -k "gui/$UID_NUM/com.openclaw.gateway.longmao" 2>/dev/null || true
sleep 4
echo "=== launchctl list (grep openclaw) ==="
launchctl list | grep -i openclaw || true
echo "=== 18789 ==="
lsof -iTCP:18789 -sTCP:LISTEN 2>/dev/null || echo "未监听(看 err 日志)"
echo "=== stderr 末 20 行 ==="
tail -20 "$HOME/.openclaw/launchd-gateway-longmao.err.log" 2>/dev/null || true
ENDREMOTE
echo ">>> 完成。阿猫重启或注销后需用户 kr 登录一次LaunchAgent 才会再次加载(用户级规则)。"

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.openclaw.gateway.longmao</string>
<key>Comment</key>
<string>OpenClaw 龙虾网关(飞书龙猫)— 阿猫 Mac须 Node &gt;=22.16,故使用 Homebrew Node勿用 ~/.local/node22</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/opt/node/bin/node</string>
<string>/Users/kr/.local/share/npm-global/lib/node_modules/openclaw/dist/index.js</string>
<string>gateway</string>
<string>--port</string>
<string>18789</string>
</array>
<key>WorkingDirectory</key>
<string>/Users/kr/.openclaw</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ThrottleInterval</key>
<integer>15</integer>
<key>StandardOutPath</key>
<string>/Users/kr/.openclaw/launchd-gateway-longmao.out.log</string>
<key>StandardErrorPath</key>
<string>/Users/kr/.openclaw/launchd-gateway-longmao.err.log</string>
</dict>
</plist>

View File

@@ -184,4 +184,18 @@
--- ---
## 十五、2026-03-27龙虾网关 LaunchAgent登录自启 + 崩溃拉起)
| 项目 | 说明 |
|------|------|
| **目的** | 阿猫 Mac 上 **OpenClaw 网关(龙虾)****用户 kr 登录后自动启动**,进程退出后由 **launchd 自动重启**`KeepAlive`),避免仅依赖手动 `nohup`。 |
| **plist** | `~/Library/LaunchAgents/com.openclaw.gateway.longmao.plist`(仓库真源:`运营中枢/工作台/脚本/com.openclaw.gateway.longmao.plist`)。 |
| **进程** | **`/usr/local/opt/node/bin/node`** + `…/openclaw/dist/index.js gateway --port 18789`**禁止**用 `~/.local/node22` 的 22.14,否则不满足 OpenClaw ≥22.16)。 |
| **日志** | `~/.openclaw/launchd-gateway-longmao.out.log` / `launchd-gateway-longmao.err.log`。 |
| **重装/修复** | 在能 SSH 的机器上执行:`bash 运营中枢/工作台/脚本/amiao_install_openclaw_launchagent.sh`(可用环境变量 `AMIAO_SSH` 覆盖 SSH 命令)。 |
| **旧任务** | 曾存在的 **`ai.openclaw.gateway`** 已 **unload** 且 plist 改名为 `ai.openclaw.gateway.plist.off_20260327`,避免与龙虾 **双实例抢端口** 或用错 Node。 |
| **范围说明** | 本 plist 在 **`~/Library/LaunchAgents`**,属 **用户级****开机后需用户 kr 登录 macOS 一次** 才会加载;未登录桌面会话前不会启动(与系统级 LaunchDaemon 不同)。 |
---
*文档生成卡若AI 工作台。* *文档生成卡若AI 工作台。*