feat: professionalize control plane and standalone delivery

This commit is contained in:
theshy
2026-04-07 10:46:30 +08:00
parent d0cf1fd0df
commit 862db502b0
100 changed files with 8313 additions and 1483 deletions

View File

@ -1,12 +1,12 @@
# biliup-next
`biliup-next`当前项目的并行重构版本
`biliup-next` 是当前仓库内独立运行的新流水线实现
目标:
- 不破坏旧项目运行
- 先完成控制面和核心模型
- 再逐步迁移转录、识歌、切歌、上传、评论、合集模块
- 使用单 worker + 状态机替代旧 watcher 流程
- 提供独立控制面、配置系统和隔离 workspace
- `biliup-next` 内独立运行完整主链路
## Current Scope
@ -43,24 +43,30 @@ bash setup.sh
- 创建 `biliup-next/.venv`
- `pip install -e .`
- 缺失时自动生成 standalone `settings.json`
- 初始化隔离 workspace
- 尝试把父项目中的 `cookies.json` / `upload_config.json` / `biliup` 同步到 `biliup-next/runtime/`
- 缺失时自动生成 runtime 模板文件
- 校验 `runtime/` 中的本地运行资产
- 执行一次 `doctor`
- 可选安装 `systemd` 服务
新机器冷启动步骤见:
- `docs/cold-start-checklist.md`
浏览器访问:
```text
http://127.0.0.1:8787/
```
React 迁移版控制台未来入口:
控制台保留入口:
```text
http://127.0.0.1:8787/ui/
http://127.0.0.1:8787/classic
```
`frontend/dist/` 存在时Python API 会自动托管这套前端;旧控制台 `/` 仍然保留
`frontend/dist/` 存在时Python API 会自动把 React 控制台托管为默认首页 `/`;旧控制台保留在 `/classic`
控制台当前支持:
@ -120,6 +126,7 @@ cd /home/theshy/biliup/biliup-next
```bash
cd /home/theshy/biliup/biliup-next
bash smoke-test.sh
bash cold-start-smoke.sh
```
## Runtime
@ -131,14 +138,25 @@ bash smoke-test.sh
- `session/`
- `biliup_next.db`
外部依赖目前仍复用旧项目中的
运行资产默认都位于 `biliup-next/runtime/`
- `../cookies.json`
- `../upload_config.json`
- `../biliup`
- `../.env` 中的 `CODEX_CMD` / `FFMPEG_BIN` / `FFPROBE_BIN`
- `runtime/cookies.json`
- `runtime/upload_config.json`
- `runtime/biliup`
- `runtime/logs/api.log`
- `runtime/logs/worker.log`
如果你希望进一步脱离父项目,可以执行:
`run-api.sh``run-worker.sh` 现在会自动把 stdout/stderr 追加写入对应日志文件,同时保留终端输出;控制台 `Logs` 页会直接读取这些日志文件。
默认日志轮转策略:
- 单文件上限 `20 MiB`
- 保留最近 `5` 个历史文件
- 可通过环境变量覆盖:
- `BILIUP_NEXT_LOG_MAX_BYTES`
- `BILIUP_NEXT_LOG_BACKUPS`
如果你要把当前机器上已有版本复制到本地 runtime可以执行
```bash
cd /home/theshy/biliup/biliup-next
@ -171,6 +189,28 @@ cd /home/theshy/biliup/biliup-next
只有在任务进入 `collection_synced` 后,才会按配置执行清理。
## Full Video BV Input
完整版 `BV` 目前支持 3 种来源:
- `stage/*.meta.json` 中的 `full_video_bvid`
- 前端 / API 手工绑定
- webhook`POST /webhooks/full-video-uploaded`
推荐 webhook 负载:
```json
{
"session_key": "王海颖:20260402T2203",
"source_title": "王海颖唱歌录播 04月02日 22时03分",
"streamer": "王海颖",
"room_id": "581192190066",
"full_video_bvid": "BV1uH9wBsELC"
}
```
如果 webhook 先于片段 ingest 到达,`biliup-next` 会先把它持久化;后续同 `session_key``source_title` 的任务进入时会自动继承该 `BV`
## Security
控制台支持可选 token 保护: