From e616835afe54b76f5e5d23a504d0011ad89cc7de Mon Sep 17 00:00:00 2001 From: Madraka <8898640+Madraka@users.noreply.github.com> Date: Wed, 21 Oct 2026 21:55:34 +0300 Subject: [PATCH] feat: serve Studio at studio.cloudhal.com domains.studio in cloudhal.json makes the deploy add studio.cloudhal.com as a custom domain of the admin Worker. Wrangler turns workers.dev off for a Worker with routes, so the post-deploy check now asks studio.cloudhal.com, and waits up to three minutes for the new certificate. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com> --- README.md | 2 +- cloudhal.json | 3 ++- scripts/post-deploy-check.mjs | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a2ff32d..57636ae 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,4 @@ The deployment token comes from a local `cloudhal deploy` (`.cloudhal/deploy/sec ## Domains -`cloudhal.com` serves the site; Studio runs on the admin Worker's workers.dev address. `www.cloudhal.com` should 301 to `https://cloudhal.com` through a Cloudflare Redirect Rule on the zone. +`cloudhal.com` serves the site and `studio.cloudhal.com` serves Studio (`domains` in `cloudhal.json`; the deploy adds both as Workers custom domains, which turns the workers.dev addresses off). `www.cloudhal.com` should 301 to `https://cloudhal.com` through a Cloudflare Redirect Rule on the zone. diff --git a/cloudhal.json b/cloudhal.json index 78f8e87..7e7405e 100644 --- a/cloudhal.json +++ b/cloudhal.json @@ -8,6 +8,7 @@ "available": false }, "domains": { - "site": "cloudhal.com" + "site": "cloudhal.com", + "studio": "studio.cloudhal.com" } } diff --git a/scripts/post-deploy-check.mjs b/scripts/post-deploy-check.mjs index 8d28e57..ff2ce48 100644 --- a/scripts/post-deploy-check.mjs +++ b/scripts/post-deploy-check.mjs @@ -1,15 +1,15 @@ // After `cloudhal deploy` in Workers Builds: the site and Studio must answer. If either does not -// within ~2 minutes, both Workers are rolled back to their previous version and the build fails, -// so a bad release never stays live on cloudhal.com. +// within ~3 minutes (a new custom domain may still wait for its certificate), both Workers are +// rolled back to their previous version and the build fails, so a bad release never stays live. import { execFileSync } from "node:child_process"; const CHECKS = [ { name: "site", url: "https://cloudhal.com/", worker: "cloudhal-com-site" }, - { name: "studio", url: "https://cloudhal-com-admin.yemek.workers.dev/api/health", worker: "cloudhal-com-admin" }, + { name: "studio", url: "https://studio.cloudhal.com/api/health", worker: "cloudhal-com-admin" }, ]; async function healthy(url) { - for (let i = 0; i < 12; i++) { + for (let i = 0; i < 18; i++) { try { const res = await fetch(url, { redirect: "manual", headers: { "cache-control": "no-cache" } }); if (res.status === 200) return true;