893247f6b982

fix: retire stale release credential paths (PB-26-013) — submit:firefox npm script removed (web-ext secrets were on the command line; release-firefox.ts already passes them via child env), setup-chrome-release.sh trashed (it persisted CWS secrets in plaintext to the shell profile), release.ts env-contract comments updated; bump 5.0.11→5.0.12

time
2026-08-30 00:28 UTC · 1 month ago
machine
koh2
agent
glm-5.3-flash
session
pb-26 audit fixes
parent
3fedcd356231
5 files manifest.firefox.json+1 −1manifest.json+1 −1package.json+1 −2scripts/release.ts+3 −2scripts/setup-chrome-release.sh+0 −181
manifest.firefox.json+1 −1
@@ -1,7 +1,7 @@11 {22   "manifest_version": 3,33   "name": "Peach Password Manager",4-  "version": "5.0.11",4+  "version": "5.0.12",55   "description": "Zero-knowledge password manager",66   "browser_specific_settings": {77     "gecko": {

view file

manifest.json+1 −1
@@ -2,7 +2,7 @@22   "manifest_version": 3,33   "minimum_chrome_version": "116",44   "name": "Peach Password Manager",5-  "version": "5.0.11",5+  "version": "5.0.12",66   "description": "Zero-knowledge password manager",77   "action": {88     "default_popup": "src/popup/index.html",

view file

package.json+1 −2
@@ -1,6 +1,6 @@11 {22   "name": "peach",3-  "version": "5.0.11",3+  "version": "5.0.12",44   "description": "Zero-knowledge password manager",55   "license": "GPL-3.0-only",66   "type": "module",@@ -25,7 +25,6 @@2525     "release": "bun run scripts/release.ts",2626     "release:chrome": "bun run scripts/release.ts --chrome-only",2727     "release:firefox": "bun run scripts/release-firefox.ts",28-    "submit:firefox": "web-ext sign --source-dir dist-firefox --artifacts-dir artifacts --api-key=$AMO_JWT_ISSUER --api-secret=$AMO_JWT_SECRET --channel=listed",2928     "check:sw": "node scripts/check-sw-static-imports.mjs"3029   },3130   "engines": {

view file

scripts/release.ts+3 −2
@@ -4,7 +4,8 @@44 // Usage: npm run release55 //        npm run release:chrome   (Chrome only — skips AMO)66 //7-// Required environment variables (set via setup-chrome-release.sh and shell profile):7+// Required environment variables (set from your secret store, then export8+// in the release shell — PB-26-013: never written to a shell profile):89 //   CWS_CLIENT_ID, CWS_CLIENT_SECRET, CWS_REFRESH_TOKEN, CWS_EXTENSION_ID910 //   AMO_JWT_ISSUER, AMO_JWT_SECRET  (not needed for --chrome-only)1011 @@ -38,7 +39,7 @@3839 3940 function check(name: string): string {4041   const val = process.env[name];41-  if (!val) fail(`${name} not set. Run setup-chrome-release.sh and reload your shell.`);42+  if (!val) fail(`${name} not set. Export it from your secret store and reload your shell.`);4243   return val!;4344 }4445 

view file

scripts/setup-chrome-release.sh+0 −181
@@ -1,181 +0,0 @@1-#!/usr/bin/env bash2-# ─────────────────────────────────────────────────────────────────────────────3-# Peach — Chrome Web Store Release Setup4-# Run this once to configure Chrome publishing.5-# After setup, use: npm run release6-# ─────────────────────────────────────────────────────────────────────────────7-8-set -e9-10-BOLD="\033[1m"11-DIM="\033[2m"12-ACCENT="\033[38;5;208m"13-GREEN="\033[32m"14-RED="\033[31m"15-RESET="\033[0m"16-17-header() {18-  echo ""19-  echo -e "${ACCENT}${BOLD}$1${RESET}"20-  echo -e "${DIM}$2${RESET}"21-  echo ""22-}23-24-success() { echo -e "${GREEN}✓ $1${RESET}"; }25-fail() { echo -e "${RED}✗ $1${RESET}"; exit 1; }26-27-clear28-echo ""29-echo -e "${ACCENT}${BOLD}  ░░  peach chrome release setup  ░░${RESET}"30-echo ""31-echo -e "${DIM}This sets up one-command Chrome Web Store publishing.${RESET}"32-echo -e "${DIM}Run this once. After that: npm run release${RESET}"33-echo ""34-read -rp "Press Enter to begin…"35-36-# ─── Step 1: Check dependencies ───────────────────────────────────────────────37-38-header "Step 1 / 4 — Checking dependencies" ""39-40-if ! command -v node &>/dev/null; then41-  fail "Node.js not found."42-fi43-success "Node.js $(node --version)"44-45-# Install chrome-webstore-upload-cli46-echo "Installing chrome-webstore-upload-cli…"47-npm install -D chrome-webstore-upload-cli 2>/dev/null || \48-  npm install -g chrome-webstore-upload-cli49-success "chrome-webstore-upload-cli ready"50-51-# ─── Step 2: OAuth setup ──────────────────────────────────────────────────────52-53-header "Step 2 / 4 — Google OAuth setup" \54-  "This is the only annoying part. Follow the steps carefully."55-56-echo -e "${BOLD}You need to:${RESET}"57-echo "  1. Go to: ${ACCENT}https://console.cloud.google.com/apis/credentials${RESET}"58-echo "  2. Create a new project called 'Peach CWS' (top-left dropdown → New Project)"59-echo "  3. Enable the Chrome Web Store API:"60-echo "     ${ACCENT}https://console.cloud.google.com/apis/library/chromewebstore.googleapis.com${RESET}"61-echo "  4. Go to Credentials → Create Credentials → OAuth 2.0 Client ID"62-echo "  5. Application type: Desktop app"63-echo "  6. Name: Peach Release"64-echo "  7. Download the JSON — copy the client_id and client_secret"65-echo ""66-echo -e "${DIM}Once you have those, come back here.${RESET}"67-echo ""68-read -rp "Press Enter when you have your client_id and client_secret…"69-70-echo ""71-echo -e "${BOLD}Paste your client_id:${RESET}"72-read -r CWS_CLIENT_ID73-74-echo -e "${BOLD}Paste your client_secret (hidden):${RESET}"75-read -rs CWS_CLIENT_SECRET76-echo ""77-78-if [ -z "$CWS_CLIENT_ID" ] || [ -z "$CWS_CLIENT_SECRET" ]; then79-  fail "Client ID and secret are required."80-fi81-82-# ─── Step 3: Get refresh token ────────────────────────────────────────────────83-84-header "Step 3 / 4 — Get refresh token" \85-  "Open the URL below in your browser, authorize, then paste the code."86-87-AUTH_URL="https://accounts.google.com/o/oauth2/auth?client_id=${CWS_CLIENT_ID}&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/chromewebstore"88-89-echo -e "${BOLD}Open this URL in your browser:${RESET}"90-echo ""91-echo -e "  ${ACCENT}${AUTH_URL}${RESET}"92-echo ""93-94-# Try to open browser automatically95-if command -v open &>/dev/null; then96-  open "$AUTH_URL" 2>/dev/null || true97-elif command -v xdg-open &>/dev/null; then98-  xdg-open "$AUTH_URL" 2>/dev/null || true99-fi100-101-echo -e "${DIM}(Browser may have opened automatically)${RESET}"102-echo ""103-echo -e "${BOLD}Paste the authorization code Google gives you:${RESET}"104-read -r AUTH_CODE105-106-if [ -z "$AUTH_CODE" ]; then107-  fail "Authorization code is required."108-fi109-110-# Exchange code for refresh token111-echo ""112-echo "Exchanging code for refresh token…"113-114-TOKEN_RESPONSE=$(curl -s -X POST https://oauth2.googleapis.com/token \115-  -d "client_id=${CWS_CLIENT_ID}" \116-  -d "client_secret=${CWS_CLIENT_SECRET}" \117-  -d "code=${AUTH_CODE}" \118-  -d "grant_type=authorization_code" \119-  -d "redirect_uri=urn:ietf:wg:oauth:2.0:oob")120-121-CWS_REFRESH_TOKEN=$(echo "$TOKEN_RESPONSE" | grep -o '"refresh_token":"[^"]*"' | cut -d'"' -f4)122-123-if [ -z "$CWS_REFRESH_TOKEN" ]; then124-  echo "Token response: $TOKEN_RESPONSE"125-  fail "Failed to get refresh token. Check your client ID, secret, and auth code."126-fi127-128-success "Got refresh token"129-130-# ─── Step 4: Extension ID ─────────────────────────────────────────────────────131-132-header "Step 4 / 4 — Extension ID" \133-  "Found in the Chrome Web Store Developer Dashboard."134-135-echo -e "${BOLD}Your Chrome extension ID${RESET}"136-echo -e "${DIM}Go to: https://chrome.google.com/webstore/devconsole${RESET}"137-echo -e "${DIM}Click your extension — the ID is in the URL or the item details.${RESET}"138-echo -e "${DIM}Looks like: abcdefghijklmnopqrstuvwxyz123456${RESET}"139-echo ""140-echo -e "${BOLD}Paste your extension ID:${RESET}"141-read -r CWS_EXTENSION_ID142-143-if [ -z "$CWS_EXTENSION_ID" ]; then144-  fail "Extension ID is required."145-fi146-147-# ─── Write to shell profile ───────────────────────────────────────────────────148-149-SHELL_PROFILE="$HOME/.zshrc"150-if [ -f "$HOME/.bashrc" ] && [ ! -f "$HOME/.zshrc" ]; then151-  SHELL_PROFILE="$HOME/.bashrc"152-fi153-154-echo "" >> "$SHELL_PROFILE"155-echo "# Peach Chrome Web Store release credentials" >> "$SHELL_PROFILE"156-echo "export CWS_CLIENT_ID=\"${CWS_CLIENT_ID}\"" >> "$SHELL_PROFILE"157-echo "export CWS_CLIENT_SECRET=\"${CWS_CLIENT_SECRET}\"" >> "$SHELL_PROFILE"158-echo "export CWS_REFRESH_TOKEN=\"${CWS_REFRESH_TOKEN}\"" >> "$SHELL_PROFILE"159-echo "export CWS_EXTENSION_ID=\"${CWS_EXTENSION_ID}\"" >> "$SHELL_PROFILE"160-161-# Clear from memory162-unset CWS_CLIENT_SECRET163-unset CWS_REFRESH_TOKEN164-165-success "Credentials saved to $SHELL_PROFILE"166-167-# ─── Done ─────────────────────────────────────────────────────────────────────168-169-echo ""170-echo -e "${ACCENT}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"171-echo -e "${ACCENT}${BOLD}  Chrome release configured.${RESET}"172-echo -e "${ACCENT}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}"173-echo ""174-echo "Reload your shell:"175-echo ""176-echo -e "  ${ACCENT}source ${SHELL_PROFILE}${RESET}"177-echo ""178-echo "Then to release to both stores:"179-echo ""180-echo -e "  ${ACCENT}npm run release${RESET}"181-echo ""

view file at the parent