feat: Cloudflare Workers deployment (OpenNext adapter)

- Add @opennextjs/cloudflare + wrangler config, open-next.config.ts,
  public/_headers, .dev.vars.example template
- package.json: cf build/preview/deploy/upload scripts
- Verified deployed: https://forumlify.roylikerebecca19930.workers.dev
  (DB read/write via outbound TCP to Postgres, R2 image upload + public
  domain access all working)
This commit is contained in:
lezi-fun committed 2026-08-11 09:18:38 +08:00
1 parent 9c4a694394
commit a42fe1dd89
8 files changed
+899 -4

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
# Cloudflare Workers 环境变量示例
# 复制为 .dev.vars 用于本地 preview;远程部署请在 CF 面板配置为 Secrets
DATABASE_URL=postgresql://user:pass@host:5432/forumlify
JWT_SECRET=change-me-in-production
# 图片上传(S3 兼容,R2)
S3_ENDPOINT=https://<account_id>.r2.cloudflarestorage.com
S3_BUCKET=forum
S3_REGION=auto
S3_ACCESS_KEY_ID=your-r2-access-key
S3_SECRET_ACCESS_KEY=your-r2-secret-key
S3_PUBLIC_URL=https://your-public-domain.example