mirror of
https://github.com/tiennm99/open-domains.git
synced 2026-10-13 04:15:12 +00:00
Merge branch 'main' into patch-1
This commit is contained in:
15 files changed
+49
-271
No files matched your search
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"description": "Portfolio project",
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "_github-pages-challenge-clay990.suraj",
|
||||
"owner": {
|
||||
"repo": "https://github.com/Clay990/suraj",
|
||||
"email": "asuraj991m@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": [
|
||||
"53a1f061ccd38386443e96e1948962"
|
||||
]
|
||||
},
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"description": "Playgroup website",
|
||||
|
||||
"domain": "is-local.org",
|
||||
"subdomain": "_github-pages-challenge-homesteadrd.homesteadrdplaygroup",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/homesteadrd/web",
|
||||
"email": "homesteadrdplaygroup@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["61fb25de94ffb44246bcda98b23911"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"description": "GitHub Pages Verification vrahmanov",
|
||||
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "_github-pages-challenge-jinix6.crystalperson",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/jinix6/Craftland",
|
||||
"email": "nanusahoo05@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["50eb7583c6eeedf6f67806138d93bd"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"description": "Verifying custom domain on Github",
|
||||
|
||||
"domain": "is-local.org",
|
||||
"subdomain": "_github-pages-challenge-jinix6.crystalperson",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/jinix6/crystalperson.github.io",
|
||||
"email": "nanusahoo05@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["50eb7583c6eeedf6f67806138d93bd"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"description": "My portfolio hosted on GitHub Pages",
|
||||
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "_github-pages-challenge-Narmis-E.narmis",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/narmis-e/portfolio",
|
||||
"email": "narmisecurb@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["4213f5eb992ffe0d720bc237736a46"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"description": "For verifying my domain with github pages",
|
||||
|
||||
"domain": "is-local.org",
|
||||
"subdomain": "_github-pages-challenge-OpenOrganizationName.climatehealthei",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/FizzWizZleDazzle/climatehealthei.github.io",
|
||||
"email": "arturmisiurev@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["b038216c5480f640390bfcc7168d92"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"domain": "is-local.org",
|
||||
"subdomain": "_github-pages-challenge-py660.python660",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/py660/py660",
|
||||
"email": "py660@irc.cluster.ws"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["9f7bbf7a0a097f15d0b5c76076d9dd"]
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"description": "To verify this domain for our github org",
|
||||
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "_github-pages-challenge-TDevTeam.thedevteam",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/tdevteam",
|
||||
"email": "TheDevTeam@protonmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["5e99f2d515b93bdffe4b1e960e1a85"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"description": "Personal Website",
|
||||
|
||||
"domain": "localplayer.dev",
|
||||
"subdomain": "_github-pages-challenge-vijay2249.coachbeardjr",
|
||||
|
||||
"owner": {
|
||||
"email": "coachbeardjr.vvm8p@slmail.me"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["dc0ebd8500ded55870bc8806c70dd5"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"description": "GitHub Pages Verification",
|
||||
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "_github-pages-challenge-YesnielX.yesnielx",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/YesnielX/yesnielx.github.io",
|
||||
"email": "yesnielviv2@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["f5fe834daad27fc92c5d3a4b2e0135"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"description": "Amplify's Fullstack Domain",
|
||||
"domain": "is-a-fullstack.dev",
|
||||
"subdomain": "amplify",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/not-amplify/free-domain/",
|
||||
"email": "not.amplify@night-x.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"NS" : ["summer.ns.cloudflare.com", "terry.ns.cloudflare.com" ]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,16 +1,14 @@
|
||||
{
|
||||
"description": "mycodelab mail, this is for temporary so i can transfer my mails to another account",
|
||||
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "devil._domainkey.host.mycodelab",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/ShadowGaming100/register"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"TXT": ["v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRR//eLOhnpXyeRihLl1AnM/Ysj4cFG6873HAzsL4ubge6mmzmwGtb9xWQiY79kAfpQBv+CFnirFvMdZQldcJDMCbcrbeEBMaNxOi5udf1lmLH/6M1VMnu6Y2VCCoBSP7XhHqOVWDkThi1ROFB6mKwZQkypo+fz7tE6xwgVkJBCQIDAQAB;"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
"description": "mycodelab mail, this is for temporary so i can transfer my mails to another account",
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "devil._domainkey.host.mycodelab",
|
||||
"owner": {
|
||||
"repo": "https://github.com/ShadowGaming100/register"
|
||||
},
|
||||
"record": {
|
||||
"TXT": [
|
||||
"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDRR//eLOhnpXyeRihLl1AnM/Ysj4cFG6873HAzsL4ubge6mmzmwGtb9xWQiY79kAfpQBv+CFnirFvMdZQldcJDMCbcrbeEBMaNxOi5udf1lmLH/6M1VMnu6Y2VCCoBSP7XhHqOVWDkThi1ROFB6mKwZQkypo+fz7tE6xwgVkJBCQIDAQAB;"
|
||||
]
|
||||
},
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"description": "Personal Cloud Study",
|
||||
|
||||
"domain": "is-cool.dev",
|
||||
"subdomain": "potpry",
|
||||
|
||||
"owner": {
|
||||
"email": "potprytest+open-domains@gmail.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"A": ["158.247.216.53"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"description": "website",
|
||||
|
||||
"domain": "localplayer.dev",
|
||||
"subdomain": "privacy.isdev",
|
||||
|
||||
"owner": {
|
||||
"repo": "https://github.com/is-a-dev/register",
|
||||
"email": "andrew@win11react.com"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"MX": ["mx.sendgrid.net"]
|
||||
},
|
||||
|
||||
"proxied": false
|
||||
}
|
||||
+37
-42
@@ -5,16 +5,17 @@ const path = require("path");
|
||||
const domainsPath = path.resolve("domains");
|
||||
const files = fs.readdirSync(domainsPath);
|
||||
|
||||
/**
|
||||
* Helper function to determine if a subdomain is a root domain.
|
||||
* A root domain is assumed to be exactly two parts (e.g., "is-cool.dev").
|
||||
*/
|
||||
function isRootDomain(domain) {
|
||||
return domain.split(".").length === 2;
|
||||
}
|
||||
// Extract valid root domains dynamically from the files
|
||||
const validRootDomains = Array.from(
|
||||
new Set(
|
||||
files
|
||||
.map((file) => file.split(".").slice(-2).join("."))
|
||||
.filter((domain) => domain.endsWith(".dev") || domain.endsWith(".org"))
|
||||
)
|
||||
);
|
||||
|
||||
t("Nested subdomains should not exist without a parent subdomain", (t) => {
|
||||
const issues = [];
|
||||
t("Nested subdomains should not exist without a valid parent domain", (t) => {
|
||||
const invalidFiles = [];
|
||||
|
||||
files.forEach((file) => {
|
||||
// Skip directories and process only .json files
|
||||
@@ -25,28 +26,27 @@ t("Nested subdomains should not exist without a parent subdomain", (t) => {
|
||||
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
|
||||
if (subdomain.split(".").length > 2) {
|
||||
// Get parent domain by removing the leftmost part
|
||||
const parentSubdomain = subdomain.split(".").slice(1).join(".");
|
||||
// Find the first-level parent subdomain
|
||||
const parentSubdomainParts = subdomain.split(".");
|
||||
const rootDomain = parentSubdomainParts.slice(-2).join(".");
|
||||
const firstLevelParent = `${parentSubdomainParts.slice(-3, -2)[0]}.${rootDomain}`;
|
||||
|
||||
// Skip check if the parent subdomain is a root domain
|
||||
if (isRootDomain(parentSubdomain)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the parent subdomain exists
|
||||
if (!files.includes(`${parentSubdomain}.json`)) {
|
||||
issues.push(`${file}: Parent subdomain ${parentSubdomain}.json does not exist`);
|
||||
}
|
||||
if (
|
||||
parentSubdomainParts.length > 2 && // Must have at least one subdomain
|
||||
validRootDomains.includes(rootDomain) && // Must belong to a valid root domain
|
||||
!files.includes(`${firstLevelParent}.json`) // Parent must exist
|
||||
) {
|
||||
invalidFiles.push(`${file}: Parent domain ${firstLevelParent}.json does not exist`);
|
||||
}
|
||||
});
|
||||
|
||||
// Report all issues at once
|
||||
t.deepEqual(issues, [], `Found issues:\n${issues.join("\n")}`);
|
||||
// Fail the test if there are invalid files
|
||||
invalidFiles.forEach((message) => t.fail(message));
|
||||
t.pass();
|
||||
});
|
||||
|
||||
t("Nested subdomains should not exist if the parent subdomain has NS records", (t) => {
|
||||
const issues = [];
|
||||
t("Nested subdomains should not exist if the parent domain has NS records", (t) => {
|
||||
const invalidFiles = [];
|
||||
|
||||
files.forEach((file) => {
|
||||
// Skip directories and process only .json files
|
||||
@@ -57,30 +57,25 @@ t("Nested subdomains should not exist if the parent subdomain has NS records", (
|
||||
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
|
||||
if (subdomain.split(".").length > 2) {
|
||||
// Get parent domain by removing the leftmost part
|
||||
const parentSubdomain = subdomain.split(".").slice(1).join(".");
|
||||
const parentFilePath = path.join(domainsPath, `${parentSubdomain}.json`);
|
||||
// Find the first-level parent subdomain
|
||||
const parentSubdomainParts = subdomain.split(".");
|
||||
const rootDomain = parentSubdomainParts.slice(-2).join(".");
|
||||
const firstLevelParent = `${parentSubdomainParts.slice(-3, -2)[0]}.${rootDomain}`;
|
||||
const parentFilePath = path.join(domainsPath, `${firstLevelParent}.json`);
|
||||
|
||||
// Skip check if the parent subdomain is a root domain
|
||||
if (isRootDomain(parentSubdomain)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the parent file exists before attempting to read it
|
||||
if (parentSubdomainParts.length > 2 && validRootDomains.includes(rootDomain)) {
|
||||
if (fs.existsSync(parentFilePath)) {
|
||||
const parentDomain = fs.readJsonSync(parentFilePath);
|
||||
|
||||
// Check if the parent has NS records
|
||||
if (parentDomain.record.NS !== undefined) {
|
||||
issues.push(`${file}: Parent subdomain ${parentSubdomain} has NS records`);
|
||||
if (parentDomain.record?.NS) {
|
||||
invalidFiles.push(`${file}: Parent domain ${firstLevelParent} has NS records`);
|
||||
}
|
||||
} else {
|
||||
issues.push(`${file}: Parent subdomain ${parentSubdomain}.json file does not exist`);
|
||||
invalidFiles.push(`${file}: Parent domain ${firstLevelParent}.json does not exist`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Report all issues at once
|
||||
t.deepEqual(issues, [], `Found issues:\n${issues.join("\n")}`);
|
||||
// Fail the test if there are invalid files
|
||||
invalidFiles.forEach((message) => t.fail(message));
|
||||
t.pass();
|
||||
});
|
||||
Reference in new issue
Block a user