docs: xLightpanda 温池部署手册 —— 灰度现状/captcha 门突破/遗留 enablejs 门与下一步
This commit is contained in:
@@ -0,0 +1,87 @@
|
|||||||
|
# xLightpanda 温池切换 + Storage Hook 部署手册(v0.47.0 / xlp 0.10.0)
|
||||||
|
|
||||||
|
> 日期:2026-11-03/04。交付:xLightpanda 接管 SERP 浏览器温池 + Storage Hook Phase 1(tmpfs 路由 + 共享 ShaderCache)。
|
||||||
|
> 代码:SerpMax node v0.47.0(zcode/serpmax-node 已推送);xLightpanda upstream 提交 `4f69ccd2`(0.10.0 显式指纹导入)。
|
||||||
|
|
||||||
|
## 1. 交付物
|
||||||
|
|
||||||
|
| 产物 | 位置 | 说明 |
|
||||||
|
|---|---|---|
|
||||||
|
| lightpanda 二进制(ReleaseFast,glibc 2.36 目标) | `/opt/{serpmax,profilemax}/bin/lightpanda` | 222MB;xlp 0.10.0;**必须用 `-Dtarget=x86_64-linux-gnu.2.36` 构建**(节点 Debian 12 glibc 2.36,宿主 2.39 构建会缺 `GLIBC_2.38/__isoc23_strtoull`) |
|
||||||
|
| SerpMax node 源码 v0.47.0 | `/opt/{serpmax,profilemax}/src` + package.json | xlightpanda kind / SERP_BROWSER_KIND / storage.hook / /storage/hook 端点 |
|
||||||
|
|
||||||
|
## 2. 温池引擎切换(每节点)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 1) 二进制与代码
|
||||||
|
rsync -az upstream/zig-out/bin/lightpanda NODE:/opt/serpmax/bin/lightpanda
|
||||||
|
rsync -az --delete node/src/ NODE:/opt/serpmax/src/ # 源码内含 node_modules 除外
|
||||||
|
rsync -az node/package.json NODE:/opt/serpmax/
|
||||||
|
|
||||||
|
# 2) node.env 追加(二进制路径必配;SERP_BROWSER_KIND 分两步灰度)
|
||||||
|
grep -q XLIGHTPANDA_BINARY_PATH /opt/serpmax/node.env || \
|
||||||
|
echo 'XLIGHTPANDA_BINARY_PATH=/opt/serpmax/bin/lightpanda' >> /opt/serpmax/node.env
|
||||||
|
# 灰度第二阶段才加:
|
||||||
|
echo 'SERP_BROWSER_KIND=xlightpanda' >> /opt/serpmax/node.env
|
||||||
|
|
||||||
|
# 3) 重启并验证
|
||||||
|
systemctl restart serpmax-node
|
||||||
|
curl -s localhost:3100/version # 版本号 0.47.0
|
||||||
|
tail -f /opt/serpmax/data/logs/* # 观察 browser.started_xlightpanda / serp.pool_warm
|
||||||
|
```
|
||||||
|
|
||||||
|
- **回滚**:node.env 删掉 `SERP_BROWSER_KIND`(或置空)→ `systemctl restart serpmax-node`,温池立即回到 Profile kind(veil/cloak)。Profile 元数据不动。
|
||||||
|
- 温池入池门槛/搜索逻辑(serp-pool.ts)零改动;媒体拦截 `page.route` 与页内 fetch 在 xLightpanda 上已实测(CDP Fetch domain / Runtime.evaluate)。
|
||||||
|
- xLightpanda 仅无头运行(无渲染引擎);kind=xlightpanda 的 Profile 请求有头(VNC/WebDesk)会显式报错。
|
||||||
|
|
||||||
|
## 3. Storage Hook Phase 1(每节点,默认关闭)
|
||||||
|
|
||||||
|
配置:`DATA_DIR/node-settings.json` 合并(注意保留既有键;HZ-DE-245 已有 httpCacheDir/profileDir):
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"httpCacheDir": "…(保留)",
|
||||||
|
"profileDir": "…(保留)",
|
||||||
|
"storageHook": {
|
||||||
|
"enabled": true,
|
||||||
|
"tmpfsRoot": "/run/serpmax",
|
||||||
|
"perProfileCacheSizeMb": 256,
|
||||||
|
"sharedShaderCache": true,
|
||||||
|
"sharedShaderSizeMb": 256
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- 生效后 veil/cloak 浏览器启动前:Cache/Code Cache/GPUCache/Dawn/Media Cache → 每 Profile 独立 tmpfs(256MB 上限);ShaderCache/GrShaderCache → bind 到 `/run/serpmax/shared/shader` 共享 tmpfs。停机/崩溃/hardReset 自动 lazy umount。
|
||||||
|
- **验证**:`curl -s localhost:3100/storage/hook`(activeProfiles/mounts/recentErrors);浏览器启动后 `mount | grep <profileDir>`;`du` 确认 Cache 目录不再占磁盘;Cookies/IndexedDB 重启保留(路由清单永不含存储类目录)。
|
||||||
|
- **回滚**:node-settings 置 `"enabled": false` → 重启。挂载失败(无 root/CAP_SYS_ADMIN)自动降级直写磁盘并记 `storage.hook_no_root` 告警,不影响业务。
|
||||||
|
- xLightpanda 温池实例无此问题(无渲染无 shader cache;HTTP cache 为单 sqlite 文件),storage.hook 只对 veil/cloak 分支挂载。
|
||||||
|
|
||||||
|
## 4. 已验证结论(2026-11-03/04,本机)
|
||||||
|
|
||||||
|
1. **种子一致性**:6 seed(10000/42/123456/999999/573891/248166)veil-chromium vs xLightpanda 全字段对比,均只剩同 7 处引擎基底差异(canvas/webgl 像素、rects 布局基底、audio DSP),身份字段逐字段一致(xLightpanda docs/SEED_PARITY.md)。
|
||||||
|
2. **温池可行性**:google 首页入池门槛(搜索框)、登录门槛 evaluate、页内 fetch+DOMParser、route 媒体拦截、导航回退全部通过;fetch 拿到 enablejs 空壳时 results=0 → serp-pool 原有回退逻辑按设计工作。
|
||||||
|
3. **Cookie 桥**:注入真实形 Google 会话 cookie(SID/HSID/SSID/SAPISID/NID)导航后全部存活。注意:Google 会对请求中出现的**陌生名字** cookie 主动下发删除 Set-Cookie(fake 名必被清,系 Google 侧行为,真实 Chrome 同样)。
|
||||||
|
4. **Storage Hook**:unshare 用户命名空间实测 18/18 挂载(含带空格目录)、共享 shader 互通、卸载干净、tmpfs 易失语义、disabled 零动作。
|
||||||
|
5. **导入连贯性守卫**:cloak UA(151)误配 derivation=veil(内核 153)时启动即失败 `InconsistentUserAgentVersion`——node 侧转换器已按 `origin==="veil" && uaMajor===153` 门控。
|
||||||
|
|
||||||
|
## 5. 温池灰度现状与遗留问题(2026-11-04)
|
||||||
|
|
||||||
|
**当前舰队状态:三节点温池全部 veil/cloak 兜底(50/50、20/20、40/80),Storage Hook 三节点全启用。** xLightpanda 温池切换保留 `SERP_BROWSER_KIND=xlightpanda` 一键开关,随时可再灰度。
|
||||||
|
|
||||||
|
### 已突破
|
||||||
|
- 引擎接入全链路可用:克隆启动、impersonate MITM 链、cookie 桥、入池门槛、44/50 池满、平均 RSS 75MB(veil 同池 ~450MB)。
|
||||||
|
- Google 的 **captcha/sorry 硬门已突破**(0.10.2-0.10.4 头集修复后,首页与 hop1 均 200,不再打 /sorry 网段封)。
|
||||||
|
|
||||||
|
### 遗留:SERP 请求仍被 enablejs/302 门拦
|
||||||
|
同 Profile 同 IP 同 MITM 的 A/B:veil pagefetch 1.2s 9 结果;xlp 仍 0 结果。已对齐的差异(全部实测):UA-CH 三件套(含引号)、upgrade-insecure-requests、navigation accept 全段、accept-encoding 值序(gzip 先)。MITM 对两类链路统一重写上游 TLS/H2/头序(fp.Dialer/h2fp 架构确认)。
|
||||||
|
**剩余嫌疑(按优先级)**:
|
||||||
|
1. MITM 转发后的**实际头集/头值**尚未直接观测(httpbin 经代理链 TUNNEL 失败;echo 无法穿越代理回本机)→ 下一步:给 impersonate-proxy 加调试 dump(源码在 /home/bigcode/data/dev/impersonate-proxy),对 veil 与 xlp 各抓一次转发后头逐字段对比。
|
||||||
|
2. xlp 页内 fetch 的 `sec-fetch-*` 组合与 veil 差异(cors/empty vs veil 同值?)——dump 后即知。
|
||||||
|
3. hop2(sei 追加跳)的 cookie 头序/值差异。
|
||||||
|
工具已就绪:节点上一键受控复现脚本(见 /tmp/xlp-node-repro*.ts 模式)、A/B 切换(env 一键)、HAR 级重定向链捕获(playwright response 事件)。
|
||||||
|
|
||||||
|
## 6. 后续(不在本轮)
|
||||||
|
|
||||||
|
- StorageFS FUSE/Rust/Pack(02_STORAGE_HOOK.md Phase 2+),另行立项。
|
||||||
|
- xLightpanda localStorage/IndexedDB 落盘(SERP 场景 cookie 足够)。
|
||||||
Reference in New Issue
Block a user