Skip to content

Updates ​

Updating code does not require new secrets or a new database. Back up D1 first.

Dashboard ​

  1. On your GitHub fork, Sync fork → Update branch
  2. Cloudflare builds the connected branch
  3. Open https://your-site/api/init/your-existing-init_secret to apply schema upgrades
  4. Check login, inbox, and sending

Keep admin, secrets, D1, and KV in Cloudflare Settings. Do not put them back in GitHub.

CLI ​

After the first successful deploy, save your config as gitignored mail-worker/wrangler.local.toml:

sh
cd mail-view
npm install
npm run build
cd ../mail-worker
npm ci
npm run deploy:local

If you still use wrangler.toml, confirm it still has the original resource IDs, then npm run deploy.

Backup ​

  • D1: dashboard backup / Time Travel, or Wrangler export
  • Attachments: back up R2 / S3 / KV separately
  • Secrets: keep jwt_secret, init_secret, and two_factor_key in a password manager. Changing two_factor_key breaks existing authenticator data
  • Rollback: pick a known-good version in Worker Deployments. Rolling back code does not roll back the database

MIT License · Based on cloud-mail