From 6f5402a07247850fa7a08d0c2b74e2fe108195a2 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 13 Feb 2025 20:04:57 +1100 Subject: [PATCH 1/3] remove noreply emails --- dnsconfig.js | 5 +++++ domains/_discord.okinea.json | 3 +-- domains/_github-pages-challenge-d-pow.devon.json | 3 +-- .../_github-pages-challenge-okineadev.okinea.json | 3 +-- domains/avversion.json | 15 +++++++-------- domains/buffer.json | 1 - domains/devon.json | 3 +-- domains/duzo.json | 3 +-- domains/gicorada.json | 1 - domains/hastebin.json | 1 - domains/horu.json | 3 +-- domains/kappucino.json | 1 - domains/kokofixcomputers.json | 1 - domains/liq.json | 3 +-- domains/mrkos.json | 3 +-- domains/rblx.json | 3 +-- domains/scan.json | 1 - domains/seven.json | 1 - domains/tf.json | 3 +-- domains/xkotelek.json | 1 - tests/json.test.js | 5 ++--- tests/records.test.js | 13 ++----------- 22 files changed, 26 insertions(+), 50 deletions(-) diff --git a/dnsconfig.js b/dnsconfig.js index 3cd55b011..636e74297 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -103,6 +103,11 @@ for (var subdomain in domains) { if (domainData.record.URL) { records.push(A(subdomainName, IP("192.0.2.1"), CF_PROXY_ON)); } + + // Handle redirects + if (domainData.redirect_config && !domainData.record.A && !domainData.record.AAAA && !domainData.record.CNAME) { + records.push(A(subdomainName, IP("192.0.2.1"), CF_PROXY_ON)); + } } var options = { diff --git a/domains/_discord.okinea.json b/domains/_discord.okinea.json index cdd471c33..78010e42d 100644 --- a/domains/_discord.okinea.json +++ b/domains/_discord.okinea.json @@ -2,8 +2,7 @@ "owner": { "username": "okineadev", "discord": "okineadev", - "telegram": "okinea", - "email": "81070564+okineadev@users.noreply.github.com" + "telegram": "okinea" }, "record": { "TXT": "dh=72f6dea86d79bda34d2c61e1edb3037954caac82" diff --git a/domains/_github-pages-challenge-d-pow.devon.json b/domains/_github-pages-challenge-d-pow.devon.json index 875c3aa2e..2a9ecd3fb 100644 --- a/domains/_github-pages-challenge-d-pow.devon.json +++ b/domains/_github-pages-challenge-d-pow.devon.json @@ -1,8 +1,7 @@ { "description": "GitHub Pages verification for devon.is-a.dev", "owner": { - "username": "D-Pow", - "email": "D-Pow@users.noreply.github.com" + "username": "D-Pow" }, "record": { "TXT": "cec54b510828f770750c1b17cad7f2" diff --git a/domains/_github-pages-challenge-okineadev.okinea.json b/domains/_github-pages-challenge-okineadev.okinea.json index 08e93918c..451792203 100644 --- a/domains/_github-pages-challenge-okineadev.okinea.json +++ b/domains/_github-pages-challenge-okineadev.okinea.json @@ -2,8 +2,7 @@ "description": "Okinea Dev website", "repo": "https://github.com/okineadev", "owner": { - "username": "okineadev", - "email": "81070564+okineadev@users.noreply.github.com" + "username": "okineadev" }, "record": { "TXT": "a4553ebffa6a3356fc37fb4f8e8a14" diff --git a/domains/avversion.json b/domains/avversion.json index 33e780587..be1e069fa 100644 --- a/domains/avversion.json +++ b/domains/avversion.json @@ -1,9 +1,8 @@ { - "owner": { - "username": "AVVERSION", - "email": "79741360+AVVERSION@users.noreply.github.com" - }, - "record": { - "CNAME": "avversion.github.io" - } -} \ No newline at end of file + "owner": { + "username": "AVVERSION" + }, + "record": { + "CNAME": "avversion.github.io" + } +} diff --git a/domains/buffer.json b/domains/buffer.json index b33bea04c..14f0c5ee2 100644 --- a/domains/buffer.json +++ b/domains/buffer.json @@ -1,7 +1,6 @@ { "owner": { "username": "bufferwise", - "email": "126371417+bufferwise@users.noreply.github.com", "discord": "790846560229392444" }, "record": { diff --git a/domains/devon.json b/domains/devon.json index 3125a1dc1..0b2827c2f 100644 --- a/domains/devon.json +++ b/domains/devon.json @@ -2,8 +2,7 @@ "description": "Devon Powell is a full-stack software engineer", "repo": "https://github.com/D-Pow/d-pow.github.io", "owner": { - "username": "D-Pow", - "email": "D-Pow@users.noreply.github.com" + "username": "D-Pow" }, "record": { "CNAME": "d-pow.github.io" diff --git a/domains/duzo.json b/domains/duzo.json index ce7022753..06d3efebc 100644 --- a/domains/duzo.json +++ b/domains/duzo.json @@ -2,8 +2,7 @@ "description": "For Duzo's website", "repo": "https://github.com/Duzos/duzos.github.io", "owner": { - "username": "Duzos", - "email": "73184526+Duzos@users.noreply.github.com" + "username": "Duzos" }, "record": { "CNAME": "duzos.github.io" diff --git a/domains/gicorada.json b/domains/gicorada.json index e89abe60a..8af986f80 100644 --- a/domains/gicorada.json +++ b/domains/gicorada.json @@ -1,7 +1,6 @@ { "owner": { "username": "gicorada", - "email": "51818710+gicorada@users.noreply.github.com", "discord": "607903753831448626" }, "record": { diff --git a/domains/hastebin.json b/domains/hastebin.json index 8719e4cac..d2c9f3338 100644 --- a/domains/hastebin.json +++ b/domains/hastebin.json @@ -1,7 +1,6 @@ { "owner": { "username": "EducatedSuddenBucket", - "email": "149485703+EducatedSuddenBucket@users.noreply.github.com", "discord": "1167825360151380032" }, "record": { diff --git a/domains/horu.json b/domains/horu.json index a2dfe34c5..d8e3b4cd6 100644 --- a/domains/horu.json +++ b/domains/horu.json @@ -1,7 +1,6 @@ { "owner": { - "username": "HigherOrderLogic", - "email": "73709188+HigherOrderLogic@users.noreply.github.com" + "username": "HigherOrderLogic" }, "record": { "CNAME": "higherorderlogic.github.io" diff --git a/domains/kappucino.json b/domains/kappucino.json index 6f690b542..7fd0cb673 100644 --- a/domains/kappucino.json +++ b/domains/kappucino.json @@ -1,7 +1,6 @@ { "owner": { "username": "kappucin", - "email": "132572179+kappucin@users.noreply.github.com", "discord": "853170099392479253" }, "record": { diff --git a/domains/kokofixcomputers.json b/domains/kokofixcomputers.json index cebb43a29..8b2d51302 100644 --- a/domains/kokofixcomputers.json +++ b/domains/kokofixcomputers.json @@ -1,7 +1,6 @@ { "owner": { "username": "kokofixcomputers", - "email": "113046561+kokofixcomputers@users.noreply.github.com", "discord": "1096839213313446019" }, "record": { diff --git a/domains/liq.json b/domains/liq.json index 17595f9e5..28cf6e2b7 100644 --- a/domains/liq.json +++ b/domains/liq.json @@ -2,8 +2,7 @@ "description": "Learning something new everyday", "repo": "https://github.com/DevLiQ", "owner": { - "username": "DevLiQ", - "email": "21136062+devliq@users.noreply.github.com" + "username": "DevLiQ" }, "record": { "CNAME": "devliq.github.io" diff --git a/domains/mrkos.json b/domains/mrkos.json index efbb3b648..11c5a8828 100644 --- a/domains/mrkos.json +++ b/domains/mrkos.json @@ -2,8 +2,7 @@ "description": "Personal Page", "repo": "https://github.com/mrkOS1210/mrkos1210.github.io", "owner": { - "username": "mrkOS1210", - "email": "72011329+mrkOS1210@users.noreply.github.com" + "username": "mrkOS1210" }, "record": { "CNAME": "mrkos1210.github.io" diff --git a/domains/rblx.json b/domains/rblx.json index fd934b900..94aaf2ff7 100644 --- a/domains/rblx.json +++ b/domains/rblx.json @@ -1,7 +1,6 @@ { "owner": { - "username": "r-b-l-x", - "email": "178317246+r-b-l-x@users.noreply.github.com" + "username": "r-b-l-x" }, "record": { "CNAME": "r-b-l-x.github.io" diff --git a/domains/scan.json b/domains/scan.json index 53080ebe7..fcf8e3393 100644 --- a/domains/scan.json +++ b/domains/scan.json @@ -1,7 +1,6 @@ { "owner": { "username": "scanash00", - "email": "103391616+scanash00@users.noreply.github.com", "discord": "827389583342698536" }, "record": { diff --git a/domains/seven.json b/domains/seven.json index 5762d7f61..c8b16cbbe 100644 --- a/domains/seven.json +++ b/domains/seven.json @@ -1,7 +1,6 @@ { "owner": { "username": "7op3", - "email": "134126156+7op3@users.noreply.github.com", "discord": "882124409945587773" }, "record": { diff --git a/domains/tf.json b/domains/tf.json index c3e6c7971..2e50f73c8 100644 --- a/domains/tf.json +++ b/domains/tf.json @@ -1,7 +1,6 @@ { "owner": { - "username": "WaspZix", - "email": "160319648+WaspZix@users.noreply.github.com" + "username": "WaspZix" }, "record": { "CNAME": "thefirst.glitch.me" diff --git a/domains/xkotelek.json b/domains/xkotelek.json index 18dd7be1e..0fa0378af 100644 --- a/domains/xkotelek.json +++ b/domains/xkotelek.json @@ -1,7 +1,6 @@ { "owner": { "username": "xKotelek", - "email": "98203141+xKotelek@users.noreply.github.com", "discord": "803159847641284640" }, "record": { diff --git a/tests/json.test.js b/tests/json.test.js index e6f77d5df..9e5a95cf7 100644 --- a/tests/json.test.js +++ b/tests/json.test.js @@ -165,11 +165,10 @@ t("All files should have valid required and optional fields", (t) => { // Validate email format if (data.owner.email) { t.regex(data.owner.email, emailRegex, `${file}: Owner email should be a valid email address`); - t.true(!data.owner.email.endsWith("@users.noreply.github.com"), `${file}: Owner email should not be a GitHub no-reply email`); } - // Ensure 'record' field is not empty - t.true(Object.keys(data.record).length > 0, `${file}: Missing DNS records`); + // Ensure 'record' field is not empty unless using redirect_config + t.true(Object.keys(data.record).length > 0 || data.redirect_config.custom_paths, `${file}: Missing DNS records`); }); }); diff --git a/tests/records.test.js b/tests/records.test.js index 223971308..255b482fc 100644 --- a/tests/records.test.js +++ b/tests/records.test.js @@ -215,8 +215,8 @@ function validateRecordValues(t, data, file) { `${urlMessage} must start with a slash, contain only alphanumeric characters, hyphens, underscores, periods, and slashes, and cannot end with a slash at index ${idx}` ); t.true( - customPath.length >= 2 && customPath.length <= 255, - `${urlMessage} should be 2-255 characters long at index ${idx}` + customPath.length >= 1 && customPath.length <= 255, + `${urlMessage} should be 1-255 characters long at index ${idx}` ); // Validate the redirect URL @@ -266,15 +266,6 @@ t("All files should have valid record types", (t) => { `${file}: URL records cannot be combined with A, AAAA, or CNAME records` ); } - if (data.redirect_config) { - t.true( - recordKeys.includes("URL") || data.proxied, - `${file}: Redirect config must be combined with a URL record or the domain must be proxied` - ); - if (data.redirect_config.redirect_paths) { - t.true(recordKeys.includes("URL"), `${file}: redirect_config.redirect_paths requires a URL record`); - } - } validateRecordValues(t, data, file); }); From f613cabe1bc1abd6424573b035d1f2e9f5906678 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 13 Feb 2025 17:08:01 +0800 Subject: [PATCH 2/3] revert untested changes This partially reverts commit 6f5402a07247850fa7a08d0c2b74e2fe108195a2. --- dnsconfig.js | 5 ----- tests/json.test.js | 5 +++-- tests/records.test.js | 13 +++++++++++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dnsconfig.js b/dnsconfig.js index 636e74297..3cd55b011 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -103,11 +103,6 @@ for (var subdomain in domains) { if (domainData.record.URL) { records.push(A(subdomainName, IP("192.0.2.1"), CF_PROXY_ON)); } - - // Handle redirects - if (domainData.redirect_config && !domainData.record.A && !domainData.record.AAAA && !domainData.record.CNAME) { - records.push(A(subdomainName, IP("192.0.2.1"), CF_PROXY_ON)); - } } var options = { diff --git a/tests/json.test.js b/tests/json.test.js index 9e5a95cf7..e6f77d5df 100644 --- a/tests/json.test.js +++ b/tests/json.test.js @@ -165,10 +165,11 @@ t("All files should have valid required and optional fields", (t) => { // Validate email format if (data.owner.email) { t.regex(data.owner.email, emailRegex, `${file}: Owner email should be a valid email address`); + t.true(!data.owner.email.endsWith("@users.noreply.github.com"), `${file}: Owner email should not be a GitHub no-reply email`); } - // Ensure 'record' field is not empty unless using redirect_config - t.true(Object.keys(data.record).length > 0 || data.redirect_config.custom_paths, `${file}: Missing DNS records`); + // Ensure 'record' field is not empty + t.true(Object.keys(data.record).length > 0, `${file}: Missing DNS records`); }); }); diff --git a/tests/records.test.js b/tests/records.test.js index 255b482fc..223971308 100644 --- a/tests/records.test.js +++ b/tests/records.test.js @@ -215,8 +215,8 @@ function validateRecordValues(t, data, file) { `${urlMessage} must start with a slash, contain only alphanumeric characters, hyphens, underscores, periods, and slashes, and cannot end with a slash at index ${idx}` ); t.true( - customPath.length >= 1 && customPath.length <= 255, - `${urlMessage} should be 1-255 characters long at index ${idx}` + customPath.length >= 2 && customPath.length <= 255, + `${urlMessage} should be 2-255 characters long at index ${idx}` ); // Validate the redirect URL @@ -266,6 +266,15 @@ t("All files should have valid record types", (t) => { `${file}: URL records cannot be combined with A, AAAA, or CNAME records` ); } + if (data.redirect_config) { + t.true( + recordKeys.includes("URL") || data.proxied, + `${file}: Redirect config must be combined with a URL record or the domain must be proxied` + ); + if (data.redirect_config.redirect_paths) { + t.true(recordKeys.includes("URL"), `${file}: redirect_config.redirect_paths requires a URL record`); + } + } validateRecordValues(t, data, file); }); From 694c6667ee83022f33bbf0f5392920ffc537b5a3 Mon Sep 17 00:00:00 2001 From: William Harrison <87287585+wdhdev@users.noreply.github.com> Date: Thu, 13 Feb 2025 17:11:10 +0800 Subject: [PATCH 3/3] Delete domains/harrison.json --- domains/harrison.json | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 domains/harrison.json diff --git a/domains/harrison.json b/domains/harrison.json deleted file mode 100644 index 55dcef36b..000000000 --- a/domains/harrison.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "owner": { - "username": "wdhdev", - "email": "william@is-a.dev" - }, - "record": { - "URL": "https://william.is-a.dev" - }, - "redirect_config": { - "redirect_paths": true - } -}