13 Commits
Author SHA1 Message Date
can4hou6joeng4 81c46d754e fix(sync): 修复自托管下无法读取 Upstash 配置
app/api/user/{sync,config} 用 @upstash/redis/cloudflare 的
Redis.fromEnv() 创建客户端。该实现只读传入的 env 参数或 Cloudflare
全局绑定,从不回退到 process.env,因此在 Docker / Node 自托管下
url 与 token 恒为 undefined,两个接口必定返回 500,跨设备同步
(收藏、历史、设置)完全不可用。认证走的是 auth.ts 里的
new Redis({ url, token }),所以登录正常,只有用户数据读写失败。

把 auth.ts 中已有的双源回退抽成 lib/server/runtime-env.ts,Redis
客户端抽成 lib/server/redis.ts,两个路由改为惰性获取共享客户端。
惰性创建同时修正了另一个隐患:Cloudflare 的 per-request 绑定在
模块求值阶段不可达,而原先客户端是在模块作用域创建的。

未配置 Upstash 时返回 503 并给出明确说明,而不是当成请求失败。

Fixes #226
2026-07-31 10:12:40 +08:00
Codex 27d30139c1 fix: support Upstash Redis on Cloudflare Pages 2026-07-20 16:13:51 +08:00
kuekhaoyang 610f57c5b0 fix auth sync requests after login 2026-07-09 16:33:44 +08:00
kuekhaoyang 19e9707041 Fix managed auth and source list regressions 2026-04-15 23:04:41 +08:00
kuekhaoyang 064a27c8b6 feat: implement Upstash Redis for user config sync, replacing file-based persistence 2026-03-18 12:52:24 +08:00
kuekhaoyang 3564ce1ede chore: update package versions and add user config sync API
- Bump version to 4.8.0 and update dependencies in package.json
- Implement user config sync API for cross-device settings persistence
- Add resolution badge auto-hide hook for improved user experience
- Create useConfigSync hook to manage user settings synchronization with the server
2026-03-18 12:44:05 +08:00
vvwnandGitHub 1d777968f3 Add user sync API with Redis integration
Implement GET and POST endpoints for user sync data with Redis.
2026-02-24 14:50:42 +08:00
vvwnandGitHub 4f894c6011 Delete app/api/user/sync/route.ts 2026-02-24 14:49:10 +08:00
vvwnandGitHub 57c00c9611 Add user sync route with GET and POST methods
Implement GET and POST handlers for user sync data using Upstash Redis.
2026-02-24 14:18:44 +08:00
vvwnandGitHub e8681c4ac9 Delete app/api/user 2026-02-24 14:11:15 +08:00
vvwnandGitHub 628c85299d Create user 2026-02-24 14:09:46 +08:00
vvwnandGitHub eddcee2abf Delete app/api/user directory 2026-02-24 14:09:02 +08:00
vvwnandGitHub 6e2561c3b9 Add user sync API with Redis integration
Implement GET and POST endpoints for user sync data with Redis.
2026-02-24 14:07:45 +08:00