From 4ab3af44be858c097a72dc4355c511da355a6027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20Gr=C3=A6sberg?= Date: Fri, 27 Nov 2026 14:50:53 +0100 Subject: [PATCH 1/2] Update terraform for new domain and cloudflare zone --- infra/cloud/prod/containers.tf | 4 ++-- infra/cloud/prod/dns.tf | 17 ++++++++++++++--- infra/cloud/prod/vars.tf | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/infra/cloud/prod/containers.tf b/infra/cloud/prod/containers.tf index 6366784..a8aa395 100644 --- a/infra/cloud/prod/containers.tf +++ b/infra/cloud/prod/containers.tf @@ -118,8 +118,8 @@ resource "azurerm_container_app" "backend_container" { # ------------------------------------------------------------------ # Frontend - TanStack Start / Nitro on port 3000. -# The only publicly exposed app; served at gspotter.graesberg.com through -# Cloudflare. Nitro proxies /graphql to the internal backend and SSR +# The only publicly exposed app; served at the domain configured in vars.tf +# through Cloudflare. Nitro proxies /graphql to the internal backend and SSR # loaders fetch BACKEND_URL directly. # ------------------------------------------------------------------ diff --git a/infra/cloud/prod/dns.tf b/infra/cloud/prod/dns.tf index eb9001b..4c13394 100644 --- a/infra/cloud/prod/dns.tf +++ b/infra/cloud/prod/dns.tf @@ -60,8 +60,10 @@ resource "tls_cert_request" "origin" { } resource "cloudflare_origin_ca_certificate" "origin" { - csr = tls_cert_request.origin.cert_request_pem - hostnames = [local.app_fqdn, var.domain, "*.${var.domain}"] + csr = tls_cert_request.origin.cert_request_pem + // Cloudflare returns hostnames sorted, so keep the config ordered to avoid + // a perpetual destroy/create diff. + hostnames = sort([local.app_fqdn, var.domain, "*.${var.domain}"]) request_type = "origin-rsa" requested_validity = 5475 // 15 years } @@ -90,8 +92,17 @@ resource "azurerm_container_app_environment_certificate" "origin" { } // Let the asuid TXT record propagate before Azure validates domain ownership. +// The triggers make the wait re-run whenever the domain or zone changes (e.g. +// migrating zones); otherwise an existing sleep is reused and Azure can +// validate before the new records have propagated. resource "time_sleep" "dns_propagation" { - depends_on = [cloudflare_dns_record.app_asuid] + depends_on = [cloudflare_dns_record.app_asuid] + + triggers = { + zone_id = var.cloudflare_zone_id + app_fqdn = local.app_fqdn + } + create_duration = "60s" } diff --git a/infra/cloud/prod/vars.tf b/infra/cloud/prod/vars.tf index 27ffed0..d7b4489 100644 --- a/infra/cloud/prod/vars.tf +++ b/infra/cloud/prod/vars.tf @@ -19,7 +19,7 @@ variable "neon_api_key" { variable "domain" { type = string - default = "graesberg.com" + default = "rsmafia.org" } variable "app_subdomain" { From b5c0fc88ed47b9c9fffec274388b558c6ab8f2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry=20Gr=C3=A6sberg?= Date: Fri, 27 Nov 2026 14:56:07 +0100 Subject: [PATCH 2/2] Point the mock-location notice at the new deployment domain The deployment moved from gspotter.graesberg.com to gspotter.rsmafia.org when the app was migrated to the new Cloudflare zone. Update the public deployment link shown in the mock-location notice so users on plain-HTTP origins are sent to the live app instead of the retired domain. Also format the bootstrap role assignment with terraform fmt. --- apps/frontend/src/components/MockLocationNotice.tsx | 2 +- infra/cloud/bootstrap/main.tf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/frontend/src/components/MockLocationNotice.tsx b/apps/frontend/src/components/MockLocationNotice.tsx index 2a7253e..637d6e1 100644 --- a/apps/frontend/src/components/MockLocationNotice.tsx +++ b/apps/frontend/src/components/MockLocationNotice.tsx @@ -28,7 +28,7 @@ export default function MockLocationNotice() { {' '} or the diff --git a/infra/cloud/bootstrap/main.tf b/infra/cloud/bootstrap/main.tf index 9ce7de9..94b2d4a 100644 --- a/infra/cloud/bootstrap/main.tf +++ b/infra/cloud/bootstrap/main.tf @@ -38,7 +38,7 @@ resource "azurerm_storage_container" "bootstrap" { } resource "azurerm_role_assignment" "blob_data_owner" { - scope = azurerm_storage_account.bootstrap.id - role_definition_name = "Storage Blob Data Owner" - principal_id = "0e18a31c-3e2e-4901-87f8-9cdfdd922242" + scope = azurerm_storage_account.bootstrap.id + role_definition_name = "Storage Blob Data Owner" + principal_id = "0e18a31c-3e2e-4901-87f8-9cdfdd922242" }