mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-09-02 22:17:39 +00:00
Merge pull request #21750 from is-a-dev/wdhdev-patch-1
require strict parents for every level
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
"priority": 0,
|
||||
"weight": 5,
|
||||
"port": 32279,
|
||||
"target": "gold.magmanode.com"
|
||||
"target": "mc.3gee.is-a.dev"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"description": "api for karyakarsa",
|
||||
"repo": "https://github.com/WilloIzCitron/karyakarsa-rest-api",
|
||||
"owner": {
|
||||
"username": "WilloIzCitron",
|
||||
"twitter": "willoizcitron"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "karyakarsa-rest-api-production.up.railway.app"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "alvinsjoy",
|
||||
"discord": "825382504353234954"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "Created to allow nested subdomains to exist."
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "3geETR",
|
||||
"email": "egemacun@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "gold.magmanode.com"
|
||||
}
|
||||
}
|
||||
+14
-9
@@ -24,26 +24,31 @@ function getDomainData(subdomain) {
|
||||
t("Nested subdomains should not exist without a parent subdomain", (t) => {
|
||||
files.forEach((file) => {
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
const parentDomain = subdomain.split(".").reverse()[0];
|
||||
const parts = subdomain.split(".");
|
||||
|
||||
for (let i = 1; i < parts.length; i++) {
|
||||
const parent = parts.slice(i).join(".");
|
||||
if (parent.startsWith("_")) continue;
|
||||
|
||||
if (parentDomain !== subdomain) {
|
||||
t.true(
|
||||
parentDomain && files.includes(`${parentDomain}.json`),
|
||||
`${file}: Parent subdomain does not exist`
|
||||
files.includes(`${parent}.json`),
|
||||
`${file}: Parent subdomain "${parent}" does not exist`
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
t("Nested subdomains should not exist if the parent subdomain has NS records", (t) => {
|
||||
t("Nested subdomains should not exist if any parent subdomain has NS records", (t) => {
|
||||
files.forEach((file) => {
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
const parentDomain = subdomain.split(".").reverse()[0];
|
||||
const parts = subdomain.split(".");
|
||||
|
||||
if (parentDomain !== subdomain) {
|
||||
const parentData = getDomainData(parentDomain);
|
||||
for (let i = 1; i < parts.length; i++) {
|
||||
const parent = parts.slice(i).join(".");
|
||||
if (parent.startsWith("_") || !files.includes(`${parent}.json`)) continue;
|
||||
const parentData = getDomainData(parent);
|
||||
|
||||
t.true(!parentData.record.NS, `${file}: Parent subdomain has NS records`);
|
||||
t.true(!parentData.record.NS, `${file}: Parent subdomain "${parent}" has NS records`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user