Skip to content

Attachments and Storage ​

Enable Attachments ​

  1. Enable R2 for the deployment account in Cloudflare.
  2. Rerun Actions → 00 Deploy Worker.
  3. The workflow reuses or creates cfchat-files and adds the FILES binding.
  4. Test file uploads and avatar changes in the site.

Without R2, text chat can still be deployed, but uploads, attachment reads, and Telegram file synchronization are unavailable. Enable R2 and redeploy to restore them.

If the R2 check fails, verify R2:Edit permission and the Account ID. Only an account without R2 (Cloudflare error 10042) automatically deploys without attachments.

Change Upload Limits ​

There is no admin-panel upload-limit setting. For Actions, edit your fork's wrangler.example.toml. For manual deployment, edit the wrangler.toml you deploy, then redeploy:

toml
[vars]
MAX_FILE_SIZE = "10485760"
ALLOWED_FILE_TYPES = "image/,application/pdf,text/"

This allows images, PDFs, and text up to 10 MiB. Edit the existing [vars] fields.

  • Size is in bytes; the default is 20 MiB (20971520).
  • Types match comma-separated MIME prefixes: image/ allows image types, and application/pdf allows PDF.
  • Dangerous MIME types such as HTML, SVG, scripts, and XML remain rejected.
  • An empty list removes the general type filter; an explicit list suits ordinary use.

Same-named GitHub Repository Variables are not read by the current workflow. See Site Configuration.

File Cleanup ​

Expired messages queue their files for deletion. Cleanup checks references from messages, avatars, and icons before removing objects. Unreferenced uploads default to one day of retention. See cleanup settings for budgets and batches.

If an older deployment stored a complete site-icon URL, configure SITE_ORIGINS under Site Configuration.

View Usage ​

Storage statistics in the admin panel shows a snapshot grouped by source after a manual scan. The Cloudflare R2 dashboard shows bucket totals and request usage.

Built on Cloudflare · Designed for self-hosting