From fd54a4926c4f210c103c57a4db1e818bc374f855 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sat, 19 Oct 2024 15:32:00 +0200 Subject: [PATCH] migrate to pacia.tech domain from karolak.cc domain --- backend/e2e/http-client.env.json | 2 +- backend/internal/server/webhook/webhook.go | 4 ++- infra-do/env.tf | 4 +-- infra-do/main.tf | 36 ++++++++++++++-------- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/backend/e2e/http-client.env.json b/backend/e2e/http-client.env.json index 8c6fcfc..7615f83 100644 --- a/backend/e2e/http-client.env.json +++ b/backend/e2e/http-client.env.json @@ -6,7 +6,7 @@ }, "prod": { "server": { - "url": "https://beeci-backend.karolak.cc/backend" + "url": "https://bee-ci.pacia.tech/backend" } } } diff --git a/backend/internal/server/webhook/webhook.go b/backend/internal/server/webhook/webhook.go index fa8501f..40caddc 100644 --- a/backend/internal/server/webhook/webhook.go +++ b/backend/internal/server/webhook/webhook.go @@ -33,7 +33,9 @@ type WebhookHandler struct { buildRepo data.BuildRepo // The domain where the auth cookie will be placed. For example - // ".pacia.tech" or ".karolak.cc". Must be empty for localhost. + // ".pacia.tech" or ".karolak.cc". + // + // Must be empty for localhost. mainDomain string // The URL the user will be redirected to after successful auth. For example diff --git a/infra-do/env.tf b/infra-do/env.tf index 1b9676e..afac630 100644 --- a/infra-do/env.tf +++ b/infra-do/env.tf @@ -10,12 +10,12 @@ locals { }, { key = "MAIN_DOMAIN", - value = ".karolak.cc", + value = ".pacia.tech", scope = "RUN_TIME", }, { key = "REDIRECT_URL", - value = "https://beeci.karolak.cc/dashboard", + value = "https://app.bee-ci.pacia.tech/dashboard", scope = "RUN_TIME" }, /* diff --git a/infra-do/main.tf b/infra-do/main.tf index 4070e54..ceb53dc 100644 --- a/infra-do/main.tf +++ b/infra-do/main.tf @@ -37,19 +37,29 @@ resource "digitalocean_project" "project" { ] } +// General: +// +// CNAME bee-ci.pacia.tech bee-ci-tf-rqd3k.ondigitalocean.app +// +// For Vercel: +// +// CNAME app.bee-ci.pacia.tech cname.vercel-dns.com +// TXT _vercel.pacia.tech vc-domain-verify=app.bee-ci.pacia.tech,9f0455b9ebb2cffa2f86 +// +// Ideally, we can get rid of Vercel, but it's blocked by: +// https://stackoverflow.com/questions/79029275/digital-ocean-app-platform-nextresponse-redirect-doesnt-work-status-code-2 + resource "digitalocean_app" "app" { spec { name = "bee-ci-tf" region = "sfo" - # domain { - # # name = "beeci-backend.ondigitalocean.app" - # type = "DEFAULT" - # } - + // Requires the following record to be set on domain "pacia.tech" + // Type | Hostname | Value + // CNAME | bee-ci.pacia.tech | bee-ci-tf-rqd3k.ondigitalocean.app (or whatever DO generated) domain { - name = "beeci-backend.karolak.cc" + name = "bee-ci.pacia.tech" type = "PRIMARY" } @@ -231,10 +241,10 @@ resource "digitalocean_record" "backend" { */ -resource "digitalocean_domain" "old" { - name = "bee-ci.karolak.cc" -} - -resource "digitalocean_domain" "new" { - name = "beeci-backend.karolak.cc" -} +# resource "digitalocean_domain" "old" { +# name = "bee-ci.karolak.cc" +# } +# +# resource "digitalocean_domain" "new" { +# name = "beeci-backend.karolak.cc" +# }