Commit Graph

56 Commits

  • feat(v1.2.0): 多应用平台——创建实例时选 微信/Telegram(+Chromium/自定义占位)
    镜像层(向后兼容,微信路径零改动):
    - app-defs.sh:按 appType 给出 APP_BIN/APP_LAUNCH/APP_NAME(缺省回退微信)。
    - app-ctl.sh:通用安装/状态分发;wechat 委托回 wechat-ctl.sh;telegram 下载官方 portable tar.xz。
    - autostart:读 /config/.woc-app 选择启动哪个应用,读不到回退微信(老实例零改动)。
    - 02-woc-app 钩子:把容器环境 WOC_APP_TYPE 落到 /config/.woc-app(缺则不写→回退微信)。
    - Dockerfile:加 xz-utils(telegram 解压)+ COPY 新脚本。
    
    后端:envList 透传 WOC_APP_TYPE(+自定义启动命令);triggerWechat/wechatStatus 改走
    app-ctl.sh <appType>(微信行为不变);创建实例路由接受 appType。
    
    前端:新建实例对话框加「应用类型」选择器(微信默认 / Telegram;Chromium、自定义标记"即将支持"禁用)。
    
    本轮 Telegram(x86_64) 端到端可用;Chromium(待 apt 烤镜像) 与 自定义(待上传流) 下一轮。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • fix(desktop): 输入模式切换改为整页重载,修卡死 + 切换不生效
    切换模式时原先 bump vncNonce 在页内重挂 iframe,会让新旧两条 VNC ws 短暂并存,
    概率性把实例 Xvnc 卡死(需重启容器恢复、面板重启无效),且新连接常读不到新 enable_ime
    (仍是英文)。改为 window.location.reload():先卸载旧页彻底关旧 ws,再以新模式干净重连,
    正是用户实测唯一可靠的方式。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • fix(docker): typeInInstance 卡 ~2s 根因——xclip 未重定向 fd
    xclip -i 会 daemon 化常驻持有剪贴板选区,并继承 docker exec 的 stdout/stderr,
    导致 exec 要等这俩 fd 关闭、每次中文转发卡 ~2.1s。给 xclip 重定向 >/dev/null 2>&1
    后整条链路降到 ~0.08s(实测 26× 提速)。中文输入条与无感模式都受益。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • fix(desktop): 修无感输入两处 bug(切换不生效 + "你好y呀"丢字)
    1) 切到无感后当前会话仍是旧 enable_ime → 表现"还是打英文,要换页才行"。
       setMode 现同步写 enable_ime 并 bump vncNonce 重挂 iframe,让 noVNC 立即按新模式重连。
    2) "你好[空格]呀"打出"你好y呀":有序队列在中文转发期间会把下一个词的拼音首字母(y)当字面字符抢走。
       改为队列活跃时只接管【数字】(原"混数字丢字"的祸首) + 回车/退格;字母绝不接管,交给输入法合成。
       附带消除了之前"每个键都走 xdotool"导致的卡顿(字母回到原生合成快路径)。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • feat(v1.2.0): 实例 appType 数据模型地基(向后兼容)
    引入 AppType(wechat/telegram/chromium/custom)+ APP_LABELS + instanceAppType() 兜底。
    Instance 增 appType?(可选) 与 customLaunch?;createInstance 接受 appType(默认 wechat)、
    按应用取默认名;publicInstance 下发 appType(老实例无字段→回退 wechat)。
    纯增量、不改现有运行行为;为后续 autostart 分发 / 各应用安装 / 前端选择器铺底。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • feat(desktop): 输入法双模式切换(无感 / 转发)+ 深度修复无感丢字
    nav 栏可切「无感输入」(直接在微信里打中文)/「转发输入」(底部输入条,默认),偏好持久化。
    无感:enable_ime=true,compositionend 捕获中文经 xdotool 转发;并用有序队列把"转发未完成期间"
    的后续可见字符 + 回车/退格串行送出,彻底消除"中文走异步、数字走 keysym 抢跑"的"你好123→23"丢字;
    队列空闲不干预,英文/数字仍走原生 keysym 零延迟。新增 /api/instances/:id/key(xdotool 单键)。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • feat(admin): 实例「管理」菜单改为悬浮图层展开
    绝对定位悬浮层(从按钮下方浮出),不再撑高卡片/顶走下方内容;展开时卡片 overflow:visible
    + z-index:5(盖住下方/同列卡片,仍低于弹窗);加点击外部 / 点击菜单项自动关闭。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • chore(docker): 00-woc-identity 也用显式 chmod 755(补齐 #17)
    PR #17 把脚本权限改为显式 755/644 以摆脱构建机 umask 影响,但它之后才加的
    00-woc-identity 钩子仍是 chmod +x,是唯一漏网。该钩子由 root 运行(711 也能跑、
    非功能性问题),此处仅为与其余几行统一、彻底做到与 umask 无关。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • docs(readme): 备注 NAS/飞牛首次建实例镜像拉取超时的解法
    NAS 自带的 Docker Hub 加速通常只覆盖界面手动拉取,不覆盖面板经 docker.sock 触发的拉取,
    导致首次新建实例直连 registry-1.docker.io 超时。README 快速开始加提示:先手动拉一次
    gloridust/wechat-on-cloud:latest(本地有了面板就复用不再联网),或配守护进程镜像加速 /
    换 WOC_IMAGE_PREFIX 到国内源。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • docs(readme): 方式B 改为仅凭 docker-compose.yml 部署,无需 clone 仓库
    compose 用 image: 拉官方镜像、数据落到旁边自动建的 ./data-panel,不依赖仓库其它文件
    (已在空目录验证 docker compose config 通过)。方式B 改为:命令行 curl 单文件 / 飞牛(fnOS)·
    群晖等 NAS 直接粘贴 docker-compose.yml 到 Compose 一键部署界面;并说明改密码/端口/镜像源
    可用 .env 或 NAS 环境变量,无需 clone。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • feat(ci/telegram): 发布通知自动置顶 + 取消上一个 release 的置顶
    tg-notify.mjs:release/手动触发发完消息后,用 getChat 读群当前置顶(=上一个 release),
    pinChatMessage 置顶新消息(静音,避免二次提醒)、unpinChatMessage 取消旧的——无需持久化存储。
    issue 通知不置顶;置顶失败(机器人非管理员/无置顶权限)仅跳过、不影响通知本身。
    文档补充:需把机器人设为群管理员并开启「置顶消息」权限。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • chore: 默认镜像源切到 Docker Hub,GHCR 作为备用
    Docker Hub 国内/国际通用、免登录拉公开镜像,飞牛OS(fnOS) 等 NAS 还内置拉取加速,
    通常比 GHCR 更快更稳。docker-compose.yml 两处 :- 兜底默认与 .env.example 默认值
    由 ghcr.io/gloridust 改为 docker.io/gloridust;GHCR / 南大反代 / 阿里云等列为备用源。
    README 快速开始措辞同步更新。镜像仍同时发布到两个 registry,未改 CI。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • docs(readme): 增加 Docker Hub 镜像源切换说明(飞牛OS 等 NAS 有加速)
    官方镜像已同步发布到 Docker Hub(公开、多架构)。README 快速开始补充:
    ghcr.io 拉不动时在 .env 设 WOC_IMAGE_PREFIX=docker.io/gloridust 切到 Docker Hub;
    飞牛 OS(fnOS) 等 NAS 内置 Docker Hub 拉取加速,通常更快更稳。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • fix(panel): 修复 VolumeManager 漏闭合的 .vol-sec 标签致构建失败
    a42006e 把第 1259 行的 </div> 误回退成 </>,与 <div className="vol-sec"> 不匹配,
    导致 vite/esbuild 构建报 "Unexpected closing fragment tag" → main 上 panel 镜像构建失败
    (v1.1.10 标签镜像本身是好的,从 1c34777 构建)。改回 </div>。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • feat(panel): 管理员数据卷管理(整卷备份/恢复 + 文件浏览器)
    管理页 → 实例「管理」→ 数据卷(仅 admin)。解决大量用户"把 PC 微信数据迁移上 docker"的诉求。
    
    - 整卷备份:流式打包 /config 为 .tar.gz 下载(大文件不入内存);恢复:上传覆盖回 /config。
      machine-id 存在卷内随包迁移 → 跨 woc 实例恢复可保留聊天记录。
    - 文件浏览器:浏览/上传/上传并解压(.tar/.tar.gz)/下载/改名/移动/删除;PC 数据打包上传解压后重启实例。
    - 全程在运行中的实例上操作(exec + docker cp,运行容器才可 exec);恢复为全量覆盖,强提示并建议重启。
    - 安全:仅 admin;路径严格限制在 /config、禁止 .. 穿越;上传落地为 abc 属主。
    - docker.ts 抽出 extractSingleFileFromTar 复用(PAX 头跳过),新增 list/mkdir/move/delete/upload/
      extract/download/backup(stream)/restore;index.ts 加 9 个 /volume 管理路由;前端 VolumeManager 弹窗
      + 线性 SVG 图标(替代渲染不一致的 emoji);新增 doc/数据卷管理.md。
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • ci(telegram): render release/issue notes as Telegram HTML (not raw markdown)
    GitHub-Flavored Markdown ≠ Telegram MarkdownV2, so the old plain-text send
    showed literal ## ** | etc. New .github/scripts/tg-notify.mjs converts GFM
    → Telegram-safe HTML (<b>/<i>/<code>/<pre>/<a>; headers→bold, tables→· rows,
    lists→•, quotes→▎), escapes <>&, and falls back to plain text if Telegram
    rejects the HTML. Adds workflow_dispatch to telegram-notify so you can send
    the latest release rendered for testing without cutting a new release.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • feat(admin/ci): 管理页折叠菜单 + 空状态/主页优化 + Telegram 命令机器人
    管理页 UI/UX
    - 实例卡片操作改为「管理」分类折叠菜单(默认收起,点开按 运维/设置/危险 分组的
      文字操作),替代之前难辨认的图标排;删除单独成组、红色,降低误点
    - 修复展开一张卡片时同行其它卡片被 grid 拉等高(inst-grid align-items:start)
    - 管理页空状态(无实例/无子账号)改为图标+标题+说明+引导按钮
    - 主页实例卡片加副行(状态·微信版本)、悬停上浮高亮
    
    Telegram 命令机器人(轮询版,纯 GitHub Actions,无服务器)
    - .github/workflows/telegram-bot.yml + scripts/telegram-bot.mjs
    - 私聊/群组命令:/help /releases /release <tag> /issues /issue <编号>
    - cron 每 5 分钟 getUpdates,处理后用 offset 向 Telegram 确认,无需持久化存储
    - 受 vars.TELEGRAM_BOT_ENABLED 开关;命令非实时(cron 限制),文档已说明
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • ci: Telegram notify on release / new issue (serverless via Actions)
    New .github/workflows/telegram-notify.yml: on release published or issue
    opened, send a message to a Telegram group via @WechatOnCloudBot. Runs on
    GitHub Actions (no server). Gated on vars.TELEGRAM_CHAT_ID so unconfigured
    forks skip safely. Arbitrary text passed via env (no script injection),
    sent as plain text with --data-urlencode (no markdown parse breakage).
    Setup documented in doc/发布到GHCR.md.
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • feat: 中文输入条 + 文件下载/另存修复 + 卡连接自愈 + CF/MAC/音频
    中文输入(彻底改造,弃用脆弱的 VNC IME 拦截)
    - 关闭 KasmVNC enable_ime:VNC 直接打字回归纯 keysym,英文/数字正常、不再损坏
    - 新增底部「中文输入条」:面板真实 textarea 原生输入法 → POST /type → 容器内 xclip+xdotool
      粘贴进微信,可靠且与浏览器/输入法无关。flex 列布局(nav/画面/输入条三者并列不遮挡),
      牛奶布艺主题配色,可一键收起。
    
    稳定性 / 自愈
    - watchdog 新增响应性探测:实例 I/O/服务 stall(进程在、显示在线但读不出 VNC 文件、永远"正在
      连接桌面")时,连续 2 次无响应即自动重启自愈
    - 前端 12s 未加载出来 → 「桌面无响应」+ 重新连接/重启,不再无限转圈
    - PWA 新 SW 接管即自动重载一次,更新一刷即生效(修"改了仍看旧界面")
    
    文件
    - 下载:正确解析 tar、跳过 PAX 扩展头(中文名文件曾因此大小错误/损坏)
    - 另存:每次启动确保 /config/Desktop 归 abc,修微信另存"保存失败"
    
    安全 / 伪装
    - Host 白名单支持 *.example.com 通配 + X-Forwarded-Host(修 CF 反代域名仍被拒)
    - 设备伪装新增真实网卡 MAC(厂商 OUI,替代容器本地管理位 MAC)
    
    音频:扬声器自动连接(首个手势激活)、焦点离开自动断、麦克风(HTTPS)
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • docs: add社媒 links (Twitter / Telegram) to README
    Hero badges + a 交流与关注 section: x.com/gloridust1024, t.me/WechatOnCloud.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
  • fix(P0): unique persistent machine-id per instance + manual reset
    All instances shared the image-baked machine-id (a67bf09f...), so Tencent
    saw every WechatOnCloud account worldwide as one "device" — a textbook
    device-farm signal triggering risk control and the forced-logout loop
    reported across old and new versions.
    
    - docker/woc-identity.sh: new /custom-cont-init.d/00-woc-identity hook —
      generates a unique machine-id on first start, persists it in the data
      volume (survives restart/upgrade/recreate), writes /etc/machine-id +
      /var/lib/dbus/machine-id, removes /.dockerenv. Existing instances get a
      fresh unique id on first upgraded start (volume lacks the file).
    - regenInstanceMachineId + POST /api/admin/instances/:id/regen-machine-id:
      roll a brand-new device id and restart, for accounts re-flagged by risk
      control. Gated on the hook being present (old image → instructs upgrade).
    - Admin 实例卡片「安全」弹窗新增「重置设备 ID 并重启」。
    
    Verified: two fresh containers get distinct machine-ids; id persists across
    restart; regen (rm persisted file + restart) yields a new persistent id.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
  • ci: optional Docker Hub mirror in release workflow
    - release.yml: dual-push to GHCR + Docker Hub when vars.DOCKERHUB_USERNAME
      is set; falls back to GHCR-only when unset (no behavior change for forks).
    - .env.example: surface docker.io as a first-class WOC_IMAGE_PREFIX option.
    - doc/发布到GHCR.md: document the one-time Variable + Secret setup and the
      prerequisite of pre-creating the public repos on hub.docker.com.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
  • docs(security): clarify multi-host allowlist + echo rejected host in 400
    - .env.example: surface multi-domain syntax (PANEL_ALLOWED_HOSTS=a,b,c),
      IPv6 literal example, and reverse-proxy troubleshooting tip.
    - index.ts: 400 response includes the rejected `host` and a hint pointing
      at PANEL_ALLOWED_HOSTS — drops the diagnostic floor when reverse-proxy
      Host-passthrough is misconfigured.
    
    Follow-up to #13 (DNS-rebinding allowlist).
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
  • Merge pull request #13 from aaronjmars/security/host-allowlist-dns-rebinding
    fix(security): gate panel Host header to block DNS rebinding
  • fix(security): gate panel Host header to block DNS rebinding
    Without Host validation, a malicious page the operator visits can use DNS
    rebinding to point a hostname at the panel's loopback / LAN IP and drive
    every authenticated API from the operator's own browser — including the
    docker.sock-backed admin endpoints. The README's "intranet-only" guidance
    does not cover this: the browser is the trust-boundary crossing.
    
    Add an onRequest hook (plus a Host check on raw WebSocket upgrades) that
    allows loopback + RFC1918 LAN by default and accepts public hostnames via
    PANEL_ALLOWED_HOSTS (documented in .env.example and threaded through
    docker-compose.yml). 35 inject()-driven assertions; tsc --noEmit clean.
    
    Detected by Aeon + manual review (DNS-rebinding-gate axis).
    Severity: high
    CWE-346 (Origin Validation Error)
  • Merge pull request #12 from huglemon/fix/cjk-ime-paste-fallback
    修复中文 IME 输入大量丢字:增加容器内剪贴板粘贴兜底路径
  • feat: 超管密码离线找回 + 改密/重置二次确认 + GHCR 手动构建文档
    - 密码找回:accounts.json 给用户加 "resetPassword": true(兼容 reset_password),
      重启面板即把其密码重置为 PANEL_ADMIN_PASSWORD(默认 wechat)、解禁并清除标记
    - 改密/重置密码弹窗新增「再次输入新密码」二次确认:两次不一致则拦截,
      避免浏览器自动填充/手误把密码静默设成非预期值导致锁死
    - README:补充方式 B(本机 buildx 手动多架构构建推送 GHCR)+ Release 的 latest 注意事项
      + 「重置超管密码(离线找回)」操作步骤
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>