Refine R2 upload UX with bucket auto-creation attempt and clearer guidance

- Updated `R2Service` to attempt bucket creation via S3 API (`ensureBucketExists`) before upload. This improves the UX for users with Admin keys or custom domains while gracefully failing (with a warning) for users with minimal permissions.
- Modified `UploadModal` helper text to explicitly instruct users about enabling "Public Access" in the Cloudflare dashboard for new buckets.
- Updated `js/r2.js` to ensure the "Public Bucket URL" is always sanitized to include the `https://` protocol, fixing potential webseed generation issues.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-12 19:40:07 +00:00
1 parent 7dc2977cf2
commit f45f027a56
2 files changed
+24 -8

No files matched your search

+3
View File
@@ -164,6 +164,9 @@
<div class="space-y-1">
<label for="input-r2-domain" class="text-xs font-medium text-text">Public Bucket URL</label>
<input id="input-r2-domain" type="text" class="input text-xs" placeholder="https://pub-xxx.r2.dev" />
<p class="text-[10px] text-muted leading-tight">
New buckets are private. Enable <strong>Public Access</strong> in the Cloudflare dashboard to get your r2.dev URL.
</p>
</div>
</div>
<div class="grid gap-3 md:grid-cols-2">