Skip to content

V4 dashboard - #600

Closed
rgmyyw wants to merge 28 commits into
TheNetsky:v4from
rgmyyw:v4-dashboard
Closed

rgmyyw wants to merge 28 commits into
TheNetsky:v4from
rgmyyw:v4-dashboard

Conversation

@rgmyyw

@rgmyyw rgmyyw commented Sep 3, 2026

Copy link
Copy Markdown

No description provided.

chiihero and others added 28 commits August 17, 2026 11:35
- QueryEngine 新增 'china' 引擎:随机取源聚合百度/头条/抖音/微博/知乎热搜,
  免费档单源请求降低限流触发面,有 appkey 取 2 源;限流识别(403/429/
  code/msg)与指数退避;首选源失败自动 fallback
- queryManager 兜底模式:主源原始词达 20 即停,不足时后续源随机抽样 50 补充
- 适配 v4 HttpClient(Impit 原生解压,无需 accept-encoding 覆盖;错误形状
  按 error.status/response 判定限流)
- 配置链路:Config.chinaApi.appkey、Validator schema/default、
  CONFIG_CHINA_API_APPKEY 环境变量、config.example.json 示例
- 新增 logging/PushPlus.ts:照 Telegram/Queue 模式(PQueue 限速 2条/秒、
  httpRequest 直连、429 静默、共享 flushQueue 5s 超时)
- 运行结束一次性推送中文积分摘要(不接 Logger 逐条日志,避免微信轰炸),
  单进程与集群主进程两处 RUN-END 均挂接
- 配置链路:webhook.pushplus(enabled/token/title/template/channel)、
  Validator schema、CONFIG_PUSHPLUS_* 环境变量、config.example.json 示例
- Dockerfile 基础镜像走 m.daocloud.io(Docker Hub 国内代理),
  海外环境可改回 node:24-slim
- compose.yaml 改本地构建(ghcr.io/thenetsky 官方镜像不含国内适配),
  TZ 默认 Asia/Shanghai,附国内特性注释(china 引擎/appkey/PushPlus)
- 从 main 搬运 scripts/mac/ launchd 运行脚本
- crontab/CMD 不动:v4 官方 entrypoint 已用 crontab 命令安装用户格式
  cron 且 exec cron -f,main 的 root 字段与 CMD 修复不再适用
- config.example.json 照搬 main 防风控默认值:搜索间隔 6-12min、阅读间隔
  6-11min、访问 20sec、默认开随机滚动/点击、默认关并行、proxy.queryEngine
  关、globalTimeout 50sec、debugLogs 开
- search-queries.json 整体替换为 main 中文词库(纯字符串数组,零代码改动)
- env.example 引导国内账号配置 GEO_LOCALE=CN / LANG_CODE=zh-CN
- 覆盖 src/ 全部 logger.info/warn/error/debug 的 message 文案:
  登录链路(Login + 6 种登录方式)、浏览器核心(index/BrowserFunc/
  ReactFunc/BrowserUtils/Browser/UserAgent)、搜索链路(QueryEngine/
  SearchManager/BrowserSearch/ApiSearch 系列/查询队列)、活动任务
  (视觉搜索/打卡/连击保护/领取积分/每日签到/读文赚积分等)
- 译文沿用 main 分支既有术语(每日任务/更多推广/连击/仪表板/移动端/
  桌面端),键值对 | 分隔格式与 ${...} 插值原样保留
- 日志事件名(如 SEARCH-CHINA-TRENDS)、throw Error 消息、注释、
  代码结构均未改动;tsc 编译零错误,脚本复查英文残留 0 处
src/config.json、src/accounts.json 是 Load.ts 的查找路径之一(cwd → 根 →
dist → src),运行时文件落在 src/ 时不应被误提交(此前 i18n 提交曾误带入,
已 amend 移除)
- 头部新增国内版特性清单与推荐配置(china 引擎 + appkey + PushPlus +
  CN/zh-CN + Docker 环境变量对照)
- 搜索设置表更新为本仓库国内默认值,新增 chinaApi.appkey 条目
- Query sources 增加 china 源说明(多源聚合/限流退避/主源达阈值即停)
- Webhooks 表增加 pushplus 配置项
- 从另一份迁移实现搬运 run.bat / setup.bat(Windows 一键运行/安装)
- 补 BonusTracker.ts 日志汉化(此前遗漏的文件)
- README:clone 指引改指本仓库 V4-china 分支并附国内镜像克隆方式;
  删除指向上游 GHCR 官方镜像的徽章;Docker 章节强调必须本地构建
- 直连 ilinkai.weixin.qq.com 官方接口,免费、无第三方服务依赖
- 配置 webhook.clawbot.enabled / authFile,Docker 环境变量 CONFIG_CLAWBOT_*
- 首次运行检测到未登录时终端自动弹二维码(qrcode-terminal),扫码凭证存 clawbot-auth.json(已加入 .gitignore),多机可复制共用
- 凭证过期(服务端 -14)自动清除,下次运行重新弹码;npm run clawbot:login 可手动登录,test:clawbot-smoke 冒烟测试
- 运行结束推送中文积分摘要,与 PushPlus 摘要同链路
- 顺带清理未使用的 OAuth 接口与 clearStorageState 死代码
- 全量日志追加写入 logs/YYYY-MM-DD.log(本地日期),.gitignore 忽略 /logs
- 进程首次写日志时自动清理超期文件,保留天数由 LOG_RETENTION_DAYS 控制
- README Logging 一节补充说明
- env.example 默认 LANG_CODE=zh-CN、GEO_LOCALE=CN、保存移动/桌面指纹,贴合国内账号推荐配置
- .gitignore 补充 /.env(账户凭证)与 /.zcode/,防止误提交
- 顶部状态由「功能未必正常,风险自负」更新为:核心功能实测通过、可日常运行,新架构仍在迭代
- v3 分支链接改指本仓库 main 分支(国内适配 v3 稳定版)
- 结构对齐 main:徽章头、目录、核心特性、快速开始对比表、Windows/Docker 部署、配置参考(details 分组)、通知渠道、常见问题、注意事项、同步与致谢、免责声明
- 内容全部换成 v4 事实:.env 账号配置(不再用 accounts.json)、新任务开关(Read-to-Earn/搜索 perk/视觉搜索等)、queryEngines 多源与 RSS、实验特性、账户级代理、控制 API 与面板
- 保留国内适配专有内容:china 热搜源策略与 appkey、PushPlus/ClawBot 微信推送(含 ClawBot 三步接入)、国内默认值说明、Docker 镜像加速
- 常见问题补充 v3 迁移(accounts.json 不兼容)、会话管理命令、ClawBot 凭证过期处理
- iLink 要求主动发送必须携带 context_token(无 token 时 ret=-2 prepare failed),
  通过 getupdates 长轮询抓取用户发给 bot 的消息获取,持久化到 clawbot-auth.json
- 启动钩子增加激活等待:登录后/凭证缺 contextToken 时提示在微信给
  「微信 ClawBot」发条消息(2 分钟超时,不阻塞任务),成功后回发验证消息
- 发送返回 -2 时清除失效 contextToken,下次运行自动重新等待激活
- 二维码渲染改用 require 调用,修复偶发不显示只能开链接的问题
- clawbot:login 改为完整流程(登录+激活+验证消息),退出前 flush 队列
- 新增 scripts/tests/clawbotDiag.cjs 发送诊断脚本
- BrowserFunc/Login/BrowserUtils 中 3 处 throw this.bot.logger.error(...) 等价于
  throw undefined,导致 FLOW 日志与推送明细只剩 undefined / Flow failed;
  改为记录日志后重抛原始错误
- runTasks 失败明细由写死的 Flow failed 改为真实错误信息(压平换行、截断 120 字符)
- 新增 formatLocalTimestamp 并在推送摘要、日志行前缀、错误诊断间共用;
  原均为 UTC,与本地时间差 8 小时(如 02:09 实为 10:09)
# Conflicts:
#	src/browser/Browser.ts
#	src/browser/BrowserFunc.ts
feat: 适配汉化脚本的中文日志格式,更新 logParser.js 正则匹配
- dashboard/server.js: zero-dependency web UI (accounts table, per-day
  points persisted across runs, batch account selection, DingTalk push
  config modal, tunable auto-refresh). Runs as a supervised child process
  in API mode; data persists under config/dashboard/.
- entrypoint: start dashboard when DASHBOARD_ENABLED (default true) in
  API mode, auto-restart on crash; healthcheck probes it as well.
- Dockerfile/compose: ship dashboard/, document ports and env vars.
- Drop the legacy host-side bridge import endpoint (obsolete with the
  embedded deployment).
… login

- scripts/main/loginCheck.js: headless session check per account - restores
  the saved mobile/desktop session, verifies rewards.bing.com still resolves
  (no login redirect), reads the live balance from the Rewards user-info API
  and persists refreshed cookies. Machine-readable LOGINCHECK_RESULT line.
- dashboard: 🩺 per-row login check (background job + polling, result lands
  in the account's balance/status) and 🔑 manual login - orchestrates
  Xvfb + x11vnc + websockify + upstream manualLogin.js and proxies noVNC
  through :8300 with a one-time token (HTTP + WS upgrade piping), so
  Microsoft identity-confirmation challenges can be solved from the
  dashboard itself instead of another device.
- Dockerfile: add xvfb/x11vnc/novnc/websockify, ship scripts/main + utils.js
…s shell

- Dockerfile: drop --only-shell so headed browsers (manual login under
  Xvfb) can launch; the shell-only install made manualLogin die instantly
  with a missing-executable error, which then cascaded into the VNC
  cleanup killing Xvfb.
- startManualLogin: clear stale /tmp/.X99-lock and .X11-unix sockets
  before starting Xvfb (a SIGKILLed session leaves them behind).
- surface the runner's error line via manual-login status + UI.
# Conflicts:
#	README.md
#	compose.yaml
#	package.json
#	src/browser/MediaBlocker.ts
#	src/browser/auth/Login.ts
…d fork

The merged V4-china code logs in Chinese (账户完成: x | 获得积分=N |
现余额=N); the dashboard's SSE recordEntry/push regexes now match both
the English upstream and Chinese message formats, verified against
parseLogLine output for both.
- New account source: config/accounts.extra.json (dashboard-managed,
  index 901+, merged after env accounts by all three loaders:
  src/util/Load.ts (runs incl. cron), scripts/api/accounts.js (API
  listing + single/excluded-run env injection), scripts/utils.js
  (manual login / login check).
- Dashboard: 👥 account management dialog (list/add/delete dynamic
  accounts with source badges; fixed env accounts view-only).
- accounts.extra.json holds credentials - gitignored, chmod 600.
@rgmyyw rgmyyw closed this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants