stage.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. export const domain = (() => {
  2. if ($app.stage === "production") return "opencode.ai"
  3. if ($app.stage === "dev") return "dev.opencode.ai"
  4. return `${$app.stage}.dev.opencode.ai`
  5. })()
  6. export const zoneID = "430ba34c138cfb5360826c4909f99be8"
  7. export const awsStage = $app.stage === "production" ? "production" : "dev"
  8. export const deployAws = $app.stage === awsStage
  9. if ($app.stage === "production") {
  10. new cloudflare.DnsRecord("TrustCenter", {
  11. zoneId: zoneID,
  12. name: "trust.opencode.ai",
  13. type: "CNAME",
  14. content: "3a69a5bb27875189.vercel-dns-016.com",
  15. proxied: false,
  16. ttl: 60,
  17. })
  18. new cloudflare.DnsRecord("TrustCenterVerification", {
  19. zoneId: zoneID,
  20. name: "opencode.ai",
  21. type: "TXT",
  22. content: "compai-domain-verification=org_6993a99c6200a2d642bb115d",
  23. ttl: 60,
  24. })
  25. }
  26. new cloudflare.RegionalHostname("RegionalHostname", {
  27. hostname: domain,
  28. regionKey: "us",
  29. zoneId: zoneID,
  30. })
  31. export const shortDomain = (() => {
  32. if ($app.stage === "production") return "opncd.ai"
  33. if ($app.stage === "dev") return "dev.opncd.ai"
  34. return `${$app.stage}.dev.opncd.ai`
  35. })()