Domains, DNS, Email & Staging Auth
Final cutover — point insigz.com (GoDaddy) at Cloud Run, password-gate staging, enable Resend email.
Status: planned (final cutover step). Do this last, once the verticals are stable. It is the prerequisite for transactional email (Resend) and SMS/voice (Twilio). The domain
insigz.comis managed by the owner on GoDaddy. Tracked in the build plan andPROJECT_STATE.
1. Subdomain scheme
| Host | Target | Public? |
|---|---|---|
insigz.com, www.insigz.com | marketing site (when built); until then redirect to app.insigz.com | public |
app.insigz.com | prod insigz-app (Cloud Run) | public |
staging.insigz.com | staging insigz-app | public, password-gated |
docs.insigz.com | prod insigz-docs | public |
| insigz-ai | none — internal only | — |
2. DNS approach — pick one
Option 1 — delegate DNS to Cloud DNS (recommended for automation)
- Create a managed zone in project
insigz:gcloud dns managed-zones create insigz --dns-name=insigz.com. --description="insigz" --project=insigz - Read the 4 nameservers:
gcloud dns managed-zones describe insigz --project=insigz --format="value(nameServers)" - In GoDaddy → Domain → Nameservers, switch to "Custom" and enter those 4 NS. Propagation: up to 24–48h.
- From then on, all records (Cloud Run mappings, Resend) are managed with
gcloud dns record-sets ....
Trade-off: DNS editing leaves GoDaddy and lives in GCP.
Option 2 — keep GoDaddy as DNS host
Keep GoDaddy DNS; add the records below in GoDaddy → DNS → Records by hand. More manual, no nameserver change.
3. Cloud Run custom domains
One-time: verify domain ownership (Google gives a TXT record to add). Then map each host:
gcloud beta run domain-mappings create --service=insigz-app --domain=app.insigz.com --region=europe-west6 --project=insigz
gcloud beta run domain-mappings create --service=insigz-app-staging --domain=staging.insigz.com --region=europe-west6 --project=insigz
gcloud beta run domain-mappings create --service=insigz-docs --domain=docs.insigz.com --region=europe-west6 --project=insigzEach prints DNS records to add:
- Subdomains (
app,staging,docs): aCNAMEtoghs.googlehosted.com. - Apex (
insigz.com):A/AAAArecords to the Google IPs the mapping returns.
Google-managed TLS provisions automatically (15–60 min). For apex-on-load-balancer or IAP, use a Global External HTTPS Load Balancer with a serverless NEG instead of a direct mapping.
4. Staging password protection
Cloud Run has no built-in basic auth. Add a Next.js middleware in insigz-app that, when the env
STAGING_BASIC_AUTH is set (staging service only), requires HTTP Basic auth matching it and returns
401 otherwise. Production leaves the env unset, so there is no gate.
- Secret:
insigz-staging-basic-auth(valueuser:pass), injected on the staging deploy only. - Alternative: Identity-Aware Proxy (IAP) via a Load Balancer for Google-login gating (heavier).
5. Email — Resend domain verification
To send from @insigz.com (invoices, notifications):
- Resend → Domains → add
insigz.com(orsend.insigz.com). - Add the records Resend shows to DNS:
- DKIM: about 3
CNAMErecords (resend._domainkey...). - SPF: a
TXT(v=spf1 include:...resend... ~all) or a return-pathCNAME. - DMARC (recommended):
TXTat_dmarc.insigz.com=v=DMARC1; p=none; rua=mailto:....
- DKIM: about 3
- After "Verified", set
RESEND_FROM_EMAIL="insigz <noreply@insigz.com>"andRESEND_API_KEY(secretsinsigz-resend-api-key-staging/-prod); wirelib/email.ts(adapt MOB/Kiwano).
Twilio (later, for SMS/voice): API keys only (insigz-twilio-* secrets), minimal/no DNS.
6. What the owner must do / access needed
- Claude cannot access GoDaddy. Choose: (a) make the DNS edits yourself, (b) delegate DNS to Cloud DNS (Option 1) so Claude manages records, or (c) provide a GoDaddy API key + secret for Claude to script via the GoDaddy API.
- Confirm the DNS approach, repoint nameservers (Option 1) or paste records (Option 2), and provide the Resend API key when email is wanted.
7. Execution order
- Verify domain ownership (TXT).
- Cloud Run domain mappings (
app./staging./docs./ apex). - Add the DNS records (Option 1 or 2).
- Ship the staging basic-auth middleware.
- Resend domain verification + wire email.
- Update
NEXT_PUBLIC_SERVER_URL/SERVER_URL/INSIGZ_AI_URL/INSIGZ_APP_URLenvs + CI to the new hostnames; redeploy all services. - (Later) Twilio.