Files
zijunchiang 87aa979abd 合并自建歌曲源支线(selfhost-source)+ 版本号按约定修正为 1.6.0
版本号:
- 1.5.11 越界(规则 3 规定 patch ≤ 10)→ 修正为 1.6.0(进位到 minor、patch 归 0)
- versionCode 43 不变:43 从未对外发布,本次修正只是把命名拉回约定

合并支线(原在工作区根目录、App 仓库之外,DESIGN.md 自称"支线"):
- selfhost-source/server/   自建歌曲源服务器(纯 Python 标准库、零 pip 依赖)
- selfhost-source/deploy/、DESIGN.md、LIBRARY.md、build_inventory.py
- selfhost-source/inventory/ 小清单(playlists.csv、song-stats.md 等)
- ⚠️ inventory 生成物(songs-*.csv / singers-top.csv,共 84MB)不入库,
  已写入 .gitignore;需要时用 build_inventory.py 依据 muse.db 重新生成

同时入库的 App 侧支线改动(此前为工作树未提交状态):
- Whoami.kt(whoami 设备心跳)、DeviceIdentity.kt(设备身份伪装)
- PushDownload.kt / PushDownloadClient.kt(点歌推送)
- AdVideoFilter 带 query/fragment 的地址闸门;KTV_BRIDGE_API 11 → 13
- 修 ktv_api.js 的 global.KtvBridgeApiVersion(12 → 13,与注释及 Kotlin 两处校验一致)
- 对应单测:WhoamiTest / DeviceIdentityTest / PushDownloadTest / AdVideoFilterTest(共 39 例)

文档:
- DESIGN.md 的"在 App 仓库之外"约定改为"已并入仓库统一版本化"
- AGENTS.md 版本号行更新为 1.6.0/43,并新增支线并入说明

验证:assembleRelease + testReleaseUnitTest 全过(39 例)
2026-10-14 02:06:28 +08:00

33 lines
1.4 KiB
Plaintext
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.
# 可选:把媒体分发交给 nginx(吞吐更高、支持断点续传与限速)
# 用法:把本文件放到 /etc/nginx/sites-available/ktv-media 并 ln -s 到 sites-enabled,
# 同时把 server-config.json 的 public_media_base 指向 nginx 的域名/端口。
#
# ⚠️ App 只接受**域名**形式的媒体地址,且路径必须以 /<编号>.ts 结尾 —— 保持 location 不变。
# ⚠️ 不要让 nginx 返回 403 来表达"文件不存在"(App 会当成源站风控):
# 这里用 try_files 落到 404。
server {
listen 6677;
server_name ktv.example.com; # 换成你的域名
# 媒体:Range/206、缓存、限速(保护店内带宽)
location /media/ {
alias /var/lib/ktv-source/media/;
try_files $uri =404; # 不存在 → 404(不是 403)
add_header Accept-Ranges bytes always;
add_header Cache-Control "public, max-age=86400" always;
sendfile on;
tcp_nopush on;
# limit_rate 8m; # 需要时打开:单连接限速 8MB/s
# limit_conn perip 4; # 单 IP 并发连接限制
}
# App 接口仍由 Python 服务处理
location / {
proxy_pass http://127.0.0.1:6687; # 把 Python 的服务端口改到 6687(避免与自己冲突),对外仍是 6677
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 60s;
}
}