From a2fe7b2b49d8189686a6b0826a2dba1e30f3ec76 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sat, 19 Oct 2024 15:31:44 +0200 Subject: [PATCH 1/2] update frontend --- frontend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend b/frontend index d5a60c1..45b6063 160000 --- a/frontend +++ b/frontend @@ -1 +1 @@ -Subproject commit d5a60c1f4088c12c48680d408f359e6351b858bf +Subproject commit 45b606325586252c3b1ecdd30add2c4ab144293b From d0b9b5b24854f8d87abca00524d49aa281d4d554 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Sat, 19 Oct 2024 15:32:00 +0200 Subject: [PATCH 2/2] 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 | 35 ++++++++++------------ 4 files changed, 22 insertions(+), 23 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..d6e440f 100644 --- a/infra-do/main.tf +++ b/infra-do/main.tf @@ -28,28 +28,35 @@ resource "digitalocean_project" "project" { digitalocean_app.app.urn, digitalocean_database_cluster.postgres.urn, digitalocean_database_cluster.redis.urn, - digitalocean_domain.old.urn, - digitalocean_domain.new.urn, digitalocean_droplet.executor.urn, digitalocean_droplet.influxdb.urn, digitalocean_volume.influxdb_volume.urn, - # digitalocean_domain.main.urn, ] } +// 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" } @@ -202,7 +209,6 @@ resource "digitalocean_container_registry_docker_credentials" "default" { } /* - resource "digitalocean_domain" "main" { name = "bee-ci.pacia.tech" } @@ -228,13 +234,4 @@ resource "digitalocean_record" "backend" { # value = format("%s.", digitalocean_app.app.live_domain) # value = format("%s.", digitalocean_app.app.live_domain) } - */ - -resource "digitalocean_domain" "old" { - name = "bee-ci.karolak.cc" -} - -resource "digitalocean_domain" "new" { - name = "beeci-backend.karolak.cc" -}