Commit Graph

577 Commits

Author SHA1 Message Date
wangjia fd285708c7 chore(pay): selfcheck.sh 去掉调试打印(派生已核对通过)(#34/34A)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 13:35:49 +08:00
wangjia e169099524 feat(pay): selfcheck.sh 从 Bitwarden 取 xpub 跑派生自检 + 打印 xpub 便于核对(#34/34A)
rbw 取钱包 A 的 account xpub(公钥,不写死/不落盘)→ go run paywatch selfcheck 打印
前 N 个派生地址,供与 TronLink 插件/Ian Coleman 逐个核对;并打印 xpub 本身 + 长度/前缀,
便于判断存的是 Account(m/44'/195'/0')还是 BIP32(m/44'/195'/0'/0)那个(存错会全错)。
无 $() 命令替换。私钥/助记词永不进此脚本。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 13:33:24 +08:00
wangjia efa6cffecd feat(pay): paywatch selfcheck + money-critical 验证 runbook(#34/34A)
selfcheck 子命令:用 PAY_ACCOUNT_XPUB 打印前 N 个派生收款地址,供与自己钱包/Ian Coleman
逐个核对(派生错=钱打到无私钥地址)。README 加『收真钱前必过』四步验证:①金标准测试
②Ian Coleman 独立交叉核对 ③真钱包 A selfcheck 比对 ④真链 1 USDT 收→控→测→归闭环。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 08:11:52 +08:00
wangjia 7cf87a764f feat(pay): Phase D 归集 —— 气隙签名 sweep(#34/34A)
动钱代码,按"联网建/广播 + 离线签"气隙流程,离线签名独立验签防篡改:
- wallet: DecodeTronAddress/TronAddressBodyHex(base58check 解码校验)、AddressFromMnemonic(离线校验用)。
- tron/sign: TxID(sha256 raw_data)、SignRawData(secp256k1 → R||S||recid 65B)、RecoverAddressBody。
- tron/abi: ABIEncodeTransferParams(transfer(address,uint256) 参数)、keccak 地址体。
- tron/tx(联网): BuildTransfer(triggersmartcontract 建未签名)、TRC20Balance、Broadcast。
- cmd/sweep: plan/build/sign/broadcast 四段;sign 对每笔独立验:①重算 txid 防篡改 ②收款人+额 ABI
  内嵌 ③USDT 合约内嵌 ④派生地址==owner,任一不符拒签;助记词只经 PAY_SWEEP_MNEMONIC(离线机,不入 arg)。
- 测试:签名可恢复到正确地址、ABI 编码、地址解码 roundtrip 全绿。
- 联网上链部分标注需 Phase E 真链验证;README 补 sweep 用法 + 验签说明 + gas 提醒。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 04:12:04 +08:00
wangjia 4bb92209ca feat(pay): 收款引擎 —— 建单/派生地址 + TronGrid watcher 侦测到账(#34/34A Phase B.3+C)
- store(SQLite,modernc 纯 Go):pay_orders + addr_cursor(HD 派生游标,地址不复用);
  建单/查单/ListPending/MarkPaid(幂等,仅 pending→paid)/MarkExpired。
- pay 服务:CreateOrder 每单 NextAddrIndex→从 xpub watch-only 派生唯一收款地址→写 pending 单(TTL 15min)。
- tron:TronGrid 客户端读已确认 TRC20 到账(only_confirmed + USDT 合约,micro-USDT 整数)。
- watcher:Tick 先过期逾期单,再对每个 pending 单查到账、金额≥期望→MarkPaid;幂等(同 tx 只认一次)、
  网络错误跳过下轮重试;Loop 定时轮询。
- httpapi:POST /order、GET /order/{orderNo}、/healthz;cmd/paywatch 用 env 装配 + 优雅退出。
- 测试:store/service/watcher(mock TronGrid)/httpapi 全绿——建单派生地址正确、到账侦测、
  欠额不认、幂等、超时过期、404/400。热服务无私钥。
- README:安全模型 + Phase A 离线备钱包步骤 + 运行/API/测试。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 02:57:47 +08:00
wangjia 4393edf1d7 feat(pay): pangolin-pay 钱包派生模块(#34/34A · 加密货币交易引擎 Phase B.2)
新建独立 Go module pay/(pangolin-pay:独立 VPS 跑,与控制面分开、隔离 crypto 依赖)。
wallet 包:
- AddressFromAccountXpub(xpub, change, index):watch-only 从账户 xpub 派生 TRON 地址
  (Keccak-256 legacy → 后20字节 → 0x41 → base58check),watcher 用,不碰私钥。
- seed.go(离线专用):助记词→account xpub / 地址私钥(hex),给 Phase A 导 xpub、Phase D 归集签名。
- 测试:①派生一致性——xpub 路径与私钥路径逐个相等(证明每个收款地址对得上签名私钥);
  ②金标准向量锁定实现防回归。⚠️ 金标准需按 A.4 用 Ian Coleman 交叉核对一次。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-09 02:50:24 +08:00
wangjia 9a8fec2e9c fix(usercenter): 加 no-FOUC 内联脚本,消除刷新时明暗主题整页配色闪烁
layout 之前把 data-theme 硬编码 light、挂载后才由 UIProvider effect 应用保存的主题,
暗色偏好用户每次刷新先见浅色再翻暗色 = 整页配色重绘(叠加内容加载,观感"刷两次")。

照官网 Site.astro 做法:<head> 内联脚本在首屏渲染前读 localStorage(pg_uc_theme/
pg_uc_lang)设好 data-theme 与 html lang。/user/* CSP 允许 unsafe-inline 脚本,直接内联;
脚本为编译期常量、无插值、只读 localStorage,无 XSS 风险。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 15:04:23 +08:00
wangjia 101b31e073 fix(usercenter): 消除刷新"重绘两次" —— 引导期直接渲染外壳骨架,去掉多余首帧
上一版为防水合不一致加了 !mounted 中性首帧,反而制造了额外一段:一次 Cmd+R 走
裸 spinner(mounted=false)→ 应用外壳(乐观)→ 内容区(overview),三段重绘 =
用户看到的"刷新两次(先主显示区、后整页)"。

改:去掉 mounted gate;引导期(!ready)一律渲染 appShell(spinner)——外壳骨架
(顶栏/导航就位、内容区加载态)。因 render 期不读 localStorage/hasRefresh,SSR 与
客户端首帧一致、无水合不一致,静态 HTML 首帧即外壳。引导完成后只把内容区从 spinner
换成真实视图,顶栏/导航原地不动 → 刷新只有内容区一次替换,不再整页重绘。

代价:未登录用户刷新 /user/ 会先见外壳骨架再落登录页(极短、且随即要登录),
可接受;已登录用户(刷新的绝大多数场景)全程外壳稳定、无闪。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 15:01:29 +08:00
wangjia 11ad888ee7 fix(usercenter): 刷新页面即被登出 —— refresh 改用请求体传 token(修致命鉴权 bug)
根因:服务端 POST /v1/auth/refresh 从**请求体** {refresh_token} 读取(handler.go
Refresh + 原生 Flutter auth_api.dart 均如此),但 web 客户端 refresh() 误把 refresh
token 放进 X-Refresh-Token **请求头**(只有 /auth/logout 读该头)。服务端拿到空 body
→ 400 auth.invalid_request → 客户端 catch → clearSession → **每次刷新页面即被登出**。

线上实测证实:POST 带头无体 → invalid_request(空);带体 {refresh_token} → invalid_token
(正常解析)。故服务端读体、web 发头 = 必然掉线。

改:web refresh() 改用 body:{ refresh_token } 传参(与原生客户端、服务端一致);
无需改/重部署服务端。logout 仍走 X-Refresh-Token 头(服务端 logout 读头,匹配)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 14:52:21 +08:00
wangjia 53d8ded7f6 fix(usercenter): 刷新 /user/ 不再整页重绘(引导期乐观渲染外壳)
上一版把首帧从登录页改成居中 Loading,消除了闪登录页,但用户仍感刷两次:
静态导出首帧无法知登录态 → 先渲染裸 Loading(无顶栏/导航)→ 再出现完整外壳
→ 再拉 /me 填内容。顶栏在裸 Loading 到外壳间消失再出现,观感=整页重绘两次。

改:抽出可复用 appShell(content);mount 后引导仍进行(!ready)时,若本地有 refresh
token,乐观渲染完整外壳(顶栏/导航就位,仅内容区转圈),没 token 才直接登录页。
于是顶栏/导航从乐观态到已登录态始终在位,只有内容区替换 → 不再整页重绘。

SSR 安全:!mounted(SSR + 首次客户端渲染)仍渲染中性 spinner(不读 localStorage),
与服务端 HTML 一致防水合不一致;mount 后才据 hasRefresh() 决定外壳/登录页。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 14:43:24 +08:00
wangjia e3e1d43d5d fix(usercenter): 刷新 /user/ 不再先闪登录页(引导期一律加载态)
根因:静态导出 SSR 首屏读不到 localStorage(hasRefresh 服务端恒 false),旧守卫
!ready&&hasRefresh() 在此时为 false → 首屏渲染成登录页 → 刷新 /user/ 浏览器先显示
登录页 HTML,再水合+续期跳回面板(闪现);且 render 期调 hasRefresh 造成 SSR/客户端
不一致加剧闪现。

修:引导未完成(!ready)一律显示加载态(不读 localStorage、不渲染登录页),SSR 与
客户端首屏一致;引导完再定:已登录→面板、未登录/失败→登录页。刷新不再闪登录页。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 14:28:17 +08:00
wangjia 09b1944376 fix(usercenter): 续期失败时清本地会话,修主页↔登录页来回刷
根因:引导时 api.refresh() 失败(refresh token 过期/被撤销/Redis 丢 JTI 白名单)
只 setAuthed(false),没清 localStorage 的 pg_uc_refresh/pg_uc_email → 官网仍据此
显示'用户中心' → 点进 /user/ 又续期失败回登录页 → 来回刷。

修:catch 里加 clearSession() 清掉残留 token,官网随即回到'Log in',状态一致、
不再来回刷。(登录态正常保持 30 天=refresh token TTL;失败多因会话真失效。)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 14:23:35 +08:00
wangjia e0912dd819 fix(website): 定价卡片 3 个按钮补链接(原纯 button 无响应)
PricingPlans.jsx 的 pcta 是纯 <button> 无 onClick/href → 点击无反应。改为
<a href>:Free「Download free」→ #download 下载区;Pro/Team「Get a code」→
#get-code(给渠道区 .pay-note 加 id,滚到购码渠道:自助店/USDT/Telegram/LINE/
邮箱)。.pcta 补 display:block/text-align:center/text-decoration:none 让 <a>
渲染同按钮。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 13:09:29 +08:00
wangjia f4c5f93370 fix(website): 主题切换按钮缩小,与用户中心一致(透明底/无框/17px 图标)
原 38×38 圆框 + surface 底太大;改为透明底、无边框、padding 6、图标 17px,
和用户中心顶栏主题按钮同款尺寸。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 12:13:01 +08:00
wangjia 6dcf582225 feat(website): 官网加明/暗主题切换(默认浅色,无 FOUC)
- Header 加 Moon/Sun 切换按钮(.themetoggle class,走语义 token,无内联 style),
  切 document.documentElement.dataset.theme + 存 localStorage pg_site_theme,
  挂载读回同步;移动端也能切。
- Site.astro + Doc.astro <head> 加 <script is:inline> 无 FOUC 初始化(首屏前读
  localStorage 设 data-theme;postbuild csp-hashes 已加 script hash 放行)。
- 暗色机制:tokens.gen.css 已含 [data-theme=dark] 块,官网 127 处语义 token 自动
  适配;23 处 light 专属原色(公告条/CTA/主推套餐卡 clay 品牌面 + 恒暗页脚)均
  有意固定,保留。
- 审计:所有元素走唯一真相源(check-ds/check-l1-sync/check_ds_code 三闸全绿)。

验证:check-l1-sync ✓ · build ✓(CSP hash 覆盖 FOUC 脚本)· redline 0 · Header
零内联 style。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 11:58:35 +08:00
wangjia 9ed7588ec0 fix(usercenter): 删冗余 Preferences 卡片 + 修登录态进用户中心闪登录页
1. Settings 页删掉 Preferences 卡片(语言/主题切换)——顶栏已有语言下拉 + 主题
   切换按钮,重复。连带删只被它用的 Preferences/Row/Seg 函数 + useUI 导入。
2. 修 bug:从官网登录态点"用户中心"进 /user/ 会先闪登录页再跳面板。根因:渲染
   守卫在 !ready(会话续期中)时也直接渲染 Login。改为:本地有 refresh token 且
   续期未完成时显示加载态(非登录页),续期成功→面板、失败/无 token→登录页。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 11:22:11 +08:00
wangjia 87647cae34 fix(usercenter): Subscription/Redeem/Referral/Settings 布局宽度对齐 Overview
这 4 页根布局各自设了更窄的 maxWidth(720/680),而 Overview 无 maxWidth 填满
1000px 居中容器 → 这几页内容贴左、右侧留白、与 Overview 不一致。去掉各自的
maxWidth,统一填满主容器(maxWidth:1000 margin:0 auto),宽度与 Overview 一致、
居中对齐。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 11:13:31 +08:00
wangjia 620d8148f3 fix(usercenter/overview): 4 处格式调整
1. 顶栏 Sign out 按钮加 whiteSpace:nowrap,不再折成两行。
2. 近 7 日柱状图数字保留 2 位有效数字(Number(v.toPrecision(2))),不再显示
   9.285392755642533 这种长数。
3. 英文星期标签 M/T/W/T/F/S/S → Mon/Tue/Wed/Thu/Fri/Sat/Sun(消歧义;中文
   一~日 本就清晰不改)。
4. 图表卡与 Quick actions 卡 alignItems start→stretch,两卡等高、上下对齐。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 11:09:51 +08:00
wangjia 37258e1cb2 fix(client/test): 删未用变量修 flutter analyze(CI Flutter job 全绿)
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 24s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 33s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 28s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 10s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 24s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 12s
ci-pangolin / Go — build + test (pull_request) Successful in 7s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Successful in 8s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Successful in 4m33s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Successful in 18s
ci-pangolin / OpenAPI Sync Check (pull_request) Failing after 10m21s
ci-pangolin / Lint — shellcheck (pull_request) Failing after 10m33s
stats_device_filter_test.dart 的 const t = StringsZh() 声明后未使用 →
unused_local_variable warning → flutter analyze --no-fatal-infos exit 1 →
CI Flutter job 一直红(既存,与 i18n 修复无关)。删该变量 + 随之无用的
strings_zh import。

容器复验:analyze exit 0(0 warning)· test +97 过 · 覆盖率 38.5%≥28%。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 10:11:32 +08:00
wangjia 38be40a107 fix(client/ci): sing-box/wintun 境内镜像到 NAS(修 Windows 构建 GFW 失败)
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 25s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 22s
ci-pangolin / Lint — shellcheck (pull_request) Successful in 8s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 30s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 18s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 4s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 4s
ci-pangolin / Go — build + test (pull_request) Successful in 14s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Successful in 16s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Successful in 4m52s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Successful in 23s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Failing after 13m12s
根因:Windows CI 从 GitHub release 下 sing-box 压缩包被 GFW 限速超时(github.com
网页可达但 release 资产 CDN 被掐),build-windows 卡在 fetch-desktop-bin 早期。

修:
- 二进制镜像到 NAS Gitea generic 包(v1.13.12/sing-box-*-windows-amd64.zip +
  wintun-0.14.1.zip),上传前后均 sha256 校验。
- fetch-desktop-bin.sh 加 DESKTOP_BIN_MIRROR(+可选 _TOKEN):设了先试镜像、
  命中即用、未设/失败回退 GitHub/wintun.net;镜像文件照走现有 sha pin 校验(防
  投毒/损坏)。修一处 macOS bash3.2 空数组 set -u unbound 坑。
- deploy-client.yml build-windows env 指向 NAS 镜像基址 + 复用现有 FORGEJO_TOKEN
  secret(匿名 GET 也行,token 仅备将来私有)。无新 secret、无硬编码、无入库二进制。

回归(mac bash3.2):无 mirror 走 GitHub ✓ / mirror 走 NAS 命中 ✓ / bogus mirror
回退 ✓。Windows 端到端待下个 client-v* tag 触发 CI 观察。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 09:53:38 +08:00
wangjia 5b89de656e feat(web): 5 项 UI 修复 — 统一浅色/登录回跳/logo locale/用户名下拉/Docs 真页
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 25s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 7s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 26s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 11s
ci-pangolin / Go — build + test (pull_request) Successful in 15s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 26s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Successful in 10s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Successful in 4m36s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Successful in 20s
ci-pangolin / Lint — shellcheck (pull_request) Failing after 10m3s
Deploy Site / deploy-site (push) Failing after 13m20s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 14m42s
ci-pangolin / OpenAPI Sync Check (pull_request) Failing after 14m52s
用户中心:
- 统一浅色:theme.tsx 无偏好时不再跟随系统 prefers-color-scheme:dark(登录页变
  黑真因),恒浅色;保留手动切换。
- 登录回跳:UserCenter 加 safeRedirect 白名单,登录成功按 ?redirect= 回来源页
  (官网带 /,登录后回主页),无则进 overview。
- logo locale:新增 i18n brandName(zh 穿山甲/其余 Pangolin),Login/UserCenter
  /Subscription 三处引用。
- 存 pg_uc_email(getMe 时)/ clearSession 删,供官网读用户名。

官网(全走 CSS class 合 CSP,无内联 style):
- logo locale:i18n nav.brand(zh 穿山甲/其余 Pangolin),Header+Footer。
- 登录态头部显示用户名(读同源 pg_uc_email)+ 下拉菜单(进入用户中心/切换用户/
  退出登录,复用 .langmenu 风格);未登录 Log in 带 ?redirect=/ 回跳。
- Docs 四卡片补真内容页(en+zh:quickstart/faq/protocol/privacy + Doc.astro
  布局),卡片改回 <a href>;Protocol 改正 sing-box+REALITY(去 WireGuard)。

验证:同源闸绿 · 两端 build 过 · redline 0 · Header 零内联 style · 无 WireGuard。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
site-v0.0.13
2026-07-08 09:52:04 +08:00
wangjia f37f1f3b59 feat(web): 修语言下拉漂移(class 化)+ 主页登录态用户中心按钮 + 用户中心返回主页
ci-pangolin / Lint — shellcheck (pull_request) Successful in 10s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 29s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 32s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 21s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 24s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 21s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 10s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 8s
ci-pangolin / Go — build + test (pull_request) Successful in 10s
Deploy Site / deploy-site (push) Successful in 2m33s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m33s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Successful in 19s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 13m16s
#1 官网语言下拉漂移:根因=官网 CSP 无 unsafe-inline,Header.jsx 下拉全用内联
style= 被浏览器拦→菜单飘视口右边。修:搬进 website.css 的 .langwrap/.langsel
/.langmenu/.langmenu a(全走 var(--token),right:0 锚按钮下方,min-width 160
加宽),Header.jsx 删净内联 style。

#2 主页登录态右上角「用户中心」按钮:Header.jsx 读同源 localStorage
'pg_uc_refresh',有则 .linklogin 位显「用户中心」(→ /user/)、无则「Log in」。
i18n nav.center 6 语言。

#3 用户中心「返回主页」按钮:UserCenter.tsx 顶栏加 <a href="/">(home 图标),
i18n backHome 6 语言。

顺带堵同源闸漏洞:check-l1-sync ③ 原只匹配带引号图标键('refresh-cw'),漏了
裸标识符键(home),导致新加的 home 未被校验就通过。修解析器匹配裸键;并按
ds-flow 把 home 登记进 design/prototype/icons.js。同源闸复跑绿(裸键现全受检)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
site-v0.0.12
2026-07-08 09:16:13 +08:00
wangjia c9e266b89a fix(server+ci): 修 go-integration 真 bug + e2e 免疫代理(CI 收尾)
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 23s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 20s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 20s
ci-pangolin / Lint — shellcheck (pull_request) Successful in 7s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 33s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 16s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 4s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 5s
ci-pangolin / Go — build + test (pull_request) Successful in 8s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Successful in 8s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Successful in 4m33s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Successful in 19s
DinD 修复后暴露的两个 CI job,诊断:

Go integration(真 test-drift bug,早前会话改动遗留):
- auth/integration_test:Register/Login 补 ip + DeviceMeta 参数(sessions/
  device-meta 改动后陈旧调用,构建失败)。
- usage/usage_integration_test:手写测试 schema 补 ad_bonus_minutes 列
  (migration 000020 加的);重写 TestIntAdsUnlockAccumulates 断言对齐 ad-unlock
  转累加式(UnlockAd→AddAdBonusMinutes,不再 stamp ad_unlocked_at)。
- devices/devices_integration_test:套餐种子 pro=5→3(migration 000019 改的)。
- devices/context.go(生产 1 行):CtxKeyUserID 别名到 codes.CtxKeyUserID——原为
  独立 devices.ctxKey 类型,与 auth 注入的 codes.ctxKey 类型不同→context 取键
  失配(休眠 bug,中间件目前仅测试接线)。go build 通过。

E2E(环境问题,非脚本):删 ci.yml 里多余的 apt-get(openssl/curl/python3 已在
golang:1.25 镜像内;原 apt 走 Docker Desktop 代理→本机死口,徒增脆性)。脚本
本身本机直跑通过。

验证:go test -tags integration -count=1 -p 1 ./... 全 ok;go build ./... clean。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 09:04:10 +08:00
wangjia 0f05385995 fix(client/test): pin zh locale 修 i18n 默认英文后失配的单测/组件测试
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 28s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 37s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 22s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 13s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 29s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 8s
ci-pangolin / Go — build + test (pull_request) Successful in 14s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 9s
ci-pangolin / Lint — shellcheck (pull_request) Failing after 11m2s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 13m15s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 13m22s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 15m0s
早前 i18n 把默认语种改英文(localeProvider 默认 AppLang.en),但这几个测试硬编码
const t = StringsZh() 中文预期,被测代码经 appTextProvider 渲染英文 → 断言失配
(既存 broken,先于 ds-flow;DinD 修复后 Flutter test job 才跑到暴露)。

修:各失败测试的 ProviderScope/Container overrides 加
localeProvider.overrideWith((ref) => _FixedLocale(AppLang.zh)),把被测代码钉回
中文(与硬编码 StringsZh 预期一致)。只动测试文件,未碰 lib/golden/test_config。

- connection_watchdog_test(节点异常提示 / 免费额度归零切断)
- node_connect_confirm_test(点节点/智能卡弹确认取消不切换)
- stats_page_test(PeriodCard 周期卡中文标签)

容器复跑 test/unit+widget+contract:+97 All passed。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 08:41:52 +08:00
wangjia fc22300937 fix(ci): docker job 从 ubuntu-latest 容器移到 nas host(修 DinD 全红)
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 26s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 25s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 27s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 24s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 59s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 5s
ci-pangolin / Go — build + test (pull_request) Successful in 59s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 5s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m55s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Successful in 19s
ci-pangolin / OpenAPI Sync Check (pull_request) Failing after 13m37s
ci-pangolin / Lint — shellcheck (pull_request) Failing after 13m50s
根因:runs-on: ubuntu-latest 的 job 在 catthehacker 容器里跑,容器内嵌套
`docker run` = DinD,$PWD 在宿主不存在 → 挂载失败 → 所有套 docker 的 job 全红
(含 pre-existing 的 Codegen/Go/Flutter/Golden;纯 bash 的 redline/cleartext/
portable 不套 docker 故绿)。此前 server/site 部署 job 已因同因去 docker 直跑,
但 ci.yml 未跟进。

修:9 个套 docker 的 job(lint/openapi/flutter/codegen-drift/ds-flow/go-server/
e2e/go-integration/golden)runs-on 改 nas(host 模式=mac-pangolin-2 宿主直接跑,
docker run 是宿主真 docker 非嵌套,可正常拉跑镜像;本机已验证这些命令全绿)。
golden 保留 Linux flutter 容器 → 与入库基线渲染一致。3 个纯 bash 扫描留
ubuntu-latest(并行、已绿)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 02:58:14 +08:00
wangjia 4a0c5c4921 chore(todo): #19 ds-flow 前端治理转待验收
ci-pangolin / Lint — shellcheck (pull_request) Failing after 42s
ci-pangolin / OpenAPI Sync Check (pull_request) Failing after 36s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 16s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 15s
ci-pangolin / Flutter — analyze + test (pull_request) Failing after 3m35s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 22s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Failing after 24s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Failing after 24s
ci-pangolin / Go — build + test (pull_request) Failing after 1m18s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 27s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 19s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 28s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:45:18 +08:00
wangjia d2d75cd33c docs(ds-flow): Phase 5.6 — 前端全景文档 frontend-overview.html
docs/frontend-overview.html(照 jiu 十节裁剪):一次 UI 改动标准路径 · 目录地图 ·
三层真相源模型 · 令牌 codegen · 四道静态闸「违规谁拦」· 像素验收(golden 双主题
全绿含 CJK / fidelity 待建) · 响应式五端 · 规则速查 · 文档索引。登记进 docs/index.html。

同时标注两项延后(非阻塞,前置=原型整屏 HTML 属 L3 新屏工作):
- 4.4 mobile golden 覆盖扩容
- 5.5 fidelity 像素闸(原型无整屏可比,待 design/prototype/screens/ 落地)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:44:31 +08:00
wangjia a22db0874f feat(ds-flow): Phase 5.4 — pre-commit 增挂 ds-flow 条件闸
.githooks/pre-commit 在原有(红线/SQL/codegen-drift)基础上增挂三道 ds-flow 闸,
条件触发、秒级:
- 原型校验(check-ds):动了 design/prototype/ 才跑
- 跨端同源(check-l1-sync):动了 prototype/ 或 web/{website,usercenter}/ 才跑
- Flutter 颜色单源(check_ds_code --changed):动了 client/lib/*.dart 才跑(只扫改动)

install-hooks.sh 说明同步更新。启用仍是每台机一次性 `bash ci/install-hooks.sh`
(不代跑,改本机 git config;CLAUDE.md 治理章节已注明)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:42:27 +08:00
wangjia 29e225c63c feat(ds-flow): Phase 5.3 — CI 串联三道闸 + golden 扩全量
.gitea/workflows/ci.yml:
- 新增 ds-flow job:原型校验(check-ds)+ 跨端同源(check-l1-sync)+ Flutter
  颜色单源(check_ds_code --strict),均 node:20 容器零依赖跑。
- golden job 从「components+auth」扩到全量 test/golden(desktop/tablet 现均绿,
  含 CJK 真渲染 + tablet zh/en 矩阵)。
- codegen 零 diff(codegen-drift job)已有。

至此四道静态闸 + golden 全部进 CI 硬闸(「规则没上闸=没有规则」)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:41:10 +08:00
wangjia 14a9836882 feat(ds-flow): Phase 5.1-5.2 — Flutter 裸色闸 + 原型校验闸
5.1 client/tool/check_ds_code.mjs(照 jiu):禁 Flutter 业务代码裸 Color(0x)/
具名 Colors.x;豁免 token 生成层(pangolin_tokens.gen.dart)+ 实现层
(pangolin_theme.dart);--changed(pre-commit)/--strict(CI)/全量三模式;
剥行尾注释防误报。现状 --strict 通过(0 违规,UI 层零裸色)。

5.2 design/prototype/tools/check-ds.mjs:原型单源守门,5 道——硬编码色(仅严格
扫 atoms.css)/未定义 token/font-family 走 var(--font*)/图标走 icons.js sprite/
组件原子在 index.html 登记;剥 CSS+HTML 注释防误报,SVG fill/stroke 豁免。
现状通过(serve.mjs 改动时自动跑)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:39:44 +08:00
wangjia c4eb92fc2d feat(ds-flow): Phase 4.2/4.3/4.5 — CJK golden 字体 + timer 泄漏修复 + 基线重生成
4.5 harness/资源修复:UpdateNotifier 初始延迟由不可取消的 Future.delayed 改为
可取消 Timer,onDispose 一并取消——修 golden 整屏挂载时 pending-timer 泄漏
(生产也受益,provider dispose 不再悬挂 timer)。

4.2 CJK 测试字体:拷生产子集 NotoSansSC-Regular-subset.otf 进 test/fonts/ +
flutter_test_config 注册(family 'Noto Sans SC'),golden 中文真渲染不出豆腐块。

顺带修 tablet_pages_golden_test 既存编译错(6 语言改动遗留):localeProvider
override 返回值 AppLang → 改返回 LocaleNotifier 子类 _FixedLocale(钉死语言态)。

4.3 权威 Linux 容器(ghcr.io/cirruslabs/flutter)重生成全量 golden 基线:
34 tests All passed,32 张 PNG 更新(CJK 真字 + 暖阴影 + tablet zh/en 矩阵)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:27:09 +08:00
wangjia bb5acb6c1e feat(ds-flow): Phase 4.1 — 清 adaptive_menu 唯一裸 Material 色
adaptive_menu.dart shadowColor: Colors.black26(冷黑)→ PangolinColors.sand950
withValues(0.24)(暖近黑,对齐 §5 暖阴影铁律)。UI 层(widgets/screens/shell)
自此零裸 Material 色。flutter analyze 通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:11:11 +08:00
wangjia 39324c46a7 feat(ds-flow): Phase 3 — Web 硬编码色清零 + 原子台账收敛
「各自实现 + 同源闸」决策落地(不建跨端组件包):

- website.css 页脚恒暗区灰阶就近吸附主题无关 sand 原色阶(cfc6b8→sand-300、
  a89e8e→sand-400、8a8070→sand-500),消除 5 处硬编码。
- check-l1-sync 白名单加品牌 logo 色 f4efe8(Brand.astro 内联 SVG fill)。
- usercenter 13 处硬编码全为 #fff(白名单),已干净。
- CONTRACT.md 增「§6 ds-flow Web 原子清单 + 屏级三态台账」:公用原子两端映射表、
  图标三端⊆原型、L2 屏级三态(Flutter 快照/Web 代码先行/原子层同步)、硬编码白名单。

同源闸 4 道全绿(token 值 · 图标⊆原型 · Web 无硬编码色 · 幂等零 diff)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:09:16 +08:00
wangjia f69696daae feat(ds-flow): Phase 2 — Web token 同源闸 check-l1-sync.mjs
tools/check-l1-sync.mjs:L1 跨端同源闸(纯 Node 零依赖),4 道:
① website tokens.gen.css token 值 ≡ 原型 tokens.css(:root+dark)
② usercenter public/colors_and_type.css 同上
③ 三端图标 ⊆ 原型 icons.js sprite(usercenter LUCIDE 键+路径、Flutter
   _byName 键)
④ Web 硬编码色扫描(白名单 #fff/#000+品牌 logo 色,ds-allow 行内豁免,
   排除生成的 token 定义文件)

现状:①②③ 全过(Web token 与原型一致、Web token 幂等零 diff、图标已收敛);
补原型 icons.js 的 'chart' 别名(Flutter barChart 用,先登记原型)。
④ 余 6 处 website.css 页脚灰阶/Brand.astro 近白 —— Phase 3 清理 worklist。
CI 接线见 Phase 5。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 01:03:36 +08:00
wangjia 83fce75c8c docs(ds-flow): Phase 1.6-1.7 — ui_kits 标 DEPRECATED + 真源指针收敛
用户定:ui_kits 暂留(整屏布局尚无 HTML 替代,重建属 L3 不在本轮),标废弃
不删。

- design/CLAUDE.md:顶部加「真源对照」横幅(令牌→prototype/tokens.css、原子
  →atoms.css+index.html、图标→icons.js、Flutter→client/lib/widgets、Web→
  web/*;colors_and_type.css 降级别名、design/flutter 已删、ui_kits DEPRECATED、
  _ds_manifest/_ds_bundle 历史派生物);§6「修改设计系统时」重写为 ds-flow 流程。
- design/ui_kits/DEPRECATED.md:醒目废弃标记 + 真源指引 + 暂留理由。
- 1.7:确认无构建/CI 消费 _ds_manifest/_ds_bundle/_adherence,登记职责交
  index.html,旧工具产物标历史派生物(不删,无消费者)。

Phase 1(原型单源三件套)完成。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:59:26 +08:00
wangjia ad845328fb feat(ds-flow): Phase 1.5 — 原型活登记页 index.html
design/prototype/index.html:设计系统组件登记簿(照 jiu 骨架,light/dark 双主题)。
顶栏主题切换(持久化 localStorage)+ 左侧 dnav scrollspy 导航 + 分区:
① 色板(clay/sand 色阶 + 语义 token,data-swatches 声明式随主题刷新)
② 字号梯度(display-xl→caption,中英分行不并排)
③ 圆角/间距/阴影比例尺
④ 公用组件(atoms.css 每个 class 一张展示卡,全变体全态含 disabled)
⑤ 图标库(icons.js 全 57 图标网格)

链 tokens.css + atoms.css + icons.js(相对路径,自包含)。
验证:每个 atom 类均登记、57 图标全展示、主题切换正常、文案脱敏无红线词。
评审:node design/prototype/serve.mjs → http://localhost:5180/

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:16:47 +08:00
wangjia 6def3edaed feat(ds-flow): Phase 1.4 — 原型图标 SVG sprite 单源 icons.js
design/prototype/icons.js:57 个 Lucide 图标的 SVG sprite 单源(零依赖,注入
隐藏 <svg> + <symbol id="i-*">,用法 <svg class="ic"><use href="#i-power"/>)。

路径全部来自权威来源、零手写:35 个取自 usercenter icons.tsx 内联路径、
22 个从 web/website/node_modules/lucide-react 包提取。覆盖三处并集
(usercenter 全键 ∪ Flutter pangolin_icons.dart ∪ website lucide 用量);
别名(loader-circle/chart-no-axes-column/play-circle/more-vertical 等)已解析。

供 Phase 2 check-l1-sync ③「三端图标 ⊆ 原型 sprite」同源闸校验。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:10:57 +08:00
wangjia 56f673791e feat(ds-flow): Phase 1.3 — 原型公用组件原子层 atoms.css
design/prototype/atoms.css:把分散在 preview 规格 / usercenter shared.tsx /
website css / Flutter widgets 的组件样式沉淀成 canonical 原子类,只引
var(--token)。含 .btn(primary/ghost/subtle/danger + 尺寸)、.card、.input
/.field、.pill/.badge(success/warning/danger/neutral 状态 + accent/outline)、
.langsel/.menu(对齐刚统一的自控语言下拉)。

明暗双主题靠语义 token 自动适配,文件内无 [data-theme] 分支。
验证:零硬编码色;45 个 token 引用全部在 prototype/tokens.css 有定义。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:04:52 +08:00
wangjia 805bf8e2ca feat(ds-flow): Phase 1.1-1.2 — 原型单源目录 + tokens.css 迁为真源
- design/prototype/serve.mjs:零依赖热重载预览服务器(照搬 jiu,check-ds
  存在性守护,Phase 5 前静默跳过)
- design/prototype/tokens.css:token 真源(现结构已满足 ds-flow 的
  base :root + [data-theme=dark],字节迁移保证 codegen 零 diff)
- design/colors_and_type.css:退化为薄 @import 别名(供历史 preview/*.html
  浏览器内引用;codegen 不再读它)
- 三个 codegen(Flutter gen_flutter_tokens / website+usercenter build-tokens)
  + drift 检查全部重指向 prototype/tokens.css
- 生成产物 diff 仅头注释源路径行,token 数值零变化(已验证)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 00:00:38 +08:00
wangjia 3311430db6 docs(ds-flow): Phase 0 — CLAUDE.md 增前端设计系统治理章节
新增「## 前端设计系统治理(ds-flow)」:心智模型(原型单源·代码镜像·静态闸
拦漂移·golden/fidelity 双级验收)、原型三件套(design/prototype/ tokens/atoms/
icons/index.html)、L1/L2/L3 三层治理、codegen(Flutter 生成 + Web 同源不重复
生成)、四道静态闸「违规谁拦」对照表、双级像素验收、pre-commit 启用说明。

 标注部件为 Phase 1-5 建设中,诚实反映当前落地状态,指向计划 #19。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 23:56:15 +08:00
wangjia 4d274aad7a docs(plan): 前端设计系统治理重构(ds-flow 全端)实现计划
用 ds-flow 把 Flutter 五端 + 官网 + 用户中心收口到「设计单源·代码镜像·
静态闸拦漂移·golden/fidelity 双级像素验收兜底」。

摸底结论:pangolin 非从零 bootstrap,已约 65% 达标(token 单源含暗色、
Flutter codegen+drift 闸、golden+CI 闸、pre-commit 写好未启用)。本计划是
补缺口 + Web 共享原子层去重,非推倒重来。主题保持 light/dark。

6 阶段:CLAUDE.md → 原型三件套(atoms/icons/index.html,收敛 ui_kits) →
Web token 同源闸 → Web 原子层去重(各自实现+同源闸) → Flutter 收尾+golden
补齐 → 静态闸挂满+启用 pre-commit+fidelity 体检。

真相源(含 checkbox)+ HTML 阅读版 + 登记 docs/index.html;todo #19 tier-1。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 23:41:50 +08:00
wangjia 84448b3064 fix(server/cors): 放行 X-Refresh-Token 头(修用户中心刷新掉线)
Deploy Server / deploy-server (push) Successful in 3m3s
用户中心用 header token 方案:access token 只存内存、refresh token 存
localStorage,页面刷新后靠 POST /v1/auth/refresh 带 X-Refresh-Token 头静默续期
(web/usercenter/lib/api/http.ts)。

但 CORS Allow-Headers 只放行 Content-Type/Authorization,浏览器预检发现
X-Refresh-Token 不在白名单 → 拦截真正的 refresh 请求 → api.refresh() 抛网络错
→ setAuthed(false) → 甩回登录页。表现:登录能成功(不带该头),但一刷新就掉线,
用量/续费等需登录态的页面全打不开。

修:Allow-Headers 加 X-Refresh-Token。加回归断言(cors_test)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
server-v1.0.6
2026-07-07 23:03:39 +08:00
wangjia 386e0bce90 fix(web): 语言下拉换自定义菜单(原生 select 弹层被系统定位/漂移)
Deploy Site / deploy-site (push) Successful in 4m31s
原生 <select> 的选项弹层由 OS 定位(macOS 锚在选中项上、整体偏移=漂移),CSS 控
不了。改成自控下拉:按钮(复用药丸样式)+ 绝对定位菜单(top:100%,right:0)+ 点外/
Esc 关闭 + 选中高亮。用户中心 LangSeg 与官网 Header 同款;官网选项用 <a href> 导航
(SEO 友好)、用户中心用 setLang。两端 build 通过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
site-v0.0.10
2026-07-07 22:42:00 +08:00
wangjia b584188ce2 fix(ci/site): 用 ! Content-Security-Policy 删官网 CSP(CF _headers 叠加,浏览器取交集)
Deploy Site / deploy-site (push) Successful in 4m36s
上一版判断错了:CF Pages _headers 不是'首个匹配生效',而是【叠加下发】——/* 和
/user/* 都匹配 /user/,两条 CSP 都发,浏览器对多条 CSP 取交集(最严)→ 官网严格
CSP 的 style-src(无 unsafe-inline)/connect-src('self')赢,用户中心内联样式被拦、
连 API 被拦 → 裸奔 + 登录失败。正解:/user/* 里  先删掉
/* 继承的官网 CSP,再设用户中心自己的(排 /* 之后,先加后删)。其余安全头沿用 /*。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
site-v0.0.9
2026-07-07 22:25:36 +08:00
wangjia 60cd28e085 fix(ci/site): _headers 里 /user/* 须排在 /* 之前(CF 首个匹配 header 生效)
Deploy Site / deploy-site (push) Successful in 4m3s
用户中心 /user/ 页裸奔根因:CF Pages _headers 对同一 header 取【首个匹配规则】值,
而 combine-site 原把 /user/* 追加在官网 /* 之后 → /user/ 命中在前的官网严格 CSP
(style-src 无 unsafe-inline),用户中心的大量内联样式被拦、连 API 的 connect-src
也被收窄 → 样式全丢。改为把 /user/* 规则前置到官网 /* 之前,用户中心 CSP 才生效。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
site-v0.0.8
2026-07-07 21:56:29 +08:00
wangjia 11ca7531a3 ci: flutter build 前显式 pub get + 重试(防 pub.flutter-io.cn 被 GFW 抖断)
Deploy Client / build-android (push) Successful in 1m46s
Deploy Client / build-windows (push) Successful in 1m55s
Deploy Client / build-macos (push) Successful in 3m40s
Deploy Client / build-ios (push) Successful in 3m28s
Deploy Client / release-deploy (push) Successful in 2m14s
iOS build 曾因 flutter build 内隐式 pub get 拉 google_fonts 时 pub.flutter-io.cn
socket error(exit 69)而失败。_env.sh 加 flutter_pub_get_retry(5 次重试),四个
compile 脚本在 flutter build 前显式预取,成功后 build 命中缓存不再拉网,减少偶发
网络失败。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
client-v1.0.66
2026-07-07 20:25:01 +08:00
wangjia e6b4ec0459 fix(ci/client): mac 端 job runs-on mac→nas(匹配实际 runner label)
Deploy Client / build-windows (push) Successful in 1m52s
Deploy Client / build-android (push) Successful in 2m4s
Deploy Client / build-macos (push) Successful in 3m38s
Deploy Client / build-ios (push) Failing after 1m57s
Deploy Client / release-deploy (push) Successful in 2m0s
mac runner(mac-pangolin-2)启动脚本注册 label 为 nas:host;此前靠手动加的 mac
label 让 runs-on:mac 命中,但 runner 重启(经启动脚本)会重注册成 nas、丢掉 mac
label → build-android/macos/ios/release-deploy 无 runner 可接、永久排队。改成
runs-on:nas 匹配实际 label,抗重启漂移(nas runner 即这台 mac,唯一)。windows
job 仍 runs-on:windows(windows runner)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
client-v1.0.65
2026-07-07 20:07:16 +08:00
wangjia 0b86138b55 feat(client/update): 更新提示改 jiu 式顶部横条(非强制不再弹窗)
Deploy Client / build-windows (push) Successful in 1m47s
Deploy Client / build-android (push) Has been cancelled
Deploy Client / build-macos (push) Has been cancelled
Deploy Client / build-ios (push) Has been cancelled
Deploy Client / release-deploy (push) Has been cancelled
按需求去掉居中弹窗,改成不打断的顶部 banner(对照 jiu 黄条):
- 非强制更新 → home_shell 顶部 UpdateBanner「发现新版本 vX + 立即更新 + ×」;
  「立即更新」App 内下载安装,「×」忽略此版本(banner 隐藏,更新版本会重现)
- 强制更新(force_update)→ 仍走不可关闭弹窗 showUpdateDialog
- 忽略状态改 dismissedUpdateVersionProvider(按版本号,响应式);去掉 notifier
  的 _dismissed
- 设置页「检查更新」有更新时:清忽略版本→banner 显示 + toast,不再弹窗
- 新增 6 语「立即更新」文案。flutter analyze 仅 2 个既有 withOpacity info

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
client-v1.0.64
2026-07-07 19:19:05 +08:00
wangjia aaffe85a4f fix(ci/windows): 同步 Flutter app 版本到 tag(原卡在 pubspec 1.0.48)
compile-windows 此前只 sed Inno 安装器 MyAppVersion,没改 Flutter pubspec 版本,
导致 Windows 包内 package_info 永远是 committed 的 1.0.48 → 设置页显示旧版 +
自动更新永远判"有新版"。补上 build number 计算 + sed 复制后的 pubspec.yaml
(GNU sed,windows runner),与 android/macos 对齐。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
2026-07-07 19:05:31 +08:00
wangjia 4940278ea5 feat(migrate): 用户中心迁到 pangolin.yanmeiai.com/user/ + 域名配置化
Deploy Server / deploy-server (push) Successful in 2m55s
Deploy Site / deploy-site (push) Successful in 2m41s
Deploy Client / build-windows (push) Successful in 1m47s
Deploy Client / build-android (push) Successful in 7m39s
Deploy Client / build-macos (push) Successful in 3m40s
Deploy Client / build-ios (push) Successful in 4m48s
Deploy Client / release-deploy (push) Successful in 2m25s
原独立子域 app.yanmeiai.com → 主站子路径 /user/(用户选停用旧域名):
- 域名配置化(去硬编码):客户端 kWebUserCenterBaseUrl 收进 api_config.dart
  (dart-define 可覆盖);官网 site.ts、服务端 CORS_ORIGINS 本就是配置
- 用户中心 next.config basePath=/user;layout.tsx 的 /colors_and_type.css 手动
  拼 basePath(public 根绝对资源不自动加前缀,否则 404)
- CI 合并部署:compile-site + compile-usercenter + combine-site(用户中心并入
  dist/user/ + _headers 按 /user/* 分域:官网严格 CSP,用户中心 unsafe-inline+
  connect-src https)→ 单次部署 pangolin-site;删独立 pangolin-usercenter 部署
- 服务端 CORS 默认 origin app.yanmeiai.com → pangolin.yanmeiai.com(+ 测试)
- 客户端 web_launch 走新址 → 随 client-v1.0.62;go test CORS 过、flutter analyze 净

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
server-v1.0.5 site-v0.0.7 client-v1.0.62 client-v1.0.63
2026-07-07 17:33:22 +08:00