Replace Google Drive with Cloudflare R2 for Image Storage#43
Conversation
- Replaced `DriveService` with `R2Service` for image storage - Updated setup and deploy scripts to provision R2 bucket - Updated `wrangler.toml` configuration to include R2 binding - Updated admin API routes to use R2 storage - Updated `AddMediaModal` to remove Google Drive integration and use R2 upload - Added public route to serve images from R2 via Worker - Removed Google Drive dependencies and legacy code Co-authored-by: AJFrio <20246916+AJFrio@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
💡 Codex Review
OpenShop/src/components/admin/AddMediaModal.jsx
Lines 159 to 162 in e7050f6
Reference images are always fetched through /api/image-proxy (proxied = "/api/image-proxy?src=..."), but the proxy explicitly allows only Google Drive hosts (src/routes/public/imageProxy.js lines 17–21). With the switch to R2, newly uploaded media URLs are now /api/images/:key (same-origin), so these URLs fail the proxy’s host check and the reference images are silently skipped. This means “Add from Library” no longer influences generation for any R2-hosted media. Consider bypassing the proxy for same-origin/R2 URLs or expanding the proxy to allow the /api/images host.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
This PR replaces the Google Drive integration for image storage with Cloudflare R2.
It includes:
R2Servicefor handling uploads and file retrieval.scripts/setup.jsandscripts/deploy.jsto automatically create an R2 bucket and bind it to the worker./api/images/:keyto serve images directly from the R2 bucket via the Worker, ensuring proper caching and headers.DriveServiceand related admin routes.PR created automatically by Jules for task 13633155208450933772 started by @AJFrio