R2 Attachments
Last reviewed: 2026-05-13
Maintained by: Engineering
Issue attachment storage is currently built around Cloudflare R2-compatible object storage.
Current flow
- the API creates signed upload and read URLs
- the mobile client uploads attachment binaries directly to object storage
- metadata and attachment records stay tracked in the application database
Key implementation areas
- API storage adapter:
apps/api/src/lib/r2.ts - issue attachment orchestration:
apps/api/src/features/issues/issues.service.ts - mobile upload client:
apps/zgrid-mobile/src/lib/issue-image-attachments.ts
Required configuration
The API expects environment-managed R2 settings:
R2_ACCOUNT_IDR2_ACCESS_KEY_IDR2_SECRET_ACCESS_KEYR2_ATTACHMENTS_BUCKET
Do not commit real storage credentials. Keep them in environment-managed secrets only.