Object storage (S3 / Cloudflare R2)¶
The odusite_s3 addon stores Odoo attachments (product images, blog/event
covers, generated PDFs, uploaded files) on an S3-compatible object store instead
of the local filestore, so media scales independently of the Odoo host and
public bytes can be served straight from a CDN/R2.
Configuration¶
Connection settings are read in this order (first hit wins):
odoo.conf[options]:odusite_s3_endpoint_url,odusite_s3_public_endpoint_url,odusite_s3_public_base_url,odusite_s3_region,odusite_s3_bucket,odusite_s3_access_key,odusite_s3_secret_key.- Environment: the same keys upper-cased (
ODUSITE_S3_BUCKET, …). - Database: Settings → Website → Odusite → Object Storage (
odusite.s3.*).
Keep credentials in odoo.conf/env in production; the Settings UI is handy for
testing. Policy toggles always live in Settings:
| Setting | Default | Effect |
|---|---|---|
| Enabled | off | Master switch. |
| Keep web assets local | on | CSS/JS bundles stay in Odoo (fast admin UI). |
| Keep images below (KB) | 50 | Small images (avatars/thumbnails) stay local; 0 = send all. |
| Also keep these MIME types | — | Comma-separated prefixes to keep local. |
| Direct download | on | Serve S3 originals via a 302 → presigned URL. |
| Presigned URL TTL | 900 s | Lifetime of signed download links. |
Test connection writes and deletes a probe object and reports the result.
Cloudflare R2¶
Endpoint https://<account>.r2.cloudflarestorage.com, region auto,
path-style + SigV4 (handled automatically). For public images set
Public base URL to your R2 custom domain / r2.dev bucket URL; leave it
empty to serve everything through Odoo's /img proxy and presigned links only.
Migrating the existing filestore¶
Enabling S3 only affects new attachments. To move what's already on disk:
- Configure and enable S3, run Test connection.
- Settings → Object Storage → Migrate: Start. A background job copies eligible local attachments to S3 and flips their storage, in batches.
- Watch the progress counters (on S3 / local pending); press Stop to halt after the current batch. Tune batch size, upload threads and an optional time window (e.g. run only 22:00–06:00) in the same screen.
Migration is safe to interrupt and resume, skips unreadable source files, and does not fire other modules' write hooks (pure storage move). Disabling the master switch is reversible — reads fall back per attachment to wherever the bytes physically are.
Deletion & garbage collection¶
Deleting an attachment does not remove the S3 object immediately: the key is queued and an autovacuum removes it only once no attachment references it (deduplicated content is shared, so this is reference-counted). No action needed; it runs with Odoo's normal autovacuum cron.