feat(portable): bug 一键上报 + 自动崩溃上报 + openclaw 升级 2026.6.6

Bug 上报(方便服务器侧排查便携版问题):
- 新增 lib/report-bug.mjs:算设备指纹→sk-uc apiKey,收集 openclaw 版本/
  系统信息/最近日志(gzip+base64),POST 到 api.u-claw.org/recharge/bug/submit。
  静默失败,绝不影响主流程。复用 fingerprint.mjs + xiapan-client.mjs。
- config-server 加 POST /api/report-bug:本地补齐信息后转发,配置中心加
  「🐛 报 Bug」表单(标题/描述/是否附日志)。
- Windows-Start.bat / Mac-Start.command:gateway 端口耗尽或异常退出时
  自动后台上报(Ctrl+C 正常停止不上报)。

openclaw 升级:
- OPENCLAW_VERSION 2026.4.29 → 2026.6.6(X 盘真实 USB 实测 gateway
  启动/ready、Dashboard 200、旧配置兼容、虾盘云 status 均通过)。

便携性改进(借鉴 OpenClaw-Windows-Portable):
- setup.sh / 启动脚本的 npm install 设 npm_config_cache 指向盘内
  app/.npm-cache,避免污染系统缓存,拔盘不留痕。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hfshfg
2026-06-15 10:52:17 +08:00
parent d9dd98d650
commit 6eb54f8ea3
7 changed files with 316 additions and 4 deletions

View File

@@ -78,6 +78,8 @@ if not exist "%CORE_DIR%\node_modules" (
echo File system: NTFS recommended. exFAT/FAT32 will be very slow.
echo.
cd /d "%CORE_DIR%"
REM 把 npm 缓存留在盘内,避免污染系统 %APPDATA%\npm-cache拔盘不留痕
set "npm_config_cache=%APP_DIR%\.npm-cache"
call "%NPM_BIN%" install --registry=https://registry.npmmirror.com --ignore-scripts --no-audit --no-fund --omit=dev
echo.
echo Dependencies installed!
@@ -123,6 +125,8 @@ if %errorlevel%==0 (
set /a PORT+=1
if %PORT% gtr 18799 (
echo No available port 18789-18799
REM 自动上报端口全被占gateway 无法启动detach、静默、失败不影响
start /B "" "%NODE_BIN%" "%UCLAW_DIR%lib\report-bug.mjs" --auto --title "gateway-no-free-port" --desc "Ports 18789-18799 all in use" --root "%UCLAW_DIR%." >nul 2>&1
pause
exit /b 1
)
@@ -157,7 +161,14 @@ echo.
cd /d "%CORE_DIR%"
set "OPENCLAW_MJS=%CORE_DIR%\node_modules\openclaw\openclaw.mjs"
"%NODE_BIN%" "%OPENCLAW_MJS%" gateway run --allow-unconfigured --force --port %PORT%
set "GW_EXIT=%errorlevel%"
echo.
REM 自动上报gateway 异常退出(退出码非 0 且非 Ctrl+C/0xC000013A=-1073741510
REM 用户正常 Ctrl+C 停止不上报避免噪音。detach、静默、失败不影响。
if not "%GW_EXIT%"=="0" if not "%GW_EXIT%"=="-1073741510" (
echo OpenClaw exited unexpectedly (code %GW_EXIT%), reporting...
start /B "" "%NODE_BIN%" "%UCLAW_DIR%lib\report-bug.mjs" --auto --title "gateway-exited-code-%GW_EXIT%" --desc "Gateway exited with code %GW_EXIT% on port %PORT%" --root "%UCLAW_DIR%." >nul 2>&1
)
echo OpenClaw stopped.
pause