Commit Graph

17 Commits

Author SHA1 Message Date
Fam Zheng 857c0d5481 llm-proxy(app): gemma 反向代理 + token 鉴权 + /chat web UI
deploy articulate / build-and-deploy (push) Successful in 1m29s
deploy cube / build-and-deploy (push) Successful in 1m49s
deploy karaoke / build-and-deploy (push) Successful in 1m18s
deploy llm-proxy / build-and-deploy (push) Successful in 2m41s
deploy music / build-and-deploy (push) Successful in 3m6s
deploy notes / build-and-deploy (push) Successful in 2m40s
deploy simpleasm / build-and-deploy (push) Successful in 2m5s
deploy werewolf / build-and-deploy (push) Successful in 1m41s
新 service,ns `llm-proxy`,域 `llm.famzheng.me`。
- POST /v1/chat/completions — OpenAI 兼容透传到 mochi 同款 backend
  gateway (gemma-4-31b-it);一期强制 stream=false,SSE 留二期
- 鉴权: `Authorization: token <PROXY_AUTH_TOKEN>` 或同款 Bearer;
  常时间比较防 timing;空 expected 一律拒
- GET /chat — 自带极简 HTML chat UI(token 走 localStorage,
  附 curl example details);/ 跳转到 /chat
- Secrets `llm-proxy/proxy-credentials` 已 kubectl 手工创建:
  BACKEND_TOKEN (上游) + PROXY_AUTH_TOKEN (对外)
- 13 个 cargo test 覆盖 auth 多个 scheme / 边界 + body
  改写 (stream=false 强制注入)
2026-05-18 00:21:47 +01:00
Fam Zheng 68671784f6 notes: 加一键转飞书文档 (sidecar markdown-to-feishu)
deploy notes / build-and-deploy (push) Failing after 2m2s
- backend: POST /api/recordings/:id/feishu → 拼 markdown (总结在最上 + 附件链接到转录/录音 + 转写全文) → 写 /data/feishu-tmp/<id>/ → HTTP POST 到 feishu sidecar
- 复用:已有 feishu_doc_id 时 --update 同一个 doc,前端按钮文案变「↻ 重新生成」
- schema 加 feishu_doc_id + feishu_url 两列(ALTER TABLE 兼容旧 db)
- LLM prompt 改:行动项用 markdown checkbox `- [ ] 谁·做什么·何时`
- sidecar apps/notes/feishu: node:20 + python3 + python3-markdown + @larksuite/cli + COPY 自己的 markdown-to-feishu script + FastAPI /convert
- k8s: deployment 加 feishu container 共享 PVC;lark-cli-creds Secret 挂 /root/.lark-cli/config.json
- CI: 主 image --no-cache(cube 规矩),sidecar 保留 layer cache(chromium-free,但 apt/npm 也大)
- 前端: content 头部加「📤 一键转飞书文档」按钮;已转过显示飞书链接 + 按钮变重生成
2026-05-17 22:16:13 +01:00
Fam Zheng 61abd3f560 notes: 新建 notes.famzheng.me — 录音 → ASR → LLM 会议纪要
deploy articulate / build-and-deploy (push) Successful in 1m21s
deploy cube / build-and-deploy (push) Successful in 1m44s
deploy karaoke / build-and-deploy (push) Successful in 1m13s
deploy music / build-and-deploy (push) Successful in 2m23s
deploy notes / build-and-deploy (push) Successful in 2m16s
deploy simpleasm / build-and-deploy (push) Successful in 1m44s
deploy werewolf / build-and-deploy (push) Successful in 1m7s
- 后端 axum + sqlite (recordings 表):上传 multipart 流式落 PVC;spawn worker pending → transcribing (调 mochi 那边 ASR endpoint, fireredasr2 token, Whisper-style multipart) → summarizing (调 gemma-4-31b-it OpenAI 兼容接口) → done
- 鉴权 middleware:Authorization: token <PASSPHRASE>;audio 流播放 ?token= query 兜底;passphrase 走 k8s Secret 不写死
- 前端 Vue3:首次访问弹 passphrase modal;sidebar 录音列表(带状态 chip)+ content 选中显示音频 + 转写 + markdown 纪要;5s polling 进度
- k8s manifest: ns cube-notes / PVC 30Gi / Ingress notes.famzheng.me / bodylimit 600M;Secret notes-creds = {passphrase, asr_token, llm_token}
- portal apps.ts 加 notes entry
2026-05-17 21:43:44 +01:00
Fam Zheng cdbf8308d1 music(player): 变速播放 + AB Loop
deploy articulate / build-and-deploy (push) Failing after 1m42s
deploy cube / build-and-deploy (push) Successful in 2m5s
deploy karaoke / build-and-deploy (push) Failing after 2m2s
deploy simpleasm / build-and-deploy (push) Successful in 2m21s
deploy music / build-and-deploy (push) Successful in 4m2s
deploy werewolf / build-and-deploy (push) Failing after 58s
- 变速:底部 1× 圆形按钮循环切 0.5/0.75/1/1.25/1.5;preservesPitch=true(浏览器 native 保音高);localStorage 持久化全局
- AB Loop:A B 两按钮在当前位置打点,🔁 开关;进度条上绿色高亮 A↔B 区段;timeupdate 触发 ≥B 跳回 A;切歌自动清 A/B
2026-05-10 21:40:19 +01:00
Fam Zheng 9ce3b66810 ci(music): docker build --no-cache 主 image,根治 binary stale
deploy music / build-and-deploy (push) Successful in 1m44s
之前 cargo build 有跑出新 musl binary 但 docker build 时
'Step 2/5 : COPY target/.../music — Using cache' 命中旧 layer,
把历史 binary 套进新 sha tag 的 image。结果 main.rs 改动悄悄丢失。

回退之前迂回的 cargo clean -p / rm binary(治不到 docker 那层),
直接给主 image 加 --no-cache。chord-fetcher 那个 sidecar 保留 cache(chromium apt 拉一次 200MB+,每次重 build 太慢)。
2026-05-10 15:23:37 +01:00
Fam Zheng 9640abe102 ci(music): cargo clean -p 强制每次 link,act_runner workdir 复用导致 main.rs 改动不生效
deploy music / build-and-deploy (push) Successful in 1m46s
2026-05-10 15:18:16 +01:00
Fam Zheng e111398157 music(chord): 加 yopu.co 吉他谱自动抓取(sidecar 模式)
deploy cube / build-and-deploy (push) Successful in 1m15s
deploy simpleasm / build-and-deploy (push) Successful in 1m19s
deploy music / build-and-deploy (push) Successful in 4m38s
复刻 ../guitar 的功能:
- 新加 chord-fetcher sidecar(python 3.11 + chromium + selenium),跟 main 同 pod 共享 PVC
- yopu.py v2:搜「和弦谱」→ 进 view → 选 谱面样式=功能谱 + 和弦样式=级数名 → 截 sheet-container → PIL 裁白边
- music backend 加 POST /api/pieces/:id/chord/fetch + GET /chord/status,转发 sidecar 并把 png import 成 image attachment role=chord
- 前端 chord tab 在没图时显示「自动抓取」按钮,点了 polling 状态、完成后刷新
- CI build 两个 image(music + music-chord),rollout 同步切版本
2026-05-09 22:52:09 +01:00
Fam Zheng 1a8f297302 music: 新建 music app,替换 piano-sheet
deploy cube / build-and-deploy (push) Successful in 1m10s
deploy music / build-and-deploy (push) Successful in 1m47s
deploy simpleasm / build-and-deploy (push) Successful in 1m20s
听歌 + 练琴曲目管理:
- 数据:piece (title/artist/category/lyrics/play_count/notes) + attachments (audio/video/pdf/image; image 带 role=chord/numbered/staff)
- 后端 axum + sqlite,附件流式落 PVC,ServeFile 支持 Range(视频拖动)
- 前端 guitar 风格 player:左 sidebar + tabs(歌词/吉他谱/简谱/五线谱/PDF/视频),LRC 同步、快捷键、笔记自动保存
- ns cube-music + music.famzheng.me + bodylimit 5GiB
- scripts/import_guitar.py 用于把 oci /data/guitar/ 旧曲库导入
2026-05-09 22:36:14 +01:00
Fam Zheng 1e04655003 ci: 统一 k8s manifest 为 apps/*/k8s/all.yaml
deploy cube / build-and-deploy (push) Successful in 1m11s
deploy piano-sheet / build-and-deploy (push) Successful in 1m44s
deploy simpleasm / build-and-deploy (push) Successful in 1m22s
- 三个 app 的 5 个独立 yaml 合成单文件 all.yaml,多 doc 内显式排序,apply 不再受目录字母序影响(这是 piano-sheet run #49 NotFound 的根因)
- simpleasm/cube workflow 补 Initialize K8s resources 步骤,跟 piano-sheet 对齐;今后 manifest 改动 CI 自动 apply
- cube 的 _registry-ingress.yaml 不再需要前缀绕排序,去掉 _
2026-05-05 10:38:38 +01:00
Fam Zheng 538bbb7ecd piano-sheet: ns cube-piano-sheet → cube-piano
ns 跟 app 名解耦,workflow 加 NS env 不再 cube-$APP 拼。
2026-05-05 10:03:38 +01:00
Fam Zheng 09c3236b5b ci(piano-sheet): apply k8s manifests before rollout
CI 第一次跑时 ns / PVC / svc / ingress 还不存在,直接 set image
会失败。加一步 kubectl apply -f apps/piano-sheet/k8s/,让 ns +
PVC + deployment + service + ingress + middleware 都先就位,再
做镜像 set + rollout status。
2026-05-05 09:57:04 +01:00
Fam Zheng 28713e489f app #2 piano-sheet: 钢琴谱管理 / 阅读,piano.famzheng.me
deploy cube / build-and-deploy (push) Successful in 1m8s
deploy piano-sheet / build-and-deploy (push) Failing after 1m38s
deploy simpleasm / build-and-deploy (push) Successful in 1m22s
后端 axum + sqlite,图片直接 BLOB 存进 pages 表(单张 ≤ 10MB / 单
谱 ≤ 64 页),5 个 endpoint:multipart upload、列表、详情、单页图片
(带 immutable cache header)+ healthz。

前端 vue3 + pinia + vue-router,3 个视图:列表(卡片网格 + 首页缩
略)、上传(拖拽 + 顺序预览)、阅读(全屏,左右点按 / 键盘 / 拖
拽进度条翻页,2.5s 自动隐藏 chrome)。视图状态走 URL(reader 的
当前页是 ?page=N)。

部署:cube-piano-sheet ns + 10Gi PVC + traefik ingress + 一条
buffering middleware 把 body 上限抬到 700MB。镜像 < 20MB(scratch
+ musl 静态)。
2026-05-05 09:29:02 +01:00
Fam Zheng 388b505e0b app #1 simpleasm: 从 oci 迁过来,asm.famzheng.me 已上线
deploy cube / build-and-deploy (push) Successful in 1m18s
deploy simpleasm / build-and-deploy (push) Successful in 1m45s
- 后端 FastAPI 重写为 axum + rusqlite (musl static, 2.8MB)
- 前端原样搬运 (Vue3 + Vite + Pinia + vue-router + vite-plugin-yaml)
- k8s: cube-simpleasm ns + 1Gi PVC (k3s local-path) + Recreate strategy
- CI: 复刻 deploy-cube.yml,按 apps/simpleasm/** 触发
- cube 门户里 simpleasm 状态从 pending 改成 live
- 数据冷启 (Fam 拍板不带历史进度)
2026-05-04 15:12:22 +01:00
Fam Zheng 5ee0b7880c ci: 移除 debug step,CI 已通
deploy cube / build-and-deploy (push) Successful in 47s
2026-05-04 11:36:09 +01:00
Fam Zheng a263f57f69 ci: 临时加 debug step 排查 docker permission
deploy cube / build-and-deploy (push) Successful in 47s
2026-05-04 11:34:14 +01:00
Fam Zheng 3dec5fac69 ci: runs-on ubuntu-latest(不带 :host 后缀)
deploy cube / build-and-deploy (push) Failing after 4s
act_runner 注册时只把 label 名发给 gitea('ubuntu-latest'),
':host' 后缀只在 runner 自己的 config.yaml 里用来选 executor。
workflow 用 'ubuntu-latest:host' 会一直 queued。
2026-05-04 11:26:06 +01:00
Fam Zheng 93b6fa3061 app #0: cube.famzheng.me 入口门户 + 平台脚手架
deploy cube / build-and-deploy (push) Has been cancelled
monorepo 第一刀:
- workspace + crates/cube-core(base router / healthz / ServeDir SPA fallback / JSON tracing / SIGTERM shutdown)
- apps/cube:axum 主程序 + Vite + Vue 3 + TS 门户(暗色调 + 渐变 logo + app 卡片网格)
- Dockerfile:scratch + musl 静态二进制,镜像 2.6MB
- k8s/:cube-cube ns + Deployment + Service + Ingress(cube.famzheng.me,traefik LE 自动签)
- registry:新增 registry.famzheng.me ingress 反代到 gitea 内置 container registry,
  自动化身份用 mochi(registry.famzheng.me/mochi/cube)
- CI:.gitea/workflows/deploy-cube.yml,host shell runner(gnoc),
  build → push → kubectl rollout 五步流水
- README:把宪法段改成 monorepo 模式 + monorepo 目录结构
- 新增宪法条款:前端视图状态走 URL(path + query)保证可 bookmark
2026-05-04 11:22:59 +01:00