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" } 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" {