From 0d88c9b0ccc774cf5690112f925a2b0e8095f441 Mon Sep 17 00:00:00 2001 From: hfshfg <38004547@qq.com> Date: Wed, 17 Jun 2026 11:47:19 +0800 Subject: [PATCH] =?UTF-8?q?chore(portable):=20=E5=9B=9E=E5=BD=92=E7=BA=AF?= =?UTF-8?q?=E5=BC=80=E6=BA=90=20=E2=80=94=20=E7=A7=BB=E9=99=A4=E6=8C=87?= =?UTF-8?q?=E7=BA=B9/=E8=87=AA=E5=8A=A8=E5=BC=80=E6=88=B7/=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 去掉不适合开源的商业逻辑,保持一个纯粹的开源 U 盘工具: - 删除设备指纹 (fingerprint.mjs)、虾盘云自动开户 (bootstrap-xiapan.mjs / xiapan-client.mjs)、自动崩溃上报 (report-bug.mjs),portable 和 Electron 两份都删 - 启动脚本去掉绑定指纹调用 + 全部 --auto 自动上报;保留 bonjour 禁用与括号转义 - config-server 删掉 /api/xiapan/* 和 /api/report-bug 端点 - Config.html:虾盘云改为普通「首选」卡片,强调中转站 / 国内外全部大模型, 和其它 provider 一样需用户自填 Key(去 u-claw.org/cloud.html 注册),不再自动开户 - 报 Bug 表单改为指向 GitHub Issue,不再上传日志 - README / release notes / CLAUDE.md 文案改为「选模型填 Key,不绑定设备、不打指纹、不上传数据」 - OPENCLAW_VERSION 跟进最新龙虾版本 2026.6.6 → 2026.6.8 Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/release.yml | 4 +- CLAUDE.md | 61 +++- OPENCLAW_VERSION | 2 +- README.md | 14 +- portable/Config.html | 125 +------- portable/Mac-Start.command | 17 +- portable/OPENCLAW_VERSION | 1 + portable/Windows-Start.bat | 13 +- portable/config-server/public/index.html | 42 +-- portable/config-server/server.js | 96 ------ portable/lib/bootstrap-xiapan.mjs | 188 ------------ portable/lib/fingerprint.mjs | 359 ----------------------- portable/lib/report-bug.mjs | 207 ------------- portable/lib/xiapan-client.mjs | 118 -------- u-claw-app/resources/Config.html | 116 ++------ u-claw-app/scripts/sync-lib.js | 3 - u-claw-app/src/lib/bootstrap-xiapan.mjs | 185 ------------ u-claw-app/src/lib/fingerprint.mjs | 359 ----------------------- u-claw-app/src/lib/xiapan-client.mjs | 91 ------ u-claw-app/src/main.js | 15 - 20 files changed, 108 insertions(+), 1908 deletions(-) create mode 100644 portable/OPENCLAW_VERSION delete mode 100644 portable/lib/bootstrap-xiapan.mjs delete mode 100644 portable/lib/fingerprint.mjs delete mode 100644 portable/lib/report-bug.mjs delete mode 100644 portable/lib/xiapan-client.mjs delete mode 100644 u-claw-app/src/lib/bootstrap-xiapan.mjs delete mode 100644 u-claw-app/src/lib/fingerprint.mjs delete mode 100644 u-claw-app/src/lib/xiapan-client.mjs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cb98e1d..6579b11 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -262,9 +262,9 @@ jobs: body: | ## U-Claw ${{ steps.tag.outputs.tag }} - - 内置虾盘云:首次启动自动绑定本机/U盘指纹,生成 `sk-uc-...` apiKey + - 开箱即配:打开 Config 选模型填 Key 即可,支持虾盘云中转站及 DeepSeek / 通义 / Claude / GPT 等国内外大模型 - OpenClaw runtime: `${{ steps.openclaw_version.outputs.version }}` - - 充值入口:https://u-claw.org/cloud.html + - 虾盘云注册:https://u-claw.org/cloud.html ### 下载 diff --git a/CLAUDE.md b/CLAUDE.md index 2391d92..eb05443 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -26,8 +26,8 @@ Four distribution forms: ```bash # Portable version — build dev copy -cd portable && bash setup.sh # Downloads Node.js v22 + OpenClaw + QQ plugin to app/ -bash Mac-Start.command # Launch (Mac ARM64 only currently) +cd portable && bash setup.sh # Downloads Node.js v22 + OpenClaw + WeChat/QQ plugin to app/ +bash Mac-Start.command # Launch (Mac ARM64). Windows: Windows-Start.bat # Copy to USB drive cp -R portable/ /Volumes/YOUR_USB/U-Claw/ @@ -46,17 +46,41 @@ cd bootable .\4-copy-to-usb.ps1 # Copy ISO + persistence + scripts to USB ``` -Testing should be done in a separate folder or directly on USB. This repo stays clean (no node_modules, no app/ runtime). +### Tests + +```bash +node --test tests/ # Run all tests (node:test, no test framework dep) +node --test tests/windows-launchers.test.mjs # Run one test file +``` + +Tests assert on the **text/behavior of the launcher scripts** (`.bat`/`.command`) — e.g. that +`Windows-Start.bat` escapes `^(...^)` parens inside IF blocks and disables OpenClaw bonjour +discovery. They read repo files as strings; they do **not** spawn OpenClaw. There is no root +`package.json` — tests are not run by the release CI (`.github/workflows/release.yml` only +builds and publishes). Run them locally before pushing launcher changes. + +Testing of the actual runtime should be done in a separate folder or directly on USB. This repo +stays clean (no node_modules, no app/ runtime). ## Architecture ``` portable/ THE USB content (= repo + setup.sh downloads) - Scripts, HTML pages, setup.sh + setup.sh / setup.bat / setup.ps1 — fill in app/ (Node + OpenClaw + plugins) + {Mac,Windows}-Start — launch gateway + config-server, open dashboard/Config + {Mac,Windows}-Menu — interactive CLI launcher (pick start/config/CLI/diagnose) + {Mac,Windows}-Install — copy USB → computer (~/.uclaw/ or %USERPROFILE%) + {Mac,Windows}-Diagnose — health check / collect logs for bug reports + {Mac-OpenClaw-CLI,OpenClaw-CLI.bat} — drop into raw `openclaw` CLI + *.html (Welcome, Config, U-Claw, SkillHub) — local UI pages + config-server/server.js — local HTTP server (port 18788-18798) backing + Config.html: writes openclaw.json, WeChat QR login, update-status API + lib/ — Node helpers (see "lib/ helpers" below) + default-config.json — seed config copied to data/.openclaw/ on first run app/core/ (OpenClaw) + app/runtime/ (Node.js) — downloaded by setup.sh data/.openclaw/openclaw.json — user config (on USB, portable) - Mac-Install.command / Windows-Install.bat — install to computer from USB - skills-cn/ — 10 个中国本地化技能(小红书、微博、B站等) + skills-cn/ — 13 个中国本地化技能(小红书/微博/B站/抖音/知乎/ + 微信公众号/Word/Excel/PPT/天气/搜索/翻译/DeepSeek) u-claw-app/ Electron desktop app (main.js ~400 lines) setup.sh / setup.bat for one-click dev environment @@ -85,10 +109,35 @@ Both portable and desktop versions auto-find a free port in range 18789–18799 - **Node.js discovery**: Portable looks at `app/runtime/node-mac-arm64/bin/node`; Electron looks at `resources/runtime/node-{platform}-{arch}` then falls back to system `node` - **China mirrors**: All downloads use `npmmirror.com` — Node.js binaries from `npmmirror.com/mirrors/node`, npm packages from `registry.npmmirror.com` +- **`OPENCLAW_VERSION` file**: single source of truth for the bundled OpenClaw runtime version (e.g. `2026.6.6`). CI reads it to pin the npm install; it's copied into `portable/` so USB users / `check-update.mjs` can compare installed vs latest. Bump this file to upgrade. - **Environment variables**: `OPENCLAW_HOME`, `OPENCLAW_STATE_DIR`, `OPENCLAW_CONFIG_PATH` control where OpenClaw reads config - **macOS quarantine**: Mac scripts run `xattr -rd com.apple.quarantine` to remove Gatekeeper blocks - **Config format**: `{"gateway":{"mode":"local","auth":{"token":"uclaw"}},"models":{"mode":"merge","providers":{"xxx":{...}}},"agents":{"defaults":{"model":{"primary":"provider/model"}}}}` - **Config hot-reload**: OpenClaw watches `openclaw.json` and applies changes without restart +- **Two local servers on startup**: launchers start the OpenClaw **gateway** (18789–18799) AND + the **config-server** (`config-server/server.js`, 18788–18798). The config-server backs + `Config.html` — it writes `openclaw.json`, drives WeChat QR login, and exposes update-status. + +## lib/ Helpers (portable) + +Pure-Node, zero-dependency `.mjs` modules (use `fetch` + `node:zlib` only). All are designed to +**fail silently** and **run detached** so they never block or break OpenClaw startup. + +| File | Purpose | +|------|---------| +| `check-update.mjs` / `publish-latest.mjs` | Portable self-update: check installed vs latest `OPENCLAW_VERSION`; publish helper. | +| `wait-gateway.bat` | Windows helper: poll until gateway port is LISTENING before opening the dashboard (fixes startup race). | +| `maintain.sh` | Maintenance/diagnostics script. | + +> **纯开源,无追踪**: 这个开源版**不含**设备指纹 (`fingerprint.mjs`)、自动开户 (`bootstrap-xiapan.mjs`/`xiapan-client.mjs`)、崩溃上报 (`report-bug.mjs`) 等商业版逻辑——这些已在 2026-06-17 移除。U-Claw 不绑定设备、不打指纹、不向 `api.u-claw.org` 上传任何数据。 + +### 模型配置 ("选模型填 Key") + +Config.html 列出国内外大模型供用户挑选。首选卡片是 **虾盘云** (Xiapan Cloud 中转站,`api.u-claw.org/v1`) +——一个 Key 调用 DeepSeek / Claude / GPT / 通义 等全部模型,但和其它 provider 一样**需要用户自己去 +`https://u-claw.org/cloud.html` 注册拿 Key**,不再自动开户。其余 provider (DeepSeek/通义/Kimi/智谱/ +豆包/MiniMax/OpenAI/Claude/Groq/硅基流动/自定义) 填各家官方 Key 即可。配置只写本地 +`data/.openclaw/openclaw.json`。 ## What NOT to Commit diff --git a/OPENCLAW_VERSION b/OPENCLAW_VERSION index 1ec3607..62cda86 100644 --- a/OPENCLAW_VERSION +++ b/OPENCLAW_VERSION @@ -1 +1 @@ -2026.6.6 +2026.6.8 diff --git a/README.md b/README.md index 636ffdd..10d218e 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,13 @@ U-Claw(虾盘)是一个**制作教程 + 全套源代码**,教你把 [OpenC > 📖 **[完整教程](https://u-claw.org/tutorial.html)** — 从零开始的手工安装指南、模型配置、聊天平台接入,小白也能看懂。 -### 🔗 内置虾盘云:开箱即用 +### 🧩 模型随便选:国内外大模型都能用 -每个 U-Claw 实例首次启动会**自动**根据当前 U 盘 / 硬盘的指纹生成一个 `sk-...` 形式的虾盘云 apiKey,并写入 `data/.openclaw/openclaw.json`。打开 Config.html 就能看到这张「已绑定虾盘云」横幅(指纹来源、Key、余额)。 +U-Claw 是纯开源工具,**不绑定设备、不打指纹、不上传任何数据**。首次启动会自动打开 Config 页面,选一个模型、填入自己的 API Key 即可一键启动: -- **不送 token**:余额初始为 0,需自行充值([u-claw.org/cloud.html](https://u-claw.org/cloud.html)) -- **指纹规则**: - - 从 U 盘根目录启动 → 绑定该 U 盘的硬件指纹(USB Serial + PNPDeviceID) - - 从硬盘启动(电脑安装版 / Electron App)→ 绑定主板 + 系统盘指纹 - - Mac/Linux 走 Hardware UUID / `/etc/machine-id` + 启动盘 UUID -- **换机 / 换盘**:换 U 盘或换电脑后,新的指纹会生成新的 Key;旧 Key 的余额仍归属原指纹(在 Config.html 点「解绑」可触发重新绑定) -- **隐私**:指纹只用于本地生成 Key,不上传,无登录 +- **虾盘云(首选 · 中转站)**:一个 Key 调用 DeepSeek / Claude / GPT / 通义 等国内外全部大模型,无需翻墙。注册并充值:[u-claw.org/cloud.html](https://u-claw.org/cloud.html) +- **各家官方 Key 也行**:DeepSeek、通义千问、Kimi、智谱 GLM、豆包、MiniMax(国内)/ OpenAI、Claude、Groq(国外)/ 硅基流动、任意 OpenAI 兼容地址(自定义) +- **配置只存在本地** `data/.openclaw/openclaw.json`,拔盘不留痕 ### 一键安装(推荐) diff --git a/portable/Config.html b/portable/Config.html index 71f2eb7..8b0e846 100644 --- a/portable/Config.html +++ b/portable/Config.html @@ -151,26 +151,6 @@ input:focus { border-color: #ff6b35; }

🦞 U-Claw Pro

便携版 — 选择模型,填入 API Key,一键启动

- - -
1选模型
@@ -181,13 +161,14 @@ input:focus { border-color: #ff6b35; }

选择 AI 模型

-

最省心:直接用「虾盘云」一个 Key 用全部模型,插上即用、已含试用额度。也可用下面各家自己的 Key。

+

最省心:用「虾盘云」一个 Key 调用国内外全部大模型(中转站)。也可用下面各家自己的官方 Key。

-
+
-

虾盘云 首选含试用额度

-

插上即用,无需申请 Key。一个账号用 DeepSeek / Claude / GPT / 通义等全部模型

+

虾盘云 首选中转站

+

一个 Key 用 DeepSeek / Claude / GPT / 通义 等国内外全部大模型,无需翻墙

+ → 注册并获取 API Key
@@ -413,55 +394,10 @@ input:focus { border-color: #ff6b35; }