Skip to content

Commit 63e1626

Browse files
committed
Remove alias support
1 parent 6e5a12d commit 63e1626

File tree

4 files changed

+8
-15
lines changed

4 files changed

+8
-15
lines changed

apps/builder/app/builder/features/topbar/add-domain.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ export const AddDomain = ({
5252
const registrar = await nativeClient.domain.findDomainRegistrar.query({
5353
domain,
5454
});
55-
// enforce www subdomain when no support for cname flattening or alias
56-
if (!registrar.cnameFlattening && !registrar.alias) {
55+
// enforce www subdomain when no support for cname flattening
56+
// and root cname can conflict with MX or NS
57+
if (!registrar.cnameFlattening) {
5758
domain = `www.${domain}`;
5859
}
5960
}

apps/builder/app/builder/features/topbar/domains.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
type ReactNode,
3131
} from "react";
3232
import { Entri } from "./entri";
33-
import { nativeClient, trpcClient } from "~/shared/trpc/trpc-client";
33+
import { nativeClient } from "~/shared/trpc/trpc-client";
3434
import { useStore } from "@nanostores/react";
3535
import { $publisherHost } from "~/shared/nano-states";
3636
import { extractCname } from "./cname";
@@ -287,19 +287,10 @@ const DomainItem = ({
287287
});
288288

289289
const publisherHost = useStore($publisherHost);
290-
const { load: findDomainRegistrar, data: registrar } =
291-
trpcClient.domain.findDomainRegistrar.useQuery();
292290
const cname = extractCname(projectDomain.domain);
293-
useEffect(() => {
294-
if (cname === "@") {
295-
findDomainRegistrar({ domain: projectDomain.domain });
296-
}
297-
}, [projectDomain.domain, cname, findDomainRegistrar]);
298291
const dnsRecords = [
299292
{
300-
// use alias for domain root when supported to avoid conflicting
301-
// with MX, NS etc records
302-
type: cname === "@" && registrar?.alias ? "ALIAS" : "CNAME",
293+
type: "CNAME",
303294
host: cname,
304295
value: `${projectDomain.cname}.customers.${publisherHost}`,
305296
ttl: 300,

apps/builder/app/builder/features/topbar/entri.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ const useEntri = ({ domain, dnsRecords, onClose }: EntriProps) => {
5050
useEffect(() => {
5151
const handleOnEntriClose = (event: EntriCloseEvent) => {
5252
if (event.detail.domain === domain) {
53-
console.info(event.detail);
5453
onClose(event.detail);
5554
setIsOpen(false);
5655
}
@@ -65,7 +64,6 @@ const useEntri = ({ domain, dnsRecords, onClose }: EntriProps) => {
6564
setIsOpen(true);
6665
entriTokenLoad(undefined, async (data) => {
6766
if (data.success) {
68-
console.info(dnsRecords);
6967
await entri.showEntri({
7068
applicationId: data.applicationId,
7169
token: data.token,

packages/domain/src/trpc/domain.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ const registrars = {
1212
cnameFlattening: true,
1313
alias: false,
1414
},
15+
/*
16+
// ALIAS record is not support by cloudflare custom domains service
1517
namecheap: {
1618
rdap: "https://rdap.namecheap.com/domain/",
1719
cnameFlattening: false,
1820
alias: true,
1921
},
22+
*/
2023
} as const;
2124

2225
export const domainRouter = router({

0 commit comments

Comments
 (0)