Skip to content

Commit 234bdc8

Browse files
authored
fix(console): stop managing the opencode.ai custom domain from the old Console (#62381)
1 parent 682dd25 commit 234bdc8

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

‎infra/console.ts‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
1-
import { domain } from "./stage"
1+
import { domain, zoneID } from "./stage"
22
import { EMAILOCTOPUS_API_KEY } from "./app"
33

4+
// opencode.ai and dev.opencode.ai belong to the site Worker (services/site) now, so the old Console Worker gets
5+
// no custom domain there. Its custom domain was moved to the site Worker in place, keeping its ID (Cloudflare
6+
// won't let a placeholder DNS record sit beside a Worker-managed one, and deleting the record first would leave
7+
// the apex without DNS). SiteDomain adopts that resource so SST stops managing it without deleting the live
8+
// hostname: it is retained on delete, and its inputs are ignored so it is never updated or replaced.
9+
const siteOwnsDomain = $app.stage === "production" || $app.stage === "dev"
10+
if (siteOwnsDomain) {
11+
new cloudflare.WorkersCustomDomain(
12+
"SiteDomain",
13+
{
14+
accountId: "15d29c8639fd3733b1b5486a2acfd968",
15+
hostname: domain,
16+
service: `opencode-site-${$app.stage}`,
17+
zoneId: zoneID,
18+
environment: "production",
19+
},
20+
{
21+
aliases: [
22+
`urn:pulumi:${$app.stage}::${$app.name}::sst:cloudflare:SolidStart$sst:cloudflare:Worker$cloudflare:index/workersCustomDomain:WorkersCustomDomain::ConsoleWorkerDomain`,
23+
],
24+
retainOnDelete: true,
25+
ignoreChanges: ["accountId", "hostname", "service", "zoneId", "environment"],
26+
},
27+
)
28+
}
29+
430
// Archived Zen request/response dumps (writer removed May 2026). Retained on purpose; nothing reads or writes them.
531
new sst.cloudflare.Bucket("ZenData")
632
new sst.cloudflare.Bucket("ZenDataNew")
@@ -19,7 +45,7 @@ const SALESFORCE_CLIENT_SECRET = new sst.Secret("SALESFORCE_CLIENT_SECRET")
1945
const SALESFORCE_INSTANCE_URL = new sst.Secret("SALESFORCE_INSTANCE_URL")
2046

2147
new sst.cloudflare.x.SolidStart("Console", {
22-
domain,
48+
domain: siteOwnsDomain ? undefined : domain,
2349
path: "packages/console/app",
2450
link: [
2551
EMAILOCTOPUS_API_KEY,

0 commit comments

Comments
 (0)