[object Object]

← back to Wholivedthere

migrate GoDaddy auth → Bearer PAT (TK-10 key rotation); sso-key fallback retained

864bb1c4ae8d9f9d0ac0ee46be533555b188bc17 · 2026-07-27 20:05:44 -0700 · Steve Abrams

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 864bb1c4ae8d9f9d0ac0ee46be533555b188bc17
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jul 27 20:05:44 2026 -0700

    migrate GoDaddy auth → Bearer PAT (TK-10 key rotation); sso-key fallback retained
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 scripts/deploy-direct.sh   | 10 +++++++---
 scripts/deploy-pastdoor.sh | 10 +++++++---
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/scripts/deploy-direct.sh b/scripts/deploy-direct.sh
index 0ab4066..d3715f2 100755
--- a/scripts/deploy-direct.sh
+++ b/scripts/deploy-direct.sh
@@ -20,19 +20,23 @@ SCRIPT_DIR="$(dirname "$0")"
 
 GD_KEY="${GODADDY_API_KEY:-}"
 GD_SECRET="${GODADDY_API_SECRET:-}"
+GD_PAT="${GODADDY_PAT:-}"
 
-if [[ -z "$GD_KEY" || -z "$GD_SECRET" ]]; then
-  echo "ERROR: GODADDY_API_KEY and GODADDY_API_SECRET must be set in the environment."
+if [[ -z "$GD_PAT" && ( -z "$GD_KEY" || -z "$GD_SECRET" ) ]]; then
+  echo "ERROR: GODADDY_PAT, or GODADDY_API_KEY and GODADDY_API_SECRET, must be set in the environment."
   exit 1
 fi
 
+# Prefer a Bearer Personal Access Token (TK-10 key rotation); fall back to legacy sso-key.
+if [[ -n "$GD_PAT" ]]; then GD_AUTH="Bearer $GD_PAT"; else GD_AUTH="sso-key $GD_KEY:$GD_SECRET"; fi
+
 echo "============================================================"
 echo "Step 1/7: Add A records to each domain via GoDaddy API"
 echo "============================================================"
 for D in "${DOMAINS[@]}"; do
   for NAME in "@" "www"; do
     RESP=$(curl -sS -X PUT "https://api.godaddy.com/v1/domains/$D/records/A/$NAME" \
-      -H "Authorization: sso-key $GD_KEY:$GD_SECRET" \
+      -H "Authorization: $GD_AUTH" \
       -H "Content-Type: application/json" \
       --data "[{\"data\":\"$KAMATERA_IP\",\"ttl\":600}]" \
       -w "HTTP_CODE_%{http_code}")
diff --git a/scripts/deploy-pastdoor.sh b/scripts/deploy-pastdoor.sh
index 538062f..441c979 100755
--- a/scripts/deploy-pastdoor.sh
+++ b/scripts/deploy-pastdoor.sh
@@ -27,13 +27,17 @@ DOMAINS=(wholivedthere.com claimmyaddress.com bubbesblock.com)
 
 GD_KEY="${GODADDY_API_KEY:-}"
 GD_SECRET="${GODADDY_API_SECRET:-}"
+GD_PAT="${GODADDY_PAT:-}"
 CF_TOKEN="${CLOUDFLARE_API_TOKEN:-}"
 
-if [[ -z "$GD_KEY" || -z "$GD_SECRET" ]]; then
-  echo "ERROR: GODADDY_API_KEY and GODADDY_API_SECRET must be set in the environment."
+if [[ -z "$GD_PAT" && ( -z "$GD_KEY" || -z "$GD_SECRET" ) ]]; then
+  echo "ERROR: GODADDY_PAT, or GODADDY_API_KEY and GODADDY_API_SECRET, must be set in the environment."
   exit 1
 fi
 
+# Prefer a Bearer Personal Access Token (TK-10 key rotation); fall back to legacy sso-key.
+if [[ -n "$GD_PAT" ]]; then GD_AUTH="Bearer $GD_PAT"; else GD_AUTH="sso-key $GD_KEY:$GD_SECRET"; fi
+
 if [[ -z "$CF_TOKEN" ]]; then
   echo "ERROR: \$CLOUDFLARE_API_TOKEN not set. Generate one with Zone:DNS:Edit on all 3 zones."
   exit 1
@@ -130,7 +134,7 @@ for D in "${DOMAINS[@]}"; do
   ZONE=$(curl -sS -H "Authorization: Bearer $CF_TOKEN" "https://api.cloudflare.com/client/v4/zones?name=$D")
   NS=$(echo "$ZONE" | jq -c '.result[0].name_servers')
   curl -sS -X PATCH "https://api.godaddy.com/v1/domains/$D" \
-    -H "Authorization: sso-key $GD_KEY:$GD_SECRET" \
+    -H "Authorization: $GD_AUTH" \
     -H "Content-Type: application/json" \
     --data "{\"nameServers\":$NS}" \
     -w "  $D NS update HTTP %{http_code}\n"

← d3affad chore: macstudio3 migration — reconcile from mac2 + repoint  ·  back to Wholivedthere  ·  (newest)