main = "worker/worker.ts"
compatibility_date = "2024-07-01"
name = "jeffemmett-canvas-dev"
account_id = "0e7b3338d5278ed1b148e6456b940913"

[vars]
# Development environment variables
DAILY_DOMAIN = "mycopunks.daily.co"

[dev]
port = 5172
ip = "0.0.0.0"
local_protocol = "http"
upstream_protocol = "https"

[dev.miniflare]
kv_persist = true
r2_persist = true
d1_persist = true
durable_objects_persist = true

[durable_objects]
bindings = [
    { name = "AUTOMERGE_DURABLE_OBJECT", class_name = "AutomergeDurableObject" },
]

[[migrations]]
tag = "v1"
new_classes = ["AutomergeDurableObject"]

[[r2_buckets]]
binding = 'TLDRAW_BUCKET'
bucket_name = 'jeffemmett-canvas-preview'
preview_bucket_name = 'jeffemmett-canvas-preview'

[[r2_buckets]]
binding = 'BOARD_BACKUPS_BUCKET'
bucket_name = 'board-backups-preview'
preview_bucket_name = 'board-backups-preview'

[[d1_databases]]
binding = "CRYPTID_DB"
database_name = "cryptid-auth-dev"
database_id = "35fbe755-0e7c-4b9a-a454-34f945e5f7cc"

[observability]
enabled = true
head_sampling_rate = 1  

[triggers]
crons = ["0 0 * * *"] # Run at midnight UTC every day 

# Secrets should be set using `wrangler secret put` command for dev environment
# DO NOT put these directly in wrangler.toml:
# - DAILY_API_KEY
# - CLOUDFLARE_API_TOKEN
# etc.
