From 6006813b7ed4df00c7387369fd2d5ac5e9e5e53f Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 30 Jun 2026 10:45:50 -0400 Subject: [PATCH] [ui] #38: make the CORS setup helper provider-aware (R2 / B2 / Custom S3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first cut showed for Custom S3 too but always gave B2-only instructions (b2 CLI + B2-native JSON), and was hidden for R2. Now the helper shows for all bucket providers and tailors its content: - Backblaze B2 -> B2-native rules + `b2 update-bucket --corsRules ...` - Custom S3 -> standard S3 CORSConfiguration + `aws s3api put-bucket-cors --endpoint-url ...` - Cloudflare R2 -> standard S3 JSON + Cloudflare dashboard guidance (R2 -> bucket -> Settings -> CORS Policy) and the AWS-CLI command vs the derived R2 endpoint. Origins pre-filled from getCorsOrigins(); intro/command-label/notes set per provider; copy buttons for both blocks. bitvid still auto-applies CORS on Save (R2/S3 via ensureBucketCors) — this is the manual fallback when the key lacks CORS-write perms. buildCorsHelpContent() switches on provider; modal text is now data-driven. Tests extended to 10 (per-provider rules + command + a DOM provider-switch). Build + lint clean; storage suites 40/40. Co-Authored-By: Claude Opus 4.8 --- components/profile-modal.html | 23 +-- .../profileModal/ProfileStorageController.js | 12 +- js/ui/profileModal/storageCorsHelp.js | 137 ++++++++++++--- tests/storage-cors-help.test.mjs | 157 +++++++++++------- todo/TODO_2026-06-20_pre-launch.md | 28 ++-- 5 files changed, 242 insertions(+), 115 deletions(-) diff --git a/components/profile-modal.html b/components/profile-modal.html index a677f88d..fd9bb6e3 100644 --- a/components/profile-modal.html +++ b/components/profile-modal.html @@ -973,7 +973,7 @@ - @@ -1875,10 +1875,8 @@