From 347cbf553222962c4570c56c0e2c7d1c683c73c4 Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 13 Jan 2025 00:18:44 +0200 Subject: [PATCH 01/12] Create www.fungaming.joe50097.json --- www.fungaming.joe50097.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 www.fungaming.joe50097.json diff --git a/www.fungaming.joe50097.json b/www.fungaming.joe50097.json new file mode 100644 index 000000000..50a39e83b --- /dev/null +++ b/www.fungaming.joe50097.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "Joe50097", + "email": "zcell9500@gmail.com" + }, + "record": { + "CNAME": "fungaming-discord-server.netlify.app" + } +} From cd20653d7e447c160d91e5696f058007e308a6d2 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:21:32 +0800 Subject: [PATCH 02/12] Update dnsconfig.js --- dnsconfig.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dnsconfig.js b/dnsconfig.js index 78a19680d..91d9437f7 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -51,7 +51,6 @@ for (var subdomain in domains) { records.push( CAA( subdomainName, - caaRecord.flags, caaRecord.tag, caaRecord.value ) @@ -140,14 +139,6 @@ for (var subdomain in domains) { if (domainData.record.URL) { records.push(A(subdomainName, IP("192.0.2.1"), CF_PROXY_ON)); } - - // Handle Email Forwarding - if (domainData.email_forwarding) { - records.push(MX(subdomainName, 34, "route1.mx.cloudflare.net.")); - records.push(MX(subdomainName, 62, "route2.mx.cloudflare.net.")); - records.push(MX(subdomainName, 36, "route3.mx.cloudflare.net.")); - records.push(TXT(subdomainName, "\"" + "v=spf1 include:_spf.mx.cloudflare.net ~all" + "\"")); - } } var options = { From 94b4e497a88268288b9eb31f49aac63b460fe725 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:29:51 +0800 Subject: [PATCH 03/12] more validations --- dnsconfig.js | 52 +++++++------------------------------------ tests/records.test.js | 40 ++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 45 deletions(-) diff --git a/dnsconfig.js b/dnsconfig.js index 91d9437f7..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,28 +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.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 @@ -77,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) ); } } @@ -91,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] + ".")); } } @@ -113,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/tests/records.test.js b/tests/records.test.js index 4d03a0e75..a13530cf5 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}`); } }); } From 2249355301b12434a3de17e57aced36bdc356cb4 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:31:28 +0800 Subject: [PATCH 04/12] reserve _zone-updated --- util/reserved-domains.json | 1 + 1 file changed, 1 insertion(+) diff --git a/util/reserved-domains.json b/util/reserved-domains.json index 797806d1b..0d2de4bd3 100644 --- a/util/reserved-domains.json +++ b/util/reserved-domains.json @@ -1,6 +1,7 @@ [ "_atproto", "_vercel", + "_zone-updated", "account", "accounts", "admin", From 5ca8e5bdbb86de30a289f8c2de2c1514b8c888a5 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:31:53 +0800 Subject: [PATCH 05/12] no need to reserve domains starting with _ --- util/reserved-domains.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/util/reserved-domains.json b/util/reserved-domains.json index 0d2de4bd3..16b3293c7 100644 --- a/util/reserved-domains.json +++ b/util/reserved-domains.json @@ -1,7 +1,4 @@ [ - "_atproto", - "_vercel", - "_zone-updated", "account", "accounts", "admin", From 93c16befbae62e89b7dfc055e55580d5e3c9c946 Mon Sep 17 00:00:00 2001 From: Sisyphus_666 <139012668+Umer-Islam@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:13:18 +0500 Subject: [PATCH 06/12] Create umerislam.json --- domains/umerislam.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 domains/umerislam.json 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" + } +} From 9544528c9e8c68febf85c7fb8c555bd3360e91c3 Mon Sep 17 00:00:00 2001 From: Muhammad Sami Shoukat <88966319+samishoukat12@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:20:06 +0500 Subject: [PATCH 07/12] samishoukat.is-a.dev --- domains/_vercel.samishoukat.json | 9 +++++++++ domains/samishoukat.json | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 domains/_vercel.samishoukat.json create mode 100644 domains/samishoukat.json 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/samishoukat.json b/domains/samishoukat.json new file mode 100644 index 000000000..c88531d66 --- /dev/null +++ b/domains/samishoukat.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "samishoukat12", + "email": "samishoukat12@gmail.com" + }, + "record": { + "CNAME": "portfolio2-0-lime.vercel.app" + } + } \ No newline at end of file From ca853b3ac3a7ebfa1939a55628e61997fa7ed57d Mon Sep 17 00:00:00 2001 From: Muhammad Sami Shoukat <88966319+samishoukat12@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:24:54 +0500 Subject: [PATCH 08/12] fix websiste url --- domains/samishoukat.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/samishoukat.json b/domains/samishoukat.json index c88531d66..0b683aab6 100644 --- a/domains/samishoukat.json +++ b/domains/samishoukat.json @@ -4,6 +4,6 @@ "email": "samishoukat12@gmail.com" }, "record": { - "CNAME": "portfolio2-0-lime.vercel.app" + "CNAME": "dev-samishoukat.vercel.app" } } \ No newline at end of file From 24a81b4860c0dbb7b8ccb65354f63a80bdaf2a2c Mon Sep 17 00:00:00 2001 From: suryababus <53492132+suryababus@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:05:26 +0530 Subject: [PATCH 09/12] Create suryababu.json --- domains/suryababu.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 domains/suryababu.json diff --git a/domains/suryababu.json b/domains/suryababu.json new file mode 100644 index 000000000..f78668dd8 --- /dev/null +++ b/domains/suryababu.json @@ -0,0 +1,11 @@ +{ + "description": "Landing page for suryababu.is-a.dev", + "repo": "https://github.com/is-a-dev/docs", + "owner": { + "username": "Suryababu", + "email": "suryababu.k.s@gmail.com" + }, + "record": { + "CNAME": "suryababus.github.io" + } +} From 8177843b95c3e598a566de132246790e571d9e00 Mon Sep 17 00:00:00 2001 From: suryababus <53492132+suryababus@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:17:26 +0530 Subject: [PATCH 10/12] Update suryababu.json --- domains/suryababu.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domains/suryababu.json b/domains/suryababu.json index f78668dd8..1c87608b8 100644 --- a/domains/suryababu.json +++ b/domains/suryababu.json @@ -2,7 +2,7 @@ "description": "Landing page for suryababu.is-a.dev", "repo": "https://github.com/is-a-dev/docs", "owner": { - "username": "Suryababu", + "username": "suryababu", "email": "suryababu.k.s@gmail.com" }, "record": { From 9c5b7c440b40a47be7b94084a7137c5a8ad50c3d Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:07:55 +0800 Subject: [PATCH 11/12] Rename www.fungaming.joe50097.json to domains/www.fungaming.joe50097.json --- .../www.fungaming.joe50097.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename www.fungaming.joe50097.json => domains/www.fungaming.joe50097.json (100%) diff --git a/www.fungaming.joe50097.json b/domains/www.fungaming.joe50097.json similarity index 100% rename from www.fungaming.joe50097.json rename to domains/www.fungaming.joe50097.json From d005ee7fc7634314d9d638b4fc3e56b7a497c4d4 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:20:25 +0800 Subject: [PATCH 12/12] so close, yet so far --- domains/suryababu.json | 1 - 1 file changed, 1 deletion(-) diff --git a/domains/suryababu.json b/domains/suryababu.json index 1c87608b8..51e6e007d 100644 --- a/domains/suryababu.json +++ b/domains/suryababu.json @@ -1,6 +1,5 @@ { "description": "Landing page for suryababu.is-a.dev", - "repo": "https://github.com/is-a-dev/docs", "owner": { "username": "suryababu", "email": "suryababu.k.s@gmail.com"