Files
Andrew Beveridge ☄️andClaude Opus 5.5 53bc8aa708 infra(cloudflare): remove stale www.app.karaokehunt.com CNAME (#1227)
Removes `www.app.karaokehunt.com` →
`karaokay-karaoke-song-choice-helper-eiqxrt.custom-domain-proxy.flutterflow.app`.
That hostname is the old KaraokeHunt FlutterFlow web app. It no longer
responds, and leaving a CNAME that points at an unclaimed third-party
proxy is a subdomain-takeover risk.

Part of the final decommission of GCP project `projectbread-karaokay`.
`karaokehunt.com`, `www.karaokehunt.com` and `app.karaokehunt.com` still
301-redirect to nomadkaraoke.com.

**Already applied:** `pulumi preview` showed exactly one delete, then
`pulumi up` reported 1 deleted, 135 unchanged. CI doesn't run Pulumi, so
this PR just brings `main` in line with what's live.

Tests: the `infrastructure/cloudflare` tests pass (11).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012RYLVU32bqJHRH3psJ5Udm

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Configuration**
  * Removed the DNS record for `www.app.karaokehunt.com`.
* The separate proxied IPv6 record for `www.karaokehunt.com` remains
configured.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 01:58:05 -04:00
..

nomad-cloudflare: the Nomad Karaoke Cloudflare account as code

Pulumi project for the dedicated Nomad Karaoke Cloudflare account (4585249dcf5d2f9fb4e075c5382cd071, owner admin@nomadkaraoke.com). Stack: nomadkaraoke/prod on Pulumi Cloud (nomadkaraoke/nomad-cloudflare/prod).

It sits beside the GCP platform project in infrastructure/. Both are shared platform IaC: karaoke-gen/infrastructure is the home for infra that isn't specific to one app. App repos keep only app-specific stacks (e.g. karaoke-decide's Cloud Run + its API-proxy Worker).

What's managed here

Module Resources
zones.py The 5 zones (protected) and the ssl mode of each
dns.py 84 DNS records across all zones (exclusions below)
rulesets.py Zone ruleset entrypoints: dynamic redirects (all zones), config settings + origin rules (nomadkaraoke.com: flacfetch), karaokehunt.com's custom WAF rule
email_routing.py Gmail destination address; Email Routing enablement (protected), catch-all and google@ rules for nomadkaraoke.com, nomadkaroke.com, karaokehunt.com
tunnels.py nomad-kjbox (NomadPC: sing, kjbox, kjssh, kjvnc) and nomad-hf2 (fiverrbot) tunnels (protected) + ingress
access.py Zero Trust org (protected), one-time-PIN + Google IdPs (Google OAuth client in GCP nomadkaraoke, secret in Pulumi config googleOauthClientSecret), claude-code-kjbox service token, reusable policies and the KJ Controller / FiverrBot noVNC apps
pages_workers.py Pages projects karaoke-gen + karaoke-gen-tenant, gen.nomadkaraoke.com Pages domain, nomadkaraoke.com/www Worker custom domains, create.karaokehunt.com/* and requests.nomadkaraoke.com/* routes, plus the kjbox-cc-well-known Worker script (kjbox-cc-well-known/worker.js, built by well_known.py) and its kjbox.cc/.well-known/* route

All resource IDs (ids.py) are non-secret. Removing a non-protected resource from code deletes it on the next pulumi up, and pulumi preview always shows that first.

Deliberately NOT managed here

What Owner
api / api-edge-test DNS, nomadkaraoke.com http_request_firewall_custom / http_ratelimit / http_request_late_transform phases, security_level GCP platform project, infrastructure/modules/edge_security.py
Tenant portal CNAMEs (<tenant>.nomadkaraoke.com) and karaoke-gen-tenant custom domains Created at runtime by backend/services/tenant_domain_service.py
decide.nomadkaraoke.com/api/* route + karaoke-decide-api-proxy Worker karaoke-decide's Pulumi stack
Worker/Pages code deploys gen CI (wrangler pages deploy), public-website Workers Builds, karaokehunt-interceptor/deploy.sh (its route + DNS "ensure" steps match what's declared here), requests-host/deploy.sh (script only)
Read-only DNS records (Email Routing MX/DKIM, Worker custom-domain AAAAs) Owned by Email Routing / Workers custom domains
karaokehunt.com http_config_settings ("SSL for create.karaokehunt.com", "Disable challenge for create API") Dashboard. pulumi-cloudflare 6.22.1 drops set_config bic:false, so every refresh fails
Tunnel connector tokens / cloudflared processes NomadPC systemd cloudflared-nomad, hf2 ~/nomad-tunnel compose
Registrar, billing, API tokens, account members Dashboard (admin@nomadkaraoke.com)

kjbox.cc/.well-known/assetlinks.json (Android App Links) and apple-app-site-association (iOS universal links) are served by the kjbox-cc-well-known Worker, routes kjbox.cc/.well-known/* and www.kjbox.cc/.well-known/* (scheme-agnostic, so http and https). The JSON mirrors what the kjbox box serves on sing.nomadkaraoke.com. The kjbox.cc/<code> redirect rule excludes /.well-known/ so the Worker answers instead of redirecting. Android SHA-256 cert fingerprints come from Pulumi config, baked into the script at deploy time (empty list = assetlinks.json is []):

pulumi config set --path 'kjboxcc_android_sha256_fingerprints[0]' 'AA:BB:...'   # then pulumi up

Usage

cd infrastructure/cloudflare
python3 -m venv venv && venv/bin/pip install -r requirements.txt   # first time
pulumi stack select nomadkaraoke/prod
pulumi preview      # must be clean (0 changes) before you start
# edit code, preview, then:
pulumi up

Unit tests (import-list builder, kjbox.cc well-known Worker; the Worker tests need node): venv/bin/pip install pytest && venv/bin/python -m pytest tests -c /dev/null (-c /dev/null skips the repo-root pytest config, which needs the backend's plugins).

As with the GCP project, CI does not run Pulumi. Apply locally, then merge the PR.

The cloudflare:apiToken in Pulumi.prod.yaml is the account-owned token nomad-cloudflare-pulumi. It is scoped to zones/DNS/rules/email routing/Workers routes on all zones, plus tunnels/Access/Pages/Worker domains on the account, and cannot manage tokens or billing.

Adopting resources created outside Pulumi

scripts/build_import_list.py lists the account's resources minus the exclusions above in pulumi import --file format:

source ../../../.envrc   # workspace: CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID (Nomad account)
python3 scripts/build_import_list.py > /tmp/import.json
# keep only the new entries, then:
pulumi import --file /tmp/import.json --out /tmp/generated.py

Paste the generated code into the right module, replace literal IDs with ACCOUNT_ID / ZONE_IDS[...], and drop protect=True unless it belongs to the protected set above.

Provider gotchas (pulumi-cloudflare 6.22.1)

  • Codegen drops false values. It lost bic: false above, and support_subaddress=False must be explicit on EmailRoutingSettings or every preview shows a no-op update.
  • After an import, Email Routing / Access resources can show an "update" with no property diff. It is a one-time state settlement, and applying it was verified as a live no-op (2026-10-15).
  • Reusable Access policies default to a 24h session. Set session_duration to match the app (730h).
  • ZeroTrustAccessApplication: use destinations, not the deprecated self_hosted_domains (both together fail validation).