启动 Web 服务时自动登记 CLI 指定的 B 站凭据,并为账号登记、刷新和删除统一补上并发去重、原子写入及引用检查。 同时收紧默认监听、管理员初始化、认证路由、静态文件和日志 WebSocket,恢复 server 的 ds_update.log,并避免凭据及上游响应进入日志。 新增按账号查询远程稿件的 API 与 Web 页面,补齐严格分页和响应校验。 关联 biliup/biliup#1624 关联 biliup/biliup#1658 关联 biliup/biliup#724
24 lines
932 B
SQL
24 lines
932 B
SQL
-- A Web login has exactly one administrator identity. Creating the partial
|
|
-- unique index intentionally fails when an existing database already contains
|
|
-- multiple `biliup` rows: choosing one automatically could preserve an
|
|
-- attacker-created password, so startup must fail closed until the operator
|
|
-- resolves the conflicting rows.
|
|
CREATE UNIQUE INDEX IF NOT EXISTS uq_configuration_biliup_identity
|
|
ON configuration (key)
|
|
WHERE key = 'biliup';
|
|
|
|
-- Duplicate references to the exact same cookie file are semantically
|
|
-- equivalent and can be collapsed safely before enforcing atomic idempotency.
|
|
DELETE FROM configuration
|
|
WHERE key = 'bilibili-cookies'
|
|
AND id NOT IN (
|
|
SELECT MIN(id)
|
|
FROM configuration
|
|
WHERE key = 'bilibili-cookies'
|
|
GROUP BY value
|
|
);
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS uq_configuration_bilibili_cookie
|
|
ON configuration (key, value)
|
|
WHERE key = 'bilibili-cookies';
|