Site Configuration
These settings have no admin-panel controls and are managed by the deployer. Change the site name, icon, and palette under Site appearance in the admin panel.
Message Retention
MESSAGE_RETENTION_DAYS controls how long messages are kept, measured from creation. The current default is 15 days. Use a positive integer such as 7 or 30.
GitHub Actions
- Open the fork's
Settings → Secrets and variables → Actions → Variables. - Click
New repository variable. - Set Name to
MESSAGE_RETENTION_DAYSand Value to30, using digits only. - Run
Actions → 00 Deploy Worker → Run workflow.
This is a regular Variable, not a Secret. Later deployments reuse it; without it, the default is 15 days.
Cloudflare Dashboard
Open Workers & Pages → your Worker → Settings → Variables and Secrets. Add or edit MESSAGE_RETENTION_DAYS as Text, then save and deploy.
For Actions deployments, also set the repository variable above. Subsequent Actions deployments use the repository value.
Manual Deployment
Edit the existing [vars] section of the wrangler.toml you deploy:
[vars]
MESSAGE_RETENTION_DAYS = "30"Redeploy to apply it. A local shell environment variable alone does not change the deployed Wrangler configuration.
Deletion Schedule
Cleanup runs daily around 19:00 UTC and deletes expired messages. Attachments are checked for remaining references before deletion. Backlogs are processed in batches.
Reducing retention affects existing history; deleted messages cannot be restored. 0 does not disable cleanup: the Worker falls back to its default, and Actions rejects that value.
The default changed to 15 days in 2.17.2. Existing explicit values such as 7 remain effective until you change them.
Other Runtime Settings
| Parameter | Default | Purpose |
|---|---|---|
MAX_FILE_SIZE | 20971520 (20 MiB) | Maximum uploaded file size in bytes |
ALLOWED_FILE_TYPES | image/,video/,audio/,application/pdf,text/ | Comma-separated MIME prefix allowlist |
SITE_ORIGINS | Empty | Comma-separated site origins for recognizing historical site-icon file URLs |
SOFT_DELETE_RETENTION_DAYS | 60 | Retention for soft-deleted users, channels, and related records |
ORPHAN_UPLOAD_RETENTION_DAYS | 1 | Retention for uploads without application references |
ADMIN_USERNAMES | admin | Reserved registration names; see Administrator Setup to create accounts |
These settings currently do not read same-named GitHub Repository Variables:
- Actions: edit the existing
[vars]in your fork'swrangler.example.toml, commit, and deploy. - Manual deployment: edit your deployed
wrangler.tomland redeploy. - Temporary dashboard change: publish a Worker Text variable. The next deployment restores the configuration-file value.
See Attachments and Storage for file-type examples. Example site origins:
SITE_ORIGINS = "https://chat.example.com,https://chat-alt.example.com"Include the scheme and hostname, without a path. This identifies historical icon references during cleanup; newly saved icons use object keys directly.
Advanced Cleanup Settings
These limit work per cleanup invocation. Keep the defaults for ordinary operation; edit them through the same configuration files as above.
| Parameter | Default | Meaning |
|---|---|---|
GC_BATCH_SIZE | 90 | Batch size |
GC_MAX_BATCHES_PER_RUN | 20 | Maximum rounds |
GC_INTERNAL_OPERATION_BUDGET | 900 | Combined D1 API and R2 internal operation budget |
GC_D1_STATEMENT_BUDGET | 1200 | D1 SQL statement budget |
GC_R2_OPERATION_BUDGET | 300 | R2 operation budget |
R2_DELETE_MAX_RETRY | 8 | R2 deletion retry limit |
Cron runs every 15 minutes; message cleanup runs only at the daily designated time. Changes to the Cron expression also require reviewing the cleanup time check in worker/src/index.js.
Features Using Secrets
Configure TURN relay and server-side encryption using their separate Secret setup guides.