46 lines
1.3 KiB
TOML
46 lines
1.3 KiB
TOML
# Cloudflare Workers 部署配置
|
|
# 使用方式: npx wrangler deploy --config deploy/worker/wrangler.toml
|
|
#
|
|
# 部署前需要配置以下 binding:
|
|
# 1. D1 数据库 - 取消注释并填入你的 database_id
|
|
# 2. R2 存储桶 - 取消注释并填入你的 bucket_name
|
|
# 3. KV 命名空间 - 如果使用 KV 而非 D1,取消注释并填入 id
|
|
# 4. 环境变量 - 在 [vars] 中配置
|
|
#
|
|
# GitHub Actions 部署时会自动从 Secrets/Variables 生成此文件,
|
|
# 无需手动编辑。详见 .github/workflows/deploy-worker.yml
|
|
|
|
name = "cloudflare-imgbed"
|
|
main = "index.js"
|
|
compatibility_date = "2024-08-21"
|
|
# 让 Worker 对自身 zone 的 fetch() 走公网入口,不要直连 origin。
|
|
compatibility_flags = ["global_fetch_strictly_public"]
|
|
|
|
# 静态资源(前端文件)
|
|
[assets]
|
|
directory = "../../frontend-dist"
|
|
binding = "ASSETS"
|
|
not_found_handling = "single-page-application"
|
|
|
|
# Cloudflare Images 原生图片处理
|
|
[images]
|
|
binding = "IMAGES"
|
|
|
|
[vars]
|
|
# AI_CONFIG_SECRET = "" # 至少 32 个字符的随机密钥,用于加密保存 AI 供应商 API Key
|
|
# TG_BOT_TOKEN = ""
|
|
# TG_CHAT_ID = ""
|
|
|
|
# [[d1_databases]]
|
|
# binding = "img_d1"
|
|
# database_name = "img_d1"
|
|
# database_id = ""
|
|
|
|
# [[r2_buckets]]
|
|
# binding = "img_r2"
|
|
# bucket_name = ""
|
|
|
|
# [[kv_namespaces]]
|
|
# binding = "img_url"
|
|
# id = ""
|