remove @ + www json files, update reserved

This commit is contained in:
William Harrison authored and GitHub committed 2025-04-23 15:55:44 +08:00
1 parent 3fd2839c98
commit 964fd4b060
6 files changed
+24 -123

No files matched your search

+14 -16
View File
@@ -97,25 +97,23 @@ async function validateFileName(t, file) {
t.false(file.includes("--"), `${file}: File name should not contain consecutive hyphens`);
t.false(file.startsWith("_redirect."), `${file}: File name should not start with _redirect`);
if (file !== "@.json") {
const subdomain = file.replace(/\.json$/, "");
const subdomain = file.replace(/\.json$/, "");
t.regex(
subdomain + ".is-a.dev",
hostnameRegex,
`${file}: FQDN must be 1-253 characters, can use letters, numbers, dots, and non-consecutive hyphens.`
);
t.false(reservedDomains.includes(subdomain), `${file}: Subdomain name is reserved`);
t.true(
!reservedDomains.some((reserved) => subdomain.endsWith(`.${reserved}`)),
`${file}: Subdomain name is reserved`
);
t.regex(
subdomain + ".is-a.dev",
hostnameRegex,
`${file}: FQDN must be 1-253 characters, can use letters, numbers, dots, and non-consecutive hyphens.`
);
t.false(reservedDomains.includes(subdomain), `${file}: Subdomain name is reserved`);
t.true(
!reservedDomains.some((reserved) => subdomain.endsWith(`.${reserved}`)),
`${file}: Subdomain name is reserved`
);
const rootSubdomain = subdomain.split(".").pop();
const rootSubdomain = subdomain.split(".").pop();
if (!excludedDomains.includes(rootSubdomain)) {
t.false(rootSubdomain.startsWith("_"), `${file}: Root subdomains should not start with an underscore`);
}
if (!excludedDomains.includes(rootSubdomain)) {
t.false(rootSubdomain.startsWith("_"), `${file}: Root subdomains should not start with an underscore`);
}
}