| | @@ -233,7 +233,7 @@ |
| 233 | 233 | |
| 234 | 234 | if ! listed=$(wrangler containers images list --json --filter "(^|/)$name\$" 2>&1); then |
| 235 | 235 | diff --git a/scripts/setup.sh b/scripts/setup.sh |
| 236 | | -index 7989e5c..8d87fe1 100755 |
| 236 | +index 7989e5c..1db5aea 100755 |
| 237 | 237 | --- a/scripts/setup.sh |
| 238 | 238 | +++ b/scripts/setup.sh |
| 239 | 239 | @@ -19,6 +19,12 @@ |
| | @@ -308,7 +308,7 @@ |
| 308 | 308 | step "Finishing the Access setup (first deploy)" |
| 309 | 309 | : >"$OUTPUTS" |
| 310 | 310 | GITHUB_OUTPUT="$OUTPUTS" "$ROOT/scripts/bootstrap.sh" |
| 311 | | -@@ -237,12 +252,18 @@ for _ in $(seq 1 30); do |
| 311 | +@@ -237,12 +252,21 @@ for _ in $(seq 1 30); do |
| 312 | 312 | [[ "$code" == 200 ]] && break |
| 313 | 313 | sleep 10 |
| 314 | 314 | done |
| | @@ -319,7 +319,11 @@ |
| 319 | 319 | + [[ "$code" == 200 ]] || die "https://$DIFFINERY_DOMAIN/healthz did not return 200 (last: ${code:-no answer}). Check that $DIFFINERY_DOMAIN resolves to the host serving $CF_API and that the Worker started." |
| 320 | 320 | +fi |
| 321 | 321 | info "/healthz -> 200" |
| 322 | | - curl -sS "https://$DIFFINERY_DOMAIN/login" | grep -q "Sign in with a passkey" || die "/login is not the Diffinery sign-in page: check DIFFINERY_DOMAIN, DIFFINERY_ZONE and the route in apps/diffinery/wrangler.deploy.jsonc" |
| 322 | +-curl -sS "https://$DIFFINERY_DOMAIN/login" | grep -q "Sign in with a passkey" || die "/login is not the Diffinery sign-in page: check DIFFINERY_DOMAIN, DIFFINERY_ZONE and the route in apps/diffinery/wrangler.deploy.jsonc" |
| 323 | ++# Read the whole page before matching: `curl | grep -q` fails under pipefail when grep stops |
| 324 | ++# early and curl can't finish writing (curl: (23) Failed writing body). |
| 325 | ++LOGIN_PAGE="$(curl -sS "https://$DIFFINERY_DOMAIN/login" || true)" |
| 326 | ++grep -q "Sign in with a passkey" <<<"$LOGIN_PAGE" || die "/login is not the Diffinery sign-in page: check DIFFINERY_DOMAIN, DIFFINERY_ZONE and the route in apps/diffinery/wrangler.deploy.jsonc" |
| 323 | 327 | info "/login serves the passkey sign-in page" |
| 324 | 328 | loc="$(curl -sS -o /dev/null -w '%{http_code} %{redirect_url}' "https://$DIFFINERY_DOMAIN/auth/access" || true)" |
| 325 | 329 | -if [[ "$loc" == 302\ https://*.cloudflareaccess.com/* ]]; then |
| | @@ -329,7 +333,7 @@ |
| 329 | 333 | info "/auth/access is behind Cloudflare Access" |
| 330 | 334 | else |
| 331 | 335 | warn "/auth/access is not behind Cloudflare Access yet ($loc), so email recovery and the first admin sign-in won't work. Set ACCESS_TEAM_DOMAIN and run this again." |
| 332 | | -@@ -252,4 +273,4 @@ echo |
| 336 | +@@ -252,4 +276,4 @@ echo |
| 333 | 337 | echo "Diffinery is live at https://$DIFFINERY_DOMAIN." |
| 334 | 338 | echo "Sign in as the first administrator at https://$DIFFINERY_DOMAIN/auth/access with an email in BOOTSTRAP_ADMINS," |
| 335 | 339 | echo "then add a passkey. Run scripts/setup.sh again at any time to update." |