Skip to content

Conversation

@AJFrio
Copy link
Owner

@AJFrio AJFrio commented Jan 30, 2026

This PR replaces the Google Drive integration for image storage with Cloudflare R2.
It includes:

  • New R2Service for handling uploads and file retrieval.
  • Updates to scripts/setup.js and scripts/deploy.js to automatically create an R2 bucket and bind it to the worker.
  • Updates to the admin frontend to remove Google Drive tabs and logic, pointing uploads to the new R2 backend.
  • A new public route /api/images/:key to serve images directly from the R2 bucket via the Worker, ensuring proper caching and headers.
  • Removal of DriveService and related admin routes.

PR created automatically by Jules for task 13633155208450933772 started by @AJFrio

- 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>
@google-labs-jules
Copy link
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

for (const url of refUrls.slice(0, 3)) {
try {
const proxied = `/api/image-proxy?src=${encodeURIComponent(url)}`
const resp = await fetch(proxied)

P2 Badge Allow R2-hosted refs instead of proxy-only Drive URLs

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".

@AJFrio AJFrio merged commit ae2ab8c into main Feb 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants