{
  "$schema": "node_modules/wrangler/config-schema.json",
  "name": "leesin",
  "main": "src/index.js",
  "compatibility_date": "2026-08-01",
  "observability": { "enabled": true },

  // Bucket R2 dung chung cho ca du lieu (prefix drive/) va hop thu ghep noi
  // (prefix _system/pairing/). Khong them KV de khoi phat sinh dependency.
  "r2_buckets": [
    {
      "binding": "DRIVE",
      "bucket_name": "leesin-drive"
    }
  ],

  "vars": {
    "INSTANCE_NAME": "leesin",
    "BUCKET_NAME": "leesin-drive",
    "DRIVE_PREFIX": "drive/",
    "PAIRING_PREFIX": "_system/pairing/",
    "PAIRING_TTL_SECONDS": "600",
    "SESSION_TTL_SECONDS": "900"

    // OWNER_EMAIL va GOOGLE_CLIENT_ID do script cai dat ghi vao luc setup.
    // Xem docs/van-hanh.md. Hai gia tri nay khong phai secret nhung rieng cho
    // tung nguoi tu host nen khong commit san o day.
  },

  // Secret (dat bang `wrangler secret put`, KHONG commit):
  //   SESSION_SECRET        - khoa HMAC ky phien
  //   GOOGLE_CLIENT_SECRET  - client secret cua desktop OAuth client (Google
  //                           coi la khong bi mat voi installed app, nhung van
  //                           giu o Worker cho sach)

  // Don goi ghep noi qua han moi gio. Bo dong nay neu khong muon dung cron.
  "triggers": {
    "crons": ["0 * * * *"]
  }
}
