Commit Graph
3 Commits
Author SHA1 Message Date

2026-08-11

lezi-fun 7966ac0eeb feat: upgrade Next.js 16 + React 19, R2 binding storage, adaptive build
- Next.js 14 → 16.3.0, React 18 → 19.2.8
- Route handlers: async params (await params) for Next 15+ — 17 files
- Fix destructuring params pattern (const {id} = await params) in
  users/[id] and users/[id]/role
- storage.js: prefer Cloudflare R2 binding (FORUMLIFY_BUCKET, no S3
  keys) on Workers; fallback S3-compatible API (Vercel/local)
- wrangler.jsonc: add FORUMLIFY_BUCKET binding to forum bucket
- scripts/build.js: adaptive build (CF env → OpenNext, else next build);
  fix recursion via NEXT_PRIVATE_STANDALONE detection
- 40/40 tests pass on Next 16

# Conflicts:
#	app/api/posts/[id]/route.js
2026-08-11 09:46:51 +08:00
lezi-fun 9c4a694394 fix: R2 public URL without bucket prefix (custom domain serves at root)
S3_PUBLIC_URL (custom domain) serves objects at /<name>, not
/<bucket>/<name>. Only include bucket prefix when falling back to the
S3 endpoint path-style URL.
2026-08-11 09:07:19 +08:00

2026-08-10

lezi-fun ec50efea89 feat: support serverless deployment (Vercel / Cloudflare Pages)
- Replace bcrypt (native) with bcryptjs (pure JS) — no native build on serverless
- Storage abstraction (lib/storage.js): local uploads/ for traditional deploy, S3-compatible (R2/MinIO/S3 via aws4fetch) for serverless
- DB pool auto-adapts to serverless (single connection, rotation, timeouts)
- next.config.js: standalone output only when DOCKER=1 (serverless skips it)
- Docs: serverless deployment section in README, S3 env vars in .env.example
2026-08-10 09:55:18 +08:00