diff --git a/dnsconfig.js b/dnsconfig.js index 5ee924a87..3cd55b011 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -29,18 +29,14 @@ for (var subdomain in domains) { // Handle A records if (domainData.record.A) { for (var a in domainData.record.A) { - records.push( - A(subdomainName, IP(domainData.record.A[a]), proxyState) - ); + records.push(A(subdomainName, IP(domainData.record.A[a]), proxyState)); } } // Handle AAAA records if (domainData.record.AAAA) { for (var aaaa in domainData.record.AAAA) { - records.push( - AAAA(subdomainName, domainData.record.AAAA[aaaa], proxyState) - ); + records.push(AAAA(subdomainName, domainData.record.AAAA[aaaa], proxyState)); } } @@ -48,29 +44,14 @@ for (var subdomain in domains) { if (domainData.record.CAA) { for (var caa in domainData.record.CAA) { var caaRecord = domainData.record.CAA[caa]; - records.push( - CAA( - subdomainName, - caaRecord.flags, - caaRecord.tag, - caaRecord.value - ) - ); + records.push(CAA(subdomainName, caaRecord.tag, caaRecord.value)); } } // Handle CNAME records if (domainData.record.CNAME) { - // Allow CNAME record on root - if (subdomainName === "@") { - records.push( - ALIAS(subdomainName, domainData.record.CNAME + ".", proxyState) - ); - } else { - records.push( - CNAME(subdomainName, domainData.record.CNAME + ".", proxyState) - ); - } + // Use ALIAS instead of CNAME to support CNAME flattening on the root domain + records.push(ALIAS(subdomainName, domainData.record.CNAME + ".", proxyState)); } // Handle DS records @@ -78,13 +59,7 @@ for (var subdomain in domains) { for (var ds in domainData.record.DS) { var dsRecord = domainData.record.DS[ds]; records.push( - DS( - subdomainName, - dsRecord.key_tag, - dsRecord.algorithm, - dsRecord.digest_type, - dsRecord.digest - ) + DS(subdomainName, dsRecord.key_tag, dsRecord.algorithm, dsRecord.digest_type, dsRecord.digest) ); } } @@ -92,13 +67,7 @@ for (var subdomain in domains) { // Handle MX records if (domainData.record.MX) { for (var mx in domainData.record.MX) { - records.push( - MX( - subdomainName, - 10 + parseInt(mx), - domainData.record.MX[mx] + "." - ) - ); + records.push(MX(subdomainName, 10 + parseInt(mx), domainData.record.MX[mx] + ".")); } } @@ -114,13 +83,7 @@ for (var subdomain in domains) { for (var srv in domainData.record.SRV) { var srvRecord = domainData.record.SRV[srv]; records.push( - SRV( - subdomainName, - srvRecord.priority, - srvRecord.weight, - srvRecord.port, - srvRecord.target + "." - ) + SRV(subdomainName, srvRecord.priority, srvRecord.weight, srvRecord.port, srvRecord.target + ".") ); } } diff --git a/domains/_atproto.lumi.json b/domains/_atproto.lumi.json new file mode 100644 index 000000000..7c80a4563 --- /dev/null +++ b/domains/_atproto.lumi.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "itsFatlum", + "email": "fatlum@lumi.is-a.dev" + }, + "record": { + "TXT": "did=did:plc:c6m5rghb7tkmf5isd3pqjpbt" + } +} diff --git a/domains/_vercel.jorge-lopz.json b/domains/_vercel.jorge-lopz.json new file mode 100644 index 000000000..551776f98 --- /dev/null +++ b/domains/_vercel.jorge-lopz.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "Jorge-lopz", + "email": "jlpenero2005@gmail.com", + "discord": "713831494761840753" + }, + "record": { + "TXT": "vc-domain-verify=jorge-lopz.is-a.dev,5bfcd4cedc07714c2319" + } +} diff --git a/domains/_vercel.jumanji.json b/domains/_vercel.jumanji.json new file mode 100644 index 000000000..cf5987dea --- /dev/null +++ b/domains/_vercel.jumanji.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "heyjumanji", + "email": "madhuchutiya.unhinge50@silomails.com" + }, + "record": { + "TXT": "vc-domain-verify=jumanji.is-a.dev,291766e76a7ab5de1bc7" + } +} diff --git a/domains/_vercel.n.json b/domains/_vercel.n.json deleted file mode 100644 index e93beb20b..000000000 --- a/domains/_vercel.n.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "syedtahseen", - "email": "itxtahseen@gmail.com" - }, - "record": { - "TXT": ["vc-domain-verify=n.is-a.dev,8435c76be2d4e8aaa229"] - } -} diff --git a/domains/_vercel.samishoukat.json b/domains/_vercel.samishoukat.json new file mode 100644 index 000000000..df08f3129 --- /dev/null +++ b/domains/_vercel.samishoukat.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "samishoukat12", + "email": "samishoukat12@gmail.com" + }, + "record": { + "TXT": "vc-domain-verify=samishoukat.is-a.dev,f7c3cb972c650104d507" + } + } \ No newline at end of file diff --git a/domains/_vercel.sebastianriveros.json b/domains/_vercel.sebastianriveros.json new file mode 100644 index 000000000..dda9cf731 --- /dev/null +++ b/domains/_vercel.sebastianriveros.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "wisauw", + "email": "riveross92@gmail.com", + "discord": "313046852415258625" + }, + "record": { + "TXT": "vc-domain-verify=sebastianriveros.is-a.dev,be3bca98d22aab14d046" + } +} diff --git a/domains/_vercel.usmanbaig.json b/domains/_vercel.usmanbaig.json new file mode 100644 index 000000000..2cc27102c --- /dev/null +++ b/domains/_vercel.usmanbaig.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "UsmanBaig001", + "email": "usmanbaig1572@gmail.com" + }, + "record": { + "TXT": "vc-domain-verify=usmanbaig.is-a.dev,c2f96e70ebd3aef5458b" + } + } \ No newline at end of file diff --git a/domains/abdi.json b/domains/abdi.json new file mode 100644 index 000000000..4734115bf --- /dev/null +++ b/domains/abdi.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "abdiopp", + "email": "ginnieabdullah007@gmail.com" + }, + "record": { + "CNAME": "abdi-portfolio.web.app" + } + } + \ No newline at end of file diff --git a/domains/aswin-m-v.json b/domains/aswin-m-v.json new file mode 100644 index 000000000..465f0f759 --- /dev/null +++ b/domains/aswin-m-v.json @@ -0,0 +1,12 @@ + +{ + "description": "Personal website me , Aswin M V", + "repo": "https://github.com/AswinArsha/mypersonalwebsite.git", + "owner": { + "username": "AswinArsha", + "email": "aswinmv13@gmail.com" + }, + "record": { + "CNAME": "tubular-kangaroo-60ad83.netlify.app" + } +} diff --git a/domains/clarenisme.json b/domains/clarenisme.json new file mode 100644 index 000000000..ed3477f52 --- /dev/null +++ b/domains/clarenisme.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "razelleclaren", + "email": "gracela.claren1@gmail.com" + }, + "record": { + "MX": ["mx1.improvmx.com", "mx2.improvmx.com"], + "TXT": "v=spf1 include:spf.improvmx.com ~all" + } +} diff --git a/domains/frapujgal.json b/domains/frapujgal.json new file mode 100644 index 000000000..4fd0eb8b8 --- /dev/null +++ b/domains/frapujgal.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "frapujgal", + "email": "fpujol1989@gmail.com" + }, + "record": { + "CNAME": "frapujgal.github.io" + } +} diff --git a/domains/fungaming.joe50097.json b/domains/fungaming.joe50097.json new file mode 100644 index 000000000..50a39e83b --- /dev/null +++ b/domains/fungaming.joe50097.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "Joe50097", + "email": "zcell9500@gmail.com" + }, + "record": { + "CNAME": "fungaming-discord-server.netlify.app" + } +} diff --git a/domains/jorge-lopz.json b/domains/jorge-lopz.json new file mode 100644 index 000000000..78c0f6c57 --- /dev/null +++ b/domains/jorge-lopz.json @@ -0,0 +1,11 @@ +{ + "description": "Jorge's Web", + "owner": { + "username": "Jorge-lopz", + "email": "jlpenero2005@gmail.com", + "discord": "713831494761840753" + }, + "record": { + "CNAME": "jorge-lopz.vercel.app" + } +} diff --git a/domains/jose.json b/domains/jose.json new file mode 100644 index 000000000..5b4f456f5 --- /dev/null +++ b/domains/jose.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "JMVS", + "email": "jose.veramutka@gmail.com" + }, + "record": { + "CNAME": "veramutka.com.ar" + } +} diff --git a/domains/jumanji.json b/domains/jumanji.json index b3ef5c086..99f81d324 100644 --- a/domains/jumanji.json +++ b/domains/jumanji.json @@ -4,7 +4,7 @@ "email": "madhuchutiya.unhinge650@silomails.com" }, "record": { - "A": ["172.66.47.44", "172.66.44.212"], + "A": ["76.76.21.21"], "MX": ["mx1.improvmx.com", "mx2.improvmx.com"], "TXT": "v=spf1 include:spf.improvmx.com ~all" } diff --git a/domains/l.luihh.json b/domains/l.luihh.json new file mode 100644 index 000000000..63dcf8817 --- /dev/null +++ b/domains/l.luihh.json @@ -0,0 +1,20 @@ +{ + "owner": { + "username": "luihh", + "email": "luihh@proton.me" + }, + "record": { + "URL": "https://luihh.is-a.dev" + }, + "redirect_config": { + "custom_paths": { + "/github": "https://github.com/luihh", + "/twitch": "https://www.twitch.tv/luihh23", + "/youtube": "https://www.youtube.com/@Luihh", + "/discord": "https://discord.com/users/481268875586174986", + "/steam": "https://steamcommunity.com/id/Luihh23", + "/paypal": "https://www.paypal.com/paypalme/luihhdev" + }, + "redirect_paths": true + } +} diff --git a/domains/manhtran.json b/domains/manhtran.json new file mode 100644 index 000000000..a17d5e061 --- /dev/null +++ b/domains/manhtran.json @@ -0,0 +1,12 @@ +{ + "description": "My personal website", + "repo": "https://github.com/is-a-dev/docs", + "owner": { + "username": "ducmanh86", + "email": "ducmanh86@gmail.com" + }, + "record": { + "CNAME": "tranducmanh-info.web.app" + }, + "proxied": true +} diff --git a/domains/martinvruiz.json b/domains/martinvruiz.json new file mode 100644 index 000000000..31d7a0e9a --- /dev/null +++ b/domains/martinvruiz.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "martinvruiz", + "email": "martinvruiz10@gmail.com", + "discord": "martinvruiz10" + }, + "record": { + "CNAME": "portfoliomvr.vercel.app" + } +} diff --git a/domains/mu.json b/domains/mu.json new file mode 100644 index 000000000..1e8929625 --- /dev/null +++ b/domains/mu.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "mohammadusman666", + "email": "mohammadusman666@gmail.com" + }, + "record": { + "CNAME": "portfolio-1cw.pages.dev" + } +} diff --git a/domains/myprofile.json b/domains/myprofile.json new file mode 100644 index 000000000..eac14a170 --- /dev/null +++ b/domains/myprofile.json @@ -0,0 +1,11 @@ +{ + "description": "tuan.myprofile.dev", + "owner": { + "username": "tuannguyen2002", + "email": "coixaygio107@gmail.com", + "discord": "minhtuan9039" + }, + "record": { + "CNAME": "cname.vercel-dns.com" + } +} diff --git a/domains/n.json b/domains/n.json deleted file mode 100644 index d0ef77563..000000000 --- a/domains/n.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "owner": { - "username": "syedtahseen", - "email": "itxtahseen@gmail.com" - }, - "record": { - "CNAME": "xproject-xi.vercel.app" - } -} diff --git a/domains/rohanjaiswal.json b/domains/rohanjaiswal.json new file mode 100644 index 000000000..d6fd5078f --- /dev/null +++ b/domains/rohanjaiswal.json @@ -0,0 +1,11 @@ +{ + "description": "Rohan Jaiswal's portfolio", + "repo": "https://github.com/jaiswalrohan8796/jaiswalrohan8796", + "owner": { + "username": "jaiswalrohan8796", + "email": "jaiswalrohan8796@gmail.com" + }, + "record": { + "CNAME": "jaiswalrohan8796.github.io" + } +} diff --git a/domains/samishoukat.json b/domains/samishoukat.json new file mode 100644 index 000000000..0b683aab6 --- /dev/null +++ b/domains/samishoukat.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "samishoukat12", + "email": "samishoukat12@gmail.com" + }, + "record": { + "CNAME": "dev-samishoukat.vercel.app" + } + } \ No newline at end of file diff --git a/domains/sevinda-herath.json b/domains/sevinda-herath.json index b6f6705cf..fc8b795e9 100644 --- a/domains/sevinda-herath.json +++ b/domains/sevinda-herath.json @@ -4,7 +4,9 @@ "email": "sevindaherath@gmail.com" }, "record": { - "CNAME": "sevinda-herath.github.io" + "CNAME": "sevinda-herath.github.io", + "MX": ["mx.zoho.com", "mx2.zoho.com", "mx3.zoho.com"], + "TXT": "v=spf1 include:zohomail.com ~all" }, "proxied": true } diff --git a/domains/suryababu.json b/domains/suryababu.json new file mode 100644 index 000000000..51e6e007d --- /dev/null +++ b/domains/suryababu.json @@ -0,0 +1,10 @@ +{ + "description": "Landing page for suryababu.is-a.dev", + "owner": { + "username": "suryababu", + "email": "suryababu.k.s@gmail.com" + }, + "record": { + "CNAME": "suryababus.github.io" + } +} diff --git a/domains/umerislam.json b/domains/umerislam.json new file mode 100644 index 000000000..9e46ad79b --- /dev/null +++ b/domains/umerislam.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "umer-islam", + "email": "umer.islam474@gmail.com" + }, + "record": { + "CNAME": "umerislam.netlify.app" + } +} diff --git a/domains/usmanbaig.json b/domains/usmanbaig.json new file mode 100644 index 000000000..db087c533 --- /dev/null +++ b/domains/usmanbaig.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "UsmanBaig001", + "email": "usmanbaig1572@gmail.com" + }, + "record": { + "CNAME": "usmanbaig-dev.vercel.app" + } + } \ No newline at end of file diff --git a/domains/wh.json b/domains/wh.json new file mode 100644 index 000000000..55dcef36b --- /dev/null +++ b/domains/wh.json @@ -0,0 +1,12 @@ +{ + "owner": { + "username": "wdhdev", + "email": "william@is-a.dev" + }, + "record": { + "URL": "https://william.is-a.dev" + }, + "redirect_config": { + "redirect_paths": true + } +} diff --git a/domains/www.fungaming.joe50097.json b/domains/www.fungaming.joe50097.json new file mode 100644 index 000000000..50a39e83b --- /dev/null +++ b/domains/www.fungaming.joe50097.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "Joe50097", + "email": "zcell9500@gmail.com" + }, + "record": { + "CNAME": "fungaming-discord-server.netlify.app" + } +} diff --git a/tests/domains.test.js b/tests/domains.test.js index ce2c3817d..46a4339fb 100644 --- a/tests/domains.test.js +++ b/tests/domains.test.js @@ -3,7 +3,7 @@ const fs = require("fs-extra"); const path = require("path"); const domainsPath = path.resolve("domains"); -const files = fs.readdirSync(domainsPath); +const files = fs.readdirSync(domainsPath).filter((file) => file.endsWith(".json")); const domainCache = {}; diff --git a/tests/json.test.js b/tests/json.test.js index 80d83c9ab..39d293f81 100644 --- a/tests/json.test.js +++ b/tests/json.test.js @@ -30,12 +30,12 @@ const optionalRedirectConfigFields = { const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; const hostnameRegex = /^(?=.{1,253}$)(?:(?:[_a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)\.)+[a-zA-Z]{2,63}$/; -const exceptedDomains = require("../util/excepted-domains.json"); -const reservedDomains = require("../util/reserved-domains.json"); +const exceptedDomains = require("../util/excepted.json"); +const reservedDomains = require("../util/reserved.json"); const domainsPath = path.resolve("domains"); const files = fs.readdirSync(domainsPath); -const expandReservedDomains = (reserved) => { +function expandReservedDomains(reserved) { const expandedList = [...reserved]; reserved.forEach((item) => { @@ -52,16 +52,36 @@ const expandReservedDomains = (reserved) => { } expandedList.splice(expandedList.indexOf(item), 1); } else { - throw new Error(`[util/reserved-domains.json] Invalid range [${start}-${end}] in "${item}"`); + throw new Error(`[util/reserved.json] Invalid range [${start}-${end}] in "${item}"`); } } }); return expandedList; -}; +} const expandedReservedDomains = expandReservedDomains(reservedDomains); +function findDuplicateKeys(jsonString) { + const keyPattern = /"([^"]+)"(?=\s*:)/g; + const keys = []; + let match; + + // Find all keys in the JSON string + while ((match = keyPattern.exec(jsonString)) !== null) { + keys.push(match[1]); + } + + // Count occurrences of each key + const keyCount = {}; + keys.forEach((key) => { + keyCount[key] = (keyCount[key] || 0) + 1; + }); + + // Return keys that occur more than once + return Object.keys(keyCount).filter((key) => keyCount[key] > 1); +} + function validateFields(t, obj, fields, file, prefix = "") { Object.keys(fields).forEach((key) => { const fieldPath = prefix ? `${prefix}.${key}` : key; @@ -109,6 +129,16 @@ t("All files should be valid JSON", (t) => { }); }); +t("All files should not have duplicate keys", (t) => { + files.forEach((file) => { + // Parse JSON as a string because JS automatically gets the last key if there are duplicates + const rawData = fs.readFileSync(`${domainsPath}/${file}`, "utf8"); + const duplicateKeys = findDuplicateKeys(rawData); + + t.true(!duplicateKeys.length, `${file}: Duplicate keys found: ${duplicateKeys.join(", ")}`); + }); +}); + t("All files should have valid file names", (t) => { files.forEach((file) => { validateFileName(t, file); diff --git a/tests/records.test.js b/tests/records.test.js index 4d03a0e75..8a1bbabbc 100644 --- a/tests/records.test.js +++ b/tests/records.test.js @@ -95,11 +95,13 @@ function validateRecordValues(t, data, file) { // General validation for arrays if (["A", "AAAA", "MX", "NS"].includes(key)) { t.true(Array.isArray(value), `${file}: Record value for ${key} should be an array`); + value.forEach((record, idx) => { t.true( typeof record === "string", `${file}: Record value for ${key} should be a string at index ${idx}` ); + if (key === "A") { t.true(ipv4Regex.test(record), `${file}: Invalid IPv4 address for ${key} at index ${idx}`); t.true( @@ -119,6 +121,7 @@ function validateRecordValues(t, data, file) { // CNAME and URL validations if (["CNAME", "URL"].includes(key)) { t.true(typeof value === "string", `${file}: Record value for ${key} should be a string`); + if (key === "CNAME") { t.true(isValidHostname(value), `${file}: Invalid hostname for ${key}`); t.true(value !== file, `${file}: CNAME cannot point to itself`); @@ -132,6 +135,7 @@ function validateRecordValues(t, data, file) { const urlHost = new URL(value).host; const isSelfReferencing = file === "@.json" ? urlHost === "is-a.dev" : urlHost === `${subdomain}.is-a.dev`; + t.true(!isSelfReferencing, `${file}: URL cannot point to itself`); } } @@ -139,17 +143,51 @@ function validateRecordValues(t, data, file) { // CAA, DS, SRV validations if (["CAA", "DS", "SRV"].includes(key)) { t.true(Array.isArray(value), `${file}: Record value for ${key} should be an array`); + value.forEach((record, idx) => { t.true( typeof record === "object", `${file}: Record value for ${key} should be an object at index ${idx}` ); - if (key === "DS") { + + if (key === "CAA") { + t.true( + ["issue", "issuewild", "iodef"].includes(record.tag), + `${file}: Invalid tag for CAA at index ${idx}` + ); + t.true(typeof record.value === "string", `${file}: Invalid value for CAA at index ${idx}`); + t.true( + isValidHostname(record.value) || record.value === ";", + `${file}: Value must be a hostname or semicolon for CAA at index ${idx}` + ); + } else if (key === "DS") { t.true( Number.isInteger(record.key_tag) && record.key_tag >= 0 && record.key_tag <= 65535, `${file}: Invalid key_tag for DS at index ${idx}` ); + t.true( + Number.isInteger(record.algorithm) && record.algorithm >= 0 && record.algorithm <= 255, + `${file}: Invalid algorithm for DS at index ${idx}` + ); + t.true( + Number.isInteger(record.digest_type) && record.digest_type >= 0 && record.digest_type <= 255, + `${file}: Invalid digest_type for DS at index ${idx}` + ); t.true(isValidHexadecimal(record.digest), `${file}: Invalid digest for DS at index ${idx}`); + } else if (key === "SRV") { + t.true( + Number.isInteger(record.priority) && record.priority >= 0 && record.priority <= 65535, + `${file}: Invalid priority for SRV at index ${idx}` + ); + t.true( + Number.isInteger(record.weight) && record.weight >= 0 && record.weight <= 65535, + `${file}: Invalid weight for SRV at index ${idx}` + ); + t.true( + Number.isInteger(record.port) && record.port >= 0 && record.port <= 65535, + `${file}: Invalid port for SRV at index ${idx}` + ); + t.true(isValidHostname(record.target), `${file}: Invalid target for SRV at index ${idx}`); } }); } @@ -237,13 +275,3 @@ t("All files should have valid record types", (t) => { t.pass(); }); - -t("All files should not have duplicate record keys", (t) => { - files.forEach((file) => { - const data = getDomainData(file); - const recordKeys = Object.keys(data.record); - const uniqueRecordKeys = new Set(recordKeys); - - t.is(recordKeys.length, uniqueRecordKeys.size, `${file}: Duplicate record keys found`); - }); -}); diff --git a/tests/special.test.js b/tests/special.test.js new file mode 100644 index 000000000..bd18e3e00 --- /dev/null +++ b/tests/special.test.js @@ -0,0 +1,53 @@ +const t = require("ava"); +const fs = require("fs-extra"); +const path = require("path"); + +const domainsPath = path.resolve("domains"); +const files = fs.readdirSync(domainsPath).filter((file) => file.endsWith(".json")); + +const bypassedUsernames = require("../util/bypassed.json").map((username) => username.toLowerCase()); + +function getDomainData(subdomain) { + try { + const data = fs.readJsonSync(path.join(domainsPath, `${subdomain}.json`)); + return data; + } catch (error) { + throw new Error(`Failed to read JSON for ${subdomain}: ${error.message}`); + } +} + +t("Users are limited to one single character subdomain", (t) => { + const results = []; + + files.forEach((file) => { + const subdomain = file.replace(/\.json$/, ""); + const data = getDomainData(subdomain); + + if (subdomain.length === 1 && !bypassedUsernames.includes(data.owner.username.toLowerCase())) { + results.push({ + subdomain, + owner: data.owner.username.toLowerCase() + }); + } + }); + + const duplicates = results.filter((result) => results.filter((r) => r.owner === result.owner).length > 1); + const output = duplicates.reduce((acc, curr) => { + if (!acc[curr.owner]) { + acc[curr.owner] = []; + } + + acc[curr.owner].push(`${curr.subdomain}.is-a.dev`); + return acc; + }, {}); + + t.is( + duplicates.length, + 0, + Object.keys(output) + .map((owner) => `${owner} - ${output[owner].join(", ")}`) + .join("\n") + ); + + t.pass(); +}); diff --git a/util/bypassed.json b/util/bypassed.json new file mode 100644 index 000000000..ed9a583ce --- /dev/null +++ b/util/bypassed.json @@ -0,0 +1,4 @@ +[ + "is-a-dev", + "wdhdev" +] diff --git a/util/excepted-domains.json b/util/excepted.json similarity index 100% rename from util/excepted-domains.json rename to util/excepted.json diff --git a/util/reserved-domains.json b/util/reserved.json similarity index 91% rename from util/reserved-domains.json rename to util/reserved.json index 797806d1b..eccc9738c 100644 --- a/util/reserved-domains.json +++ b/util/reserved.json @@ -1,122 +1,120 @@ -[ - "_atproto", - "_vercel", - "account", - "accounts", - "admin", - "administrator", - "alert", - "alerts", - "api", - "auth", - "authentication", - "authorisation", - "authorise", - "authorization", - "authorize", - "aux", - "billing", - "blog", - "calendar", - "cart", - "catalog", - "checkout", - "co", - "com", - "com[1-9]", - "con", - "confirm", - "confirmation", - "dashboard", - "default", - "dns", - "doc", - "documentation", - "email", - "error", - "errors", - "event", - "events", - "example", - "feedback", - "finance", - "forgot", - "forgot-password", - "gtld", - "guest", - "help", - "helpdesk", - "hostmaster", - "info", - "infos", - "login", - "logout", - "lpt[1-9]", - "m", - "mail", - "maintainer", - "maintainers", - "marketing", - "media", - "mobile", - "net", - "news", - "noc", - "notification", - "notifications", - "notify", - "ns", - "ns[1-99]", - "nul", - "oauth", - "official", - "operations", - "ops", - "org", - "organisation", - "pay", - "payment", - "payments", - "portal", - "postmaster", - "recovery", - "redirect", - "registrar", - "registry", - "reset", - "reset-password", - "root", - "sales", - "schedule", - "secure", - "security", - "service", - "services", - "session", - "sessions", - "shop", - "signin", - "signout", - "signup", - "staff", - "store", - "superuser", - "support", - "sys", - "system", - "teams", - "test", - "test[1-9999]", - "tld", - "token", - "tokens", - "url", - "url[1-9999]", - "user", - "users", - "webmaster", - "whois", - "www[1-99]", - "wwww", - "your-domain-name" -] +[ + "account", + "accounts", + "admin", + "administrator", + "alert", + "alerts", + "api", + "auth", + "authentication", + "authorisation", + "authorise", + "authorization", + "authorize", + "aux", + "billing", + "blog", + "calendar", + "cart", + "catalog", + "checkout", + "co", + "com", + "com[1-9]", + "con", + "confirm", + "confirmation", + "dashboard", + "default", + "dns", + "doc", + "documentation", + "email", + "error", + "errors", + "event", + "events", + "example", + "feedback", + "finance", + "forgot", + "forgot-password", + "gtld", + "guest", + "help", + "helpdesk", + "hostmaster", + "info", + "infos", + "login", + "logout", + "lpt[1-9]", + "m", + "mail", + "maintainer", + "maintainers", + "marketing", + "media", + "mobile", + "net", + "news", + "noc", + "notification", + "notifications", + "notify", + "ns", + "ns[1-99]", + "nul", + "oauth", + "official", + "operations", + "ops", + "org", + "organisation", + "pay", + "payment", + "payments", + "portal", + "postmaster", + "recovery", + "redirect", + "registrar", + "registry", + "reset", + "reset-password", + "root", + "sales", + "schedule", + "secure", + "security", + "service", + "services", + "session", + "sessions", + "shop", + "signin", + "signout", + "signup", + "staff", + "store", + "superuser", + "support", + "sys", + "system", + "teams", + "test", + "test[1-9999]", + "tld", + "token", + "tokens", + "url", + "url[1-9999]", + "user", + "users", + "webmaster", + "whois", + "www[1-99]", + "wwww", + "your-domain-name" +]