Skip to content

Commit 9954fe0

Browse files
authored
chore(infra): drop SiteDomain and retain zen buckets and trust dns before untracking (#62938)
1 parent f997cef commit 9954fe0

2 files changed

Lines changed: 41 additions & 43 deletions

File tree

‎infra/console.ts‎

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,19 @@
1-
import { domain, zoneID } from "./stage"
2-
3-
// opencode.ai and dev.opencode.ai belong to the site Worker (services/site). Their custom domain used to belong to
4-
// the old Console Worker and was moved to the site Worker in place, keeping its ID (Cloudflare won't let a placeholder
5-
// DNS record sit beside a Worker-managed one, and deleting the record first would leave the apex without DNS).
6-
// SiteDomain adopts that resource so SST never deletes the live hostname: it is retained on delete, and its inputs are
7-
// ignored so it is never updated or replaced. Its state still records the old Console service; Cloudflare has the
8-
// site Worker. Keep it declared: dropping it only forgets it (retainOnDelete), but keeping it is a guaranteed no-op.
9-
if ($app.stage === "production" || $app.stage === "dev") {
10-
new cloudflare.WorkersCustomDomain(
11-
"SiteDomain",
12-
{
13-
accountId: "15d29c8639fd3733b1b5486a2acfd968",
14-
hostname: domain,
15-
service: `opencode-site-${$app.stage}`,
16-
zoneId: zoneID,
17-
environment: "production",
1+
// Archived Zen request/response dumps (writer removed May 2026). Nothing reads or writes them.
2+
// Retained on delete so a follow-up can drop them from code without deleting the buckets.
3+
new sst.cloudflare.Bucket("ZenData", {
4+
transform: {
5+
bucket: (_, opts) => {
6+
opts.retainOnDelete = true
187
},
19-
{
20-
aliases: [
21-
`urn:pulumi:${$app.stage}::${$app.name}::sst:cloudflare:SolidStart$sst:cloudflare:Worker$cloudflare:index/workersCustomDomain:WorkersCustomDomain::ConsoleWorkerDomain`,
22-
],
23-
retainOnDelete: true,
24-
ignoreChanges: ["accountId", "hostname", "service", "zoneId", "environment"],
8+
},
9+
})
10+
new sst.cloudflare.Bucket("ZenDataNew", {
11+
transform: {
12+
bucket: (_, opts) => {
13+
opts.retainOnDelete = true
2514
},
26-
)
27-
}
15+
},
16+
})
2817

29-
// Archived Zen request/response dumps (writer removed May 2026). Retained on purpose; nothing reads or writes them.
30-
new sst.cloudflare.Bucket("ZenData")
31-
new sst.cloudflare.Bucket("ZenDataNew")
18+
// Keep this file a module so sst.config.ts can import it.
19+
export {}

‎infra/stage.ts‎

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,30 @@ export const awsStage = $app.stage === "production" ? "production" : "dev"
99
export const deployStats = $app.stage === awsStage
1010

1111
if ($app.stage === "production") {
12-
new cloudflare.DnsRecord("TrustCenter", {
13-
zoneId: zoneID,
14-
name: "trust.opencode.ai",
15-
type: "CNAME",
16-
content: "3a69a5bb27875189.vercel-dns-016.com",
17-
proxied: false,
18-
ttl: 60,
19-
})
12+
// Retained on delete so a follow-up can untrack it without deleting the live record.
13+
new cloudflare.DnsRecord(
14+
"TrustCenter",
15+
{
16+
zoneId: zoneID,
17+
name: "trust.opencode.ai",
18+
type: "CNAME",
19+
content: "3a69a5bb27875189.vercel-dns-016.com",
20+
proxied: false,
21+
ttl: 60,
22+
},
23+
{ retainOnDelete: true },
24+
)
2025

21-
new cloudflare.DnsRecord("TrustCenterVerification", {
22-
zoneId: zoneID,
23-
name: "opencode.ai",
24-
type: "TXT",
25-
content: "compai-domain-verification=org_6993a99c6200a2d642bb115d",
26-
ttl: 60,
27-
})
26+
// Retained on delete so a follow-up can untrack it without deleting the live record.
27+
new cloudflare.DnsRecord(
28+
"TrustCenterVerification",
29+
{
30+
zoneId: zoneID,
31+
name: "opencode.ai",
32+
type: "TXT",
33+
content: "compai-domain-verification=org_6993a99c6200a2d642bb115d",
34+
ttl: 60,
35+
},
36+
{ retainOnDelete: true },
37+
)
2838
}

0 commit comments

Comments
 (0)