Files
Codex 3c70861463
Build image / build (push) Canceled after 0s
Build ASR Pipeline / image (push) Canceled after 0s
feat(asr-pipeline): merge PR #1 webauth/CSRF/locking hardening and web_password fallback
2026-11-02 06:37:33 -08:00

59 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 录音上传与审核工作台
## 入口
- Web:`http://192.168.50.145:8765/`
- 健康检查:`GET /health`
- 最近任务:`GET /api/jobs`
- 人工确认:`GET /review/`
服务只面向 LAN 与 tailnet,没有实现公网身份认证。未来暴露到公网时,应在反向代理层
增加认证、上传大小限制和请求速率限制,不要直接转发当前端口。
## 工作流
1. 浏览器把录音以原始二进制流上传到隐藏临时目录。
2. 文件完整写入并 `fsync` 后,原子移动到 `recordings/inbox/`。
3. 既有 `obsidian-recording-watch.service` 接管转写、CAM++ 分角色和声纹识别。
4. 转写落入 `.asr-inbox/`,独立整理程序生成私有草稿。
5. Telegram 发送确认链接;Web 回答写入 SQLite。
6. 全部确认后生成正式纪要并写入 Obsidian。
上传时填写的背景单独保存在任务元数据中,进入整理提示时会标为“用户提供的背景”,
不会混入或伪装成 ASR 转写内容。
## Hook
`POST /hook/intake` 与 Web 上传使用相同的流式协议,便于以后在外网部署一个很薄的上传
前端或反向代理:
```bash
curl --fail-with-body \
-X POST \
-H 'Content-Type: application/octet-stream' \
-H 'X-Filename: call.m4a' \
-H 'X-Title: 项目通话' \
-H 'X-Context: 参与人、项目和希望重点确认的事项' \
--data-binary @call.m4a \
http://192.168.50.145:8765/hook/intake
```
响应中的 `job_id` 是任务标识。状态可从 `/api/jobs` 查询。
## 运行
```bash
systemctl --user status asr-review-web.service
systemctl --user restart asr-review-web.service
journalctl --user -u asr-review-web.service -n 100 --no-pager
curl -fsS http://127.0.0.1:8765/health
```
持久数据:
- `asr-pipeline/state/intake.db`:上传任务与状态。
- `recordings/state/uploads/`:上传标题、背景和任务关联。
- `recordings/inbox/.uploading/`:未完成上传;正常完成后为空。
默认单文件上限为 4 GiB,可通过 `ASR_UPLOAD_MAX_BYTES` 调整。