From f8eb682a110d35055c79d3d278c13b5bdf87f034 Mon Sep 17 00:00:00 2001 From: Shay Palachy Date: Sun, 2 Aug 2026 12:21:02 +0300 Subject: [PATCH] fix(deploy): target personal Cloudflare account for ShmuggingFace preview The ShmuggingFace pre-publication preview site was deployed from the Adanim Cloudflare account via a hardcoded default env path (~/.config/adanim/cloudflare_api_token.env). LeadForge is Shay's open-source project, not an Adanim one, so the deploy must use the personal account (shaypal5@gmail.com). - Default --cf-env now points at ~/.config/pagent/personal/cloudflare/cloudflare_api_token.env. - Stop synthesising the "Live at" hostname from the project name: on the personal account the pages.dev subdomain is Cloudflare-assigned and suffixed (leadforge-lead-scoring-v1-preview-een.pages.dev) because the unsuffixed name is globally held by the retired Adanim project. Point the operator at wrangler's own printed URLs instead. - Sync package-lock.json to the already-pinned wrangler 4.95.0 / node>=22 from package.json (the lock still carried wrangler "latest" / node>=20), so deploys use the pinned wrangler rather than an unpinned global. The project name is unchanged; only the account boundary and the operator-facing URL hint move. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01GyE9JharCHhX8sCi9ShTLn --- package-lock.json | 4 ++-- scripts/build_shmuggingface_site.py | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7029e93..f73c30e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,10 +9,10 @@ "@shmuggingface/core": "https://github.com/ShmuggingFace/ShmuggingFaceCore/archive/refs/tags/v1.0.2.tar.gz" }, "devDependencies": { - "wrangler": "latest" + "wrangler": "4.95.0" }, "engines": { - "node": ">=20" + "node": ">=22" } }, "node_modules/@cloudflare/kv-asset-handler": { diff --git a/scripts/build_shmuggingface_site.py b/scripts/build_shmuggingface_site.py index 9c05fde..c30c07d 100644 --- a/scripts/build_shmuggingface_site.py +++ b/scripts/build_shmuggingface_site.py @@ -35,8 +35,10 @@ requires a separate flag so a local run never clobbers the live site by accident. --cf-env PATH - Cloudflare env file to source before wrangler. - Default: ``~/.config/adanim/cloudflare_api_token.env``. + Cloudflare env file to source before wrangler. Must target Shay's + *personal* Cloudflare account (``shaypal5@gmail.com``) — LeadForge is + an open-source project, not an Adanim one. + Default: ``~/.config/pagent/personal/cloudflare/cloudflare_api_token.env``. --project-name NAME Cloudflare Pages project name. Default: ``leadforge-lead-scoring-v1-preview``. @@ -70,7 +72,9 @@ GITHUB_BLOB_RELEASE = f"{GITHUB_BLOB_BASE}/release" # Pinned via package.json → package-lock.json; `npm install` resolves it. SMF_CORE_NPM = Path(__file__).parent.parent / "node_modules/@shmuggingface/core" -DEFAULT_CF_ENV = Path.home() / ".config/adanim/cloudflare_api_token.env" +# LeadForge is Shay's open-source project — deploy from the personal +# Cloudflare account (shaypal5@gmail.com), never the Adanim account. +DEFAULT_CF_ENV = Path.home() / ".config/pagent/personal/cloudflare/cloudflare_api_token.env" DEFAULT_PROJECT = "leadforge-lead-scoring-v1-preview" TIER_LABEL = {"intro": "Intro", "intermediate": "Intermediate", "advanced": "Advanced"} @@ -528,9 +532,15 @@ def deploy_site( if result.returncode != 0: sys.exit(f"Deployment failed (wrangler exit code {result.returncode})") - suffix = "" if production else "/preview" + # Do not synthesise the hostname from the project name: on the + # personal account the ``…pages.dev`` subdomain is Cloudflare-assigned + # and suffixed (e.g. ``leadforge-lead-scoring-v1-preview-een.pages.dev``) + # because the unsuffixed name is globally taken by the retired + # Adanim-account project. Wrangler prints the real immutable + + # stable URLs above; point the operator at those. print( - f"\n Live at: https://{project_name}.pages.dev{suffix}", + "\n Deployment complete — see the immutable and stable URLs " + "printed by wrangler above.", file=sys.stderr, )