From 2e7e2016d37126edbcc762dd4b8edacaab52cafb Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 30 Jun 2026 15:19:22 -0400 Subject: [PATCH] [ui] B2 storage: use pipx for the CORS CLI install + rename secret field to "Application Key" - CORS setup helper: the Backblaze B2 instructions now say `pipx install b2` instead of `pip install b2` (the recommended way to install a CLI tool). - Storage form: for the Backblaze B2 provider the "Secret Access Key" field is now labelled "Application Key" to match B2's own terminology (the secret half of an Application Key). Other providers keep "Secret Access Key". Test updated to assert the pipx instruction. Build + lint clean. Co-Authored-By: Claude Opus 4.8 --- js/ui/profileModal/ProfileStorageController.js | 7 +++++++ js/ui/profileModal/storageCorsHelp.js | 2 +- tests/storage-cors-help.test.mjs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/js/ui/profileModal/ProfileStorageController.js b/js/ui/profileModal/ProfileStorageController.js index 6b8f388e..e1d791af 100644 --- a/js/ui/profileModal/ProfileStorageController.js +++ b/js/ui/profileModal/ProfileStorageController.js @@ -437,6 +437,13 @@ export class ProfileStorageController { this.storageRegionInput.placeholder = "auto"; } + // B2 calls the secret an "Application Key" — match its terminology. + const secretLabel = + this.storageSecretKeyInput?.parentElement?.querySelector("span"); + if (secretLabel) { + secretLabel.textContent = isB2 ? "Application Key" : "Secret Access Key"; + } + if (this.storageR2Helper) { this.storageR2Helper.classList.toggle("hidden", !isR2); } diff --git a/js/ui/profileModal/storageCorsHelp.js b/js/ui/profileModal/storageCorsHelp.js index 616dab06..f5849fb6 100644 --- a/js/ui/profileModal/storageCorsHelp.js +++ b/js/ui/profileModal/storageCorsHelp.js @@ -84,7 +84,7 @@ export function buildCorsHelpContent({ provider, origins, bucket, endpoint } = { cmdLabel: "Apply it (B2 command-line tool)", cmd: buildB2CorsCommand(bucket, rules), notes: - "1. Install the B2 CLI (pip install b2).\n" + + "1. Install the B2 CLI (pipx install b2).\n" + "2. Run the command above (it authorizes, then sets the rules).\n" + "3. Wait ~1 minute, then retry your upload.\n" + "Tip: a B2 application key with the writeBucketCors capability lets bitvid set " + diff --git a/tests/storage-cors-help.test.mjs b/tests/storage-cors-help.test.mjs index fb77e210..b243bc72 100644 --- a/tests/storage-cors-help.test.mjs +++ b/tests/storage-cors-help.test.mjs @@ -70,7 +70,7 @@ test("content for Backblaze B2 uses B2-native rules + the b2 CLI", () => { assert.match(c.cmd, /^b2 update-bucket /); assert.match(c.cmdLabel, /B2 command-line/i); assert.ok(JSON.parse(c.json)[0].allowedOperations.includes("s3_put")); - assert.match(c.notes, /b2 CLI|pip install b2/i); + assert.match(c.notes, /pipx install b2/i); }); test("content for Custom S3 uses standard S3 CORS + the AWS CLI", () => {