feat: add support for Cloudflare R2 object storage and update related configurations#12
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 34736079 | Triggered | Generic High Entropy Secret | 5a9ad07 | backend/internal/pkg/s3store/s3.go | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
Pull request overview
Adds first-class Cloudflare R2 support as an alternative S3-compatible object storage provider, wiring it through backend config/feature APIs and frontend UI so deployments can switch providers and default regions appropriately.
Changes:
- Introduces an
OBJECT_STORAGE_PROVIDERconfig switch with R2-specific env vars and validation. - Updates the backend S3 client/store to derive R2 endpoint + enforce R2’s
autoregion behavior. - Updates the frontend feature model/tests and app creation UI to reflect provider + region constraints.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents R2 configuration and clarifies provider behavior. |
| frontend/tests/services/feature.test.ts | Extends feature service test fixtures with new object-storage fields. |
| frontend/app/models/feature.ts | Adds Zod schema fields for object storage provider/region/configured status. |
| frontend/app/components/app/create-app-dialog.tsx | Uses feature data to constrain selectable regions (R2 => auto). |
| backend/services/create_app.go | Adds ForceDefaultRegion to ensure configured storage region can be enforced. |
| backend/services/create_app_test.go | Tests that configured storage region is enforced (e.g., R2 auto). |
| backend/internal/pkg/s3store/s3.go | Resolves provider-specific storage config (R2 endpoint/region) and region handling. |
| backend/internal/pkg/s3store/s3_test.go | Adds tests for storage config resolution + R2 region/bucket-creation behavior. |
| backend/config/type.go | Adds object storage provider types, config structs, and region helper. |
| backend/config/config.go | Adds default provider and validates R2 configuration inputs. |
| backend/config/config_test.go | Adds config loading/validation tests for R2 and invalid providers. |
| backend/api/handler/feature.go | Exposes provider/region/configured status via the feature endpoint. |
| backend/api/handler/app.go | Uses configured object storage region and enforces it for R2 on app creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
[Provide a brief description of the changes in this pull request]
Related Issue
[If applicable, link to the issue this PR addresses]
Type of Change
Checklist
Additional Notes
[Add any additional information or context about the PR here]