name = "${NAME}"
main = "src/index.js"
compatibility_date = "2025-06-04"

[observability]
enabled = true

[[routes]]
pattern = "${CUSTOM_DOMAIN}"
custom_domain = true

[[d1_databases]]
binding = "db"
database_name = "cloud-mail"
database_id = "${D1_DATABASE_ID}"

[[kv_namespaces]]
binding = "kv"
id = "${KV_NAMESPACE_ID}"

[[r2_buckets]]
binding = "r2"
bucket_name = "${R2_BUCKET_NAME}"

[ai]
binding = "ai"

[assets]
binding = "assets"
directory = "./dist"
not_found_handling = "single-page-application"
run_worker_first = true

[triggers]
crons = ["*/30 * * * *", "0 16 * * *"]


[vars]
ai_model = "${AI_MODEL}"
analysis_cache = "${ANALYSIS_CACHE}"
#orm_log = false
domain = "${DOMAIN}"
admin = "${ADMIN}"
jwt_secret = "${JWT_SECRET}"
project_link = "${PROJECT_LINK}"

linuxdo_client_id = "${LINUXDO_CLIENT_ID}"
linuxdo_client_secret = "${LINUXDO_CLIENT_SECRET}"
linuxdo_callback_url = "${LINUXDO_CALLBACK_URL}"
linuxdo_switch = "${LINUXDO_SWITCH}"

[build]
command = "pnpm --prefix ../mail-vue install && pnpm --prefix ../mail-vue run build"
