chore: normalize configuration casing
This commit is contained in:
@@ -7,7 +7,7 @@ const aiService = {
|
||||
return '';
|
||||
}
|
||||
|
||||
const ai = c.env.AI;
|
||||
const ai = c.env.ai;
|
||||
|
||||
try {
|
||||
const subject = email.subject || '';
|
||||
|
||||
@@ -231,7 +231,7 @@ const emailService = {
|
||||
|
||||
const domain = emailUtils.getDomain(accountRow.email);
|
||||
const resendToken = resendTokens[domain];
|
||||
const useCloudflareEmail = !!c.env.EMAIL;
|
||||
const useCloudflareEmail = !!c.env.email;
|
||||
|
||||
//如果接收方存在站外邮箱,又没有发信服务
|
||||
if (!useCloudflareEmail && !resendToken && !allInternal) {
|
||||
@@ -404,7 +404,7 @@ const emailService = {
|
||||
|
||||
console.log(sendForm)
|
||||
|
||||
const result = await c.env.EMAIL.send(sendForm);
|
||||
const result = await c.env.email.send(sendForm);
|
||||
|
||||
return {
|
||||
data: {
|
||||
|
||||
@@ -101,7 +101,7 @@ const settingService = {
|
||||
settingRow.s3AccessKey = settingRow.s3AccessKey ? `${settingRow.s3AccessKey.slice(0, 12)}******` : null;
|
||||
settingRow.s3SecretKey = settingRow.s3SecretKey ? `${settingRow.s3SecretKey.slice(0, 12)}******` : null;
|
||||
settingRow.hasR2 = !!c.env.r2
|
||||
settingRow.hasCfEmail = !!c.env.EMAIL
|
||||
settingRow.hasCfEmail = !!c.env.email
|
||||
|
||||
let regVerifyOpen = false
|
||||
let addVerifyOpen = false
|
||||
|
||||
@@ -11,37 +11,37 @@ custom_domain = true
|
||||
|
||||
[[d1_databases]]
|
||||
binding = "db"
|
||||
database_name = "cloud-mail" # 数据库的名称
|
||||
database_id = "${D1_DATABASE_ID}" # 使用占位符引用环境变量
|
||||
database_name = "cloud-mail"
|
||||
database_id = "${D1_DATABASE_ID}"
|
||||
|
||||
[[kv_namespaces]]
|
||||
binding = "kv"
|
||||
id = "${KV_NAMESPACE_ID}" # 使用占位符引用环境变量
|
||||
id = "${KV_NAMESPACE_ID}"
|
||||
|
||||
[[r2_buckets]]
|
||||
binding = "r2"
|
||||
bucket_name = "${R2_BUCKET_NAME}" # 使用占位符引用环境变量
|
||||
bucket_name = "${R2_BUCKET_NAME}"
|
||||
|
||||
[ai]
|
||||
binding = "AI"
|
||||
binding = "ai"
|
||||
|
||||
[assets]
|
||||
binding = "assets" #静态资源绑定名默认不可修改
|
||||
directory = "./dist" #前端vue项目打包的静态资源存放位置,默认dist
|
||||
binding = "assets"
|
||||
directory = "./dist"
|
||||
not_found_handling = "single-page-application"
|
||||
run_worker_first = true
|
||||
|
||||
[triggers]
|
||||
crons = ["*/30 * * * *", "0 16 * * *"] #每30分钟刷新分析缓存,每天晚上12点执行每日任务
|
||||
crons = ["*/30 * * * *", "0 16 * * *"]
|
||||
|
||||
|
||||
[vars]
|
||||
ai_model = "${AI_MODEL}"
|
||||
analysis_cache = "${ANALYSIS_CACHE}"
|
||||
#orm_log = false
|
||||
domain = "${DOMAIN}" #邮件域名可可配置多个 示例: ["example1.com","example2.com"]
|
||||
admin = "${ADMIN}" #管理员的邮箱 示例: admin@example.com
|
||||
jwt_secret = "${JWT_SECRET}" #jwt令牌的密钥,随便填一串字符串
|
||||
domain = "${DOMAIN}"
|
||||
admin = "${ADMIN}"
|
||||
jwt_secret = "${JWT_SECRET}"
|
||||
project_link = "${PROJECT_LINK}"
|
||||
|
||||
linuxdo_client_id = "${LINUXDO_CLIENT_ID}"
|
||||
|
||||
@@ -22,8 +22,8 @@ id = "2io01d4b299e481b9de060ece9e7785c"
|
||||
#binding = "r2"
|
||||
#bucket_name = "email"
|
||||
|
||||
[ai]
|
||||
binding = "AI"
|
||||
#[ai]
|
||||
#binding = "ai"
|
||||
|
||||
[assets]
|
||||
binding = "assets"
|
||||
@@ -31,6 +31,9 @@ directory = "./dist"
|
||||
not_found_handling = "single-page-application"
|
||||
run_worker_first = true
|
||||
|
||||
[[send_email]]
|
||||
name = "email"
|
||||
|
||||
|
||||
[vars]
|
||||
ai_model = ""
|
||||
|
||||
@@ -21,7 +21,7 @@ id = "9be10cd058e04c55b526f8c0c116f50c" #kv数据库id
|
||||
#bucket_name = "test-email" #r2对象存储桶的名字
|
||||
|
||||
[ai]
|
||||
binding = "AI"
|
||||
binding = "ai"
|
||||
|
||||
[assets]
|
||||
binding = "assets" #静态资源绑定名默认不可修改
|
||||
|
||||
@@ -20,10 +20,10 @@ enabled = true
|
||||
#bucket_name = "" #r2对象存储桶的名字
|
||||
|
||||
#[[send_email]]
|
||||
#name = "EMAIL" #配置后站外发信优先使用 Cloudflare Email Service
|
||||
#name = "email" #CF发件, 配置后优先使用
|
||||
|
||||
[ai]
|
||||
binding = "AI"
|
||||
binding = "ai"
|
||||
|
||||
[assets]
|
||||
binding = "assets" #静态资源绑定名默认不可修改
|
||||
|
||||
Reference in New Issue
Block a user