add account localization and switchable rooms

Centralize control and OBS copy in a shared TOML catalog, persist the selected locale per account, and broadcast language changes to component streams. Allow account owners to atomically switch their Bilibili room and restart the shared listener without changing component URLs.
This commit is contained in:
2026-07-18 23:28:05 -07:00
parent 53ae90ec13
commit f79852d8e6
35 changed files with 1946 additions and 472 deletions
+2
View File
@@ -8,7 +8,9 @@ token。以下规则是实现约束,而不是可选部署建议。
- HTTP handler 只从服务端会话解析 `owner_id`,不接受客户端声明的 owner。
- 组件查询始终限定 `owner_user_id`;组件表不保存直播源外键。
- 直播间、直播源和 CookieCloud 凭据分别以账户 ID 建立唯一约束与 RLS 边界。
- 用户切换直播间时,账户房间、直播源房间与加密 CookieCloud 凭据在同一事务中更新;目标房间仍保持账户间唯一。
- 数据库使用 owner 复合外键、RLS 和 `FORCE ROW LEVEL SECURITY`。
- 语言偏好使用强制 RLS 的账户行;修改时只向该 owner 的组件广播 locale。
- tenant 查询必须在事务中执行 `SET LOCAL app.user_id`,不能使用会泄漏到连接池的 session-level
`SET`。
- 实时广播按 `component_id` 建立独立 channel,不提供全局订阅。