mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-08-23 02:23:59 +00:00
Merge branch 'main' into main
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
# is-a.dev Team
|
||||
| Name | GitHub | Role |
|
||||
|:-:|-|-|
|
||||
| Akshay | [@phenax](https://github.com/phenax) | Owner |
|
||||
| William | [@wdhdev](https://github.com/wdhdev) | Administrator |
|
||||
| CuteDog5695 | [@CuteDog5695](https://github.com/CuteDog5695) | Maintainer |
|
||||
| Daniel | [@hackermondev](https://github.com/hackermondev) | Maintainer |
|
||||
| DIBSTER | [@DEV-DIBSTER](https://github.com/DEV-DIBSTER) | Maintainer |
|
||||
| Om | [@omsenjalia](https://github.com/omsenjalia) | Maintainer |
|
||||
| orangc | [@orangci](https://github.com/orangci) | Maintainer |
|
||||
| Stef | [@Stef-00012](https://github.com/Stef-00012) | Maintainer |
|
||||
@@ -14,8 +14,6 @@
|
||||
|
||||
<p align="center"><strong>is-a-dev</strong> is a service that allows developers to get a sweet-looking ".is-a.dev" domain for their personal websites.</p>
|
||||
|
||||
[](https://github.com/is-a-dev/register/actions/workflows/publish.yml)
|
||||
|
||||
## Announcements & Status Updates
|
||||
Please join our [Discord server](https://discord.gg/is-a-dev-830872854677422150) for announcements, updates & upgrades, and downtimes regarding the service.
|
||||
Not all of these will be posted on GitHub, however they will always be posted in our Discord server.
|
||||
|
||||
+43
-10
@@ -29,14 +29,18 @@ 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)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +48,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.flags,
|
||||
caaRecord.tag,
|
||||
caaRecord.value
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +63,13 @@ for (var subdomain in domains) {
|
||||
if (domainData.record.CNAME) {
|
||||
// Allow CNAME record on root
|
||||
if (subdomainName === "@") {
|
||||
records.push(ALIAS(subdomainName, domainData.record.CNAME + ".", proxyState));
|
||||
records.push(
|
||||
ALIAS(subdomainName, domainData.record.CNAME + ".", proxyState)
|
||||
);
|
||||
} else {
|
||||
records.push(CNAME(subdomainName, domainData.record.CNAME + ".", proxyState));
|
||||
records.push(
|
||||
CNAME(subdomainName, domainData.record.CNAME + ".", proxyState)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +78,13 @@ 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
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -71,7 +92,13 @@ 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] + "."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +114,13 @@ 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 + "."
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -96,10 +129,10 @@ for (var subdomain in domains) {
|
||||
if (domainData.record.TXT) {
|
||||
if (Array.isArray(domainData.record.TXT)) {
|
||||
for (var txt in domainData.record.TXT) {
|
||||
records.push(TXT(subdomainName, "\"" + domainData.record.TXT[txt] + "\""));
|
||||
records.push(TXT(subdomainName, domainData.record.TXT[txt].length <= 255 ? "\"" + domainData.record.TXT[txt] + "\"" : domainData.record.TXT[txt]));
|
||||
}
|
||||
} else {
|
||||
records.push(TXT(subdomainName, "\"" + domainData.record.TXT + "\""));
|
||||
records.push(TXT(subdomainName, domainData.record.TXT.length <= 255 ? "\"" + domainData.record.TXT + "\"" : domainData.record.TXT));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -5,6 +5,5 @@
|
||||
},
|
||||
"record": {
|
||||
"URL": "https://shockbs.is-a.dev/"
|
||||
},
|
||||
"proxied": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "akk1to",
|
||||
"email": "akk1to.dev@gmail.com",
|
||||
"discord": "727497287777124414"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["dh=1a950b0754b823073a474660fa065a40a6a77009"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "gokul6350",
|
||||
"email": "gokul00060@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["dh=55a65497a2c3938fee2de54e3600a5b55524016c"]
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "winter7eaf",
|
||||
"username": "catrinlam",
|
||||
"discord": "614054830360494100"
|
||||
},
|
||||
"record": {
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "hardianto01",
|
||||
"email": "hardiantojek92@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["vc-domain-verify=anto.is-a.dev,c6f0fc6ee41a39c2c435"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "syedtahseen",
|
||||
"email": ""
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["vc-domain-verify=arshman.is-a.dev,b92115f7845437a44890"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "gokul6350",
|
||||
"email": "gokul00060@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["vc-domain-verify=gokulbarath.is-a.dev,b6d252e3dde12b69cc05"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "notreallyprince",
|
||||
"email": "prince30112001@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"TXT": "vc-domain-verify=princeprajapati.is-a.dev,9b919407776e11ecff7a"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "leofelix908",
|
||||
"email": ""
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["vc-domain-verify=v.is-a.dev,9bd0999222ffc1417790"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "itahseen",
|
||||
"email": ""
|
||||
},
|
||||
"record": {
|
||||
"TXT": ["vc-domain-verify=victoria.is-a.dev,c0c6d37bd2ddf96a77aa"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"description": "Admir",
|
||||
"repo": "https://github.com/justadmir/justadmir.github.io",
|
||||
"owner": {
|
||||
"username": "justadmir",
|
||||
"email": "admirtahiraj242@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "justadmir.github.io"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"description": "website for my links",
|
||||
"repo": "https://github.com/amenm0/littlelink.github.io",
|
||||
"owner": {
|
||||
"username": "amenm0",
|
||||
"email": "mjmwtmjls@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"A": [
|
||||
"185.199.108.153",
|
||||
"185.199.109.153",
|
||||
"185.199.110.153",
|
||||
"185.199.111.153"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "hardianto01",
|
||||
"email": "hardiantojek92@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"A": ["76.76.21.21"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"description": "This website is my personal portfollo XD (let it on rq)",
|
||||
"repo": "https://github.com/akk1to/atgtsystem",
|
||||
"owner": {
|
||||
"username": "akk1to",
|
||||
"email": "akk1to.dev@gmail.com",
|
||||
"discord": "727497287777124414"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "akk1to.github.io"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "syedtahseen",
|
||||
"email": ""
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "arshman.vercel.app"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"description": "My Portfolio",
|
||||
"repo": "https://github.com/AYn0nyme/ayn0nyme.github.io",
|
||||
"owner": {
|
||||
"username": "AYn0nyme",
|
||||
"email": "aynonyme@proton.me"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "ayn0nyme.github.io"
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "winter7eaf",
|
||||
"username": "catrinlam",
|
||||
"email": "winter.leafie@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "winter7eaf.github.io"
|
||||
"CNAME": "catrinlam.github.io"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "CrescentMoon2506",
|
||||
"email": "crescentmoon2506@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "crescentmoon2506.github.io"
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"record": {
|
||||
"A": ["75.2.60.5"],
|
||||
"MX": ["mx1.improvmx.com", "mx2.improvmx.com"],
|
||||
"TXT": "v=spf1 include:spf.improvmx.com ~all"
|
||||
"MX": ["mx1.simplelogin.co", "mx2.simplelogin.co"],
|
||||
"TXT": ["sl-verification=wpdcbpaapmqwevjvnaifhpwdvozldi", "v=spf1 include:simplelogin.co. ~all"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
"email": "divyanshudhruv24@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "divyanshudhruv.github.io"
|
||||
"CNAME": "divyanshudhruv.netlify.app"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "elorahub",
|
||||
"email": "elorahubph@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "apex-loadbalancer.netlify.com"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "xgeneric",
|
||||
"email": "",
|
||||
"discord": "1194494419064328296",
|
||||
"OWL": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiUlNBLU9BRVAiLCJraWQiOiJaa1VsRmRqVThiUEstLXVVM2JJR09PVHFYYVFFS1ZINFVXOW53MTR6WTJnIn0.pNI-ARrj3J_tLM7pZiRwu1pfmk-Q3DwQqCqxWO02M876wVSFVYCtmViotPvUkXbGD6fungda4WYZn9FbbIFMroM6lyRd5facNKDKej8YSmA4vHrk82WnwOjIOgJZVvG1KBZ-a8-WJaBMTFTnA5HcDdIPKalVi8WuEBZ0aX5oePC_OmMgL8dfo8sc_Yh6iH_cQQsHyqTmEqaFIZdnchM3zqP5SztLpMqx7J-t65lJmSVdvlVIyCOVGGtnSu6p-mqsRqJ0_GTaxZq13p33OlN2H-aHiYLhuUNq1PNAMVMjBHvLwKx53QPYHkWH_49PYOAofaB5Qu4FQehMfMeEDPJY3w.qTLCxzxvVwoOjhI2BRDjcQ.fknkRF_e0XxYo2aGLv16XqzezYSUJAsZEV1IvnuErIAUeo5iEOL_6tjx67aBPV7GaJ-bulYZxzfcm7w8t2fd3dj4YWle3bpexZZ25GhR9RtlbCvQ1MybtvMWt9kMjbIM.AYS1UwZHLOklvLllhjQpLA"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"CNAME": "xgeneric.github.io"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
{
|
||||
"description": "my personal website ",
|
||||
"repo": "https://github.com/gokul6350/gokul6350.github.io",
|
||||
"owner": {
|
||||
"username": "gokul6350",
|
||||
"email": "gokul00060@gmail.com",
|
||||
"twitter": "gokul00060"
|
||||
"email": "gokul00060@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "gokul6350.github.io"
|
||||
"CNAME": "portfolio-gokul6350s-projects.vercel.app"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "hxphsts",
|
||||
"email": "hxphsts@kernelx.ai"
|
||||
},
|
||||
"record": {
|
||||
"URL": "https://hxphsts.kernelx.ai"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "IacopoSb",
|
||||
"discord": "442322290206703628",
|
||||
"OWL": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiUlNBLU9BRVAiLCJraWQiOiJaa1VsRmRqVThiUEstLXVVM2JJR09PVHFYYVFFS1ZINFVXOW53MTR6WTJnIn0.Hn0wg5RpzADaJvecwSHu8KpOj-Z_oG7i08e9Z62Give15eiaNXJzezQ9d7noux00NeBYHyoAWfBB5IQ4_XXWy75cLfR2N0A80Lod8D9f6zaWhH6HOcKrauCVolIJBBrzMfTXkWpi-yt74WFtQtfkjlOYren1QB6T_EqyLps5kEJxM08Vubn49m7ckSkNh2bRNJ5NfprPwjrGrHwrdsQqCDiVWn7SL7Dp-Qs-9X1m6nsbyr4shb1BA9X3embdAeL34Yq4GMaIje2tj991jpzq0lW1wGDAZweffw2cJf4xtzC1V0BBWPJDm3ye8eWWrhyOlOmVmK5xqduHk_GJ4jB__g.C50OguoaaY8-9Y9OheaUJw.pc_1FvYpLmydbLCQBa262CG2ROnCFJl-oxfguFWsFv7xDqFr5dRyEZVdEkO8J1UxQFAbO4fm3uEKV1JXDPqdl-6xZF9cpsEkOTZ72Gb2PiY.hYU41zXsd0lJbcQwO59cwA"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"NS": ["marge.ns.cloudflare.com", "dan.ns.cloudflare.com"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "Pele12324",
|
||||
"email": "pele.puric@gmail.com",
|
||||
"discord": "483261654818226186"
|
||||
},
|
||||
"record": {
|
||||
"A": ["38.242.242.224"]
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@
|
||||
"username": "jsuryakt"
|
||||
},
|
||||
"record": {
|
||||
"A": ["72.2.60.5"]
|
||||
"A": [
|
||||
"75.2.60.5"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "kagarifuyukawa",
|
||||
"email": "fuyukawabot@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "kagarifuyukawa.github.io"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "boolean44-repos",
|
||||
"email": "serenitypalmer10@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"MX": ["mx1.forwardemail.net", "mx2.forwardemail.net"],
|
||||
"TXT": ["forward-email=palmerowen100@gmail.com"]
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,14 @@
|
||||
"email": "7sz8jlw6h@mozmail.com"
|
||||
},
|
||||
"record": {
|
||||
"MX": [
|
||||
"mx.zoho.eu",
|
||||
"mx2.zoho.eu",
|
||||
"mx3.zoho.eu"
|
||||
],
|
||||
"TXT": [
|
||||
"mail.masseo.zoho-verification=zb53346473.zmverify.zoho.eu"
|
||||
"v=spf1 include:zohomail.eu ~all",
|
||||
"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCBdKJ9pgi76G8kOhX1v4hDt3jros0cBQMLMeKc8L6F8iLBUz78XwP4qRO/1sfdl1vSavi+KsybaNotnLfA2+vA+txPzR/zUEdPWTZhz/Q7iQqo7AuX8hZDY2emDA/0wAkSVAQ1i/KKmSnnR1q6RvJcjPmVCW2gjpw9MOfCwt7PAwIDAQAB"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "NotJunar",
|
||||
"discord": "notjunar"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "notjunar.github.io"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "Pele12324",
|
||||
"email": "pele.puric@gmail.com",
|
||||
"discord": "483261654818226186"
|
||||
},
|
||||
"record": {
|
||||
"A": ["38.242.242.224"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "notreallyprince",
|
||||
"email": "prince30112001@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "princexd.vercel.app"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "qxb3",
|
||||
"email": "qxbthree@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"A": [
|
||||
"75.2.60.5"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "kartikshriwas",
|
||||
"email": ""
|
||||
},
|
||||
|
||||
"record": {
|
||||
"CNAME": "rammeghe.github.io"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"description": "Sandbox environment for is-a.dev",
|
||||
"owner": {
|
||||
"username": "is-a-dev"
|
||||
},
|
||||
"record": {
|
||||
"NS": [
|
||||
"blue.foundationdns.com",
|
||||
"blue.foundationdns.net",
|
||||
"blue.foundationdns.org"
|
||||
],
|
||||
"DS": [
|
||||
{
|
||||
"key_tag": 2371,
|
||||
"algorithm": 13,
|
||||
"digest_type": 2,
|
||||
"digest": "023DD50C657C5F2471728B76127008F244CFB45F32AA0CE1978C0182D363EF12"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "Sxinar",
|
||||
"email": "oshidev@proton.me",
|
||||
"discord": "1247896918957490198"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "sxi.digitalpress.blog"
|
||||
}
|
||||
"owner": {
|
||||
"username": "Sxinar",
|
||||
"email": "oshidev@proton.me",
|
||||
"discord": "1247896918957490198"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "sxi.digitalpress.blog"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "leofelix908",
|
||||
"email": ""
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "xproject-xi.vercel.app"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "itahseen",
|
||||
"email": ""
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "viktoriaa.vercel.app"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "VoidedGorilla",
|
||||
"discord": "999697070288027800"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "voidedgorilla.github.io"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "VulcanoSoftware",
|
||||
"email": "",
|
||||
"discord": "814891541205876767",
|
||||
"OWL": "eyJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiUlNBLU9BRVAiLCJraWQiOiJaa1VsRmRqVThiUEstLXVVM2JJR09PVHFYYVFFS1ZINFVXOW53MTR6WTJnIn0.OSN3PUPj-tyBSww7jRiLu3F9KJHZLnuunCHNQKcFiZF_qRsPd9uVTMBljFhRUAAzBM9lfFsRtBQnEUYqEyuWUq8e_fYYopTTJ2eoMj4tjkBAYbwRJG4FiT1LFDpDR0YtuSk-XgUFSi4HVBHAMnaAJ92Ez3_APNRBfspLSeSWRrr-aVYej5z_GusGjujgt1RnGX13HZTy7sQZSdGB6fztcxJEwMtAdAvc_GPA7t6oY1GJaVkl9JP0_s7VYkUDkA_msvFfPO2bT_aRi3CL1LwjRMzsS3hzhOK-qBc2mRD8Ea0F64wNaLYcYQINexXnxgF6toTHl9ZXiyKbOGVPuH1Ufw.2NmlL0bO_wxEmb-6eWlCyQ._ewSj4Dp8XIIfDqlriYtXKqrlYv70uhnEX0_pvFNsZ_L3AM4yGHw1aCFiAZkgOB3rCEEKEX2m4sMmApEhvmgh7rm2Y615R1QuJdwiDU332Z7NTtoTSb8LfYKN8Z-sX66.nQYEU4bu7Mrtfg4u57iRcQ"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"CNAME": "vulcanoweb.pages.dev"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
"email": "william@is-a.dev"
|
||||
},
|
||||
"record": {
|
||||
"NS": ["bingo.ns.cloudflare.com", "matias.ns.cloudflare.com"]
|
||||
"NS": ["bingo.ns.cloudflare.com", "matias.ns.cloudflare.com"],
|
||||
"DS": [
|
||||
{
|
||||
"key_tag": 2371,
|
||||
"algorithm": 13,
|
||||
"digest_type": 2,
|
||||
"digest": "CC332225EB1A226C72D83767ACC3834FE20C129CBD8B1A74FBDCBAD36624B2E0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "winter&eaf",
|
||||
"username": "catrinlam",
|
||||
"discord": "614054830360494100"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "winter&eaf",
|
||||
"username": "catrinlam",
|
||||
"discord": "614054830360494100"
|
||||
},
|
||||
"record": {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"owner": {
|
||||
"username": "ZxLbni",
|
||||
"email": "dolabani46@gmail.com"
|
||||
},
|
||||
"record": {
|
||||
"CNAME": "ZxLbni.github.io"
|
||||
}
|
||||
}
|
||||
Generated
+2437
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -26,14 +26,14 @@ const hostnameRegex = /^(?=.{1,253}$)(?:(?:[_a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-z
|
||||
const domainsPath = path.resolve("domains");
|
||||
const files = fs.readdirSync(domainsPath);
|
||||
|
||||
const validateRequiredFields = (t, obj, requiredFields, file) => {
|
||||
function validateRequiredFields(t, obj, requiredFields, file) {
|
||||
Object.keys(requiredFields).forEach((key) => {
|
||||
t.true(obj.hasOwnProperty(key), `${file}: Missing required field: ${key}`);
|
||||
t.is(typeof obj[key], requiredFields[key], `${file}: Field ${key} should be of type ${requiredFields[key]}`);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const validateOptionalFields = (t, obj, optionalFields, file) => {
|
||||
function validateOptionalFields(t, obj, optionalFields, file) {
|
||||
Object.keys(optionalFields).forEach((key) => {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
t.is(
|
||||
@@ -43,7 +43,7 @@ const validateOptionalFields = (t, obj, optionalFields, file) => {
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
t("All files should be valid JSON", (t) => {
|
||||
files.forEach((file) => {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
const t = require("ava");
|
||||
const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
|
||||
const requiredRecordsToProxy = ["A", "AAAA", "CNAME"];
|
||||
// URL records are not listed here because they are proxied by default, so they don't need the proxied flag
|
||||
|
||||
function validateProxiedRecords(t, data, file) {
|
||||
if (data.proxied) {
|
||||
const hasProxiedRecord = Object.keys(data.record).some((key) => requiredRecordsToProxy.includes(key));
|
||||
|
||||
t.true(hasProxiedRecord, `${file}: Proxied is true but there are no records that can be proxied`);
|
||||
}
|
||||
}
|
||||
|
||||
const domainsPath = path.resolve("domains");
|
||||
const files = fs.readdirSync(domainsPath);
|
||||
|
||||
t("Domains with proxy enabled should have have at least one record that can be proxied", (t) => {
|
||||
files.forEach((file) => {
|
||||
const domain = fs.readJsonSync(path.join(domainsPath, file));
|
||||
|
||||
validateProxiedRecords(t, domain, file);
|
||||
});
|
||||
});
|
||||
+278
-29
@@ -2,22 +2,90 @@ const t = require("ava");
|
||||
const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
|
||||
const {
|
||||
checkCNAME,
|
||||
checkNSAndDS,
|
||||
validateHostname,
|
||||
validateIPv4,
|
||||
validateIPv6,
|
||||
validateSpecialRecords,
|
||||
validateTXT,
|
||||
validateURL
|
||||
} = require("../utils/records");
|
||||
|
||||
const validRecordTypes = ["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NS", "SRV", "TXT", "URL"];
|
||||
|
||||
const hostnameRegex = /^(?=.{1,253}$)(?:(?:[_a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)\.)+[a-zA-Z]{2,63}$/;
|
||||
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}$/;
|
||||
const ipv6Regex =
|
||||
/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$|^::(?:[0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}$|^(?:[0-9a-fA-F]{1,4}:){1,7}:$|^(?:[0-9a-fA-F]{1,4}:){0,6}::(?:[0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}$/;
|
||||
|
||||
const domainsPath = path.resolve("domains");
|
||||
const files = fs.readdirSync(domainsPath);
|
||||
|
||||
function expandIPv6(ip) {
|
||||
// Split into segments by ":"
|
||||
let segments = ip.split(":");
|
||||
|
||||
// Count the number of segments that are empty due to "::" shorthand
|
||||
const emptyIndex = segments.indexOf("");
|
||||
if (emptyIndex !== -1) {
|
||||
// Calculate how many "0000" segments are missing
|
||||
const nonEmptySegments = segments.filter((seg) => seg !== "");
|
||||
const missingSegments = 8 - nonEmptySegments.length;
|
||||
|
||||
// Insert the missing "0000" segments into the position of the empty segment
|
||||
segments = [
|
||||
...nonEmptySegments.slice(0, emptyIndex),
|
||||
...Array(missingSegments).fill("0000"),
|
||||
...nonEmptySegments.slice(emptyIndex)
|
||||
];
|
||||
}
|
||||
|
||||
// Expand each segment to 4 characters, padding with leading zeros
|
||||
const expandedSegments = segments.map((segment) => segment.padStart(4, "0"));
|
||||
|
||||
// Join the segments back together
|
||||
return expandedSegments.join(":");
|
||||
}
|
||||
|
||||
function isPublicIPv4(ip, proxied) {
|
||||
const parts = ip.split(".").map(Number);
|
||||
|
||||
// Validate IPv4 address format
|
||||
if (parts.length !== 4 || parts.some((part) => isNaN(part) || part < 0 || part > 255)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Exception for 192.0.2.1, assuming the domain is proxied
|
||||
if (ip === "192.0.2.1" && proxied) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for private and reserved IPv4 ranges
|
||||
return !(
|
||||
// Private ranges
|
||||
(
|
||||
parts[0] === 10 ||
|
||||
(parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31) ||
|
||||
(parts[0] === 192 && parts[1] === 168) ||
|
||||
// Reserved or special-use ranges
|
||||
(parts[0] === 100 && parts[1] >= 64 && parts[1] <= 127) || // Carrier-grade NAT
|
||||
(parts[0] === 169 && parts[1] === 254) || // Link-local
|
||||
(parts[0] === 192 && parts[1] === 0 && parts[2] === 0) || // IETF Protocol Assignments
|
||||
(parts[0] === 192 && parts[1] === 0 && parts[2] === 2) || // Documentation (TEST-NET-1)
|
||||
(parts[0] === 198 && parts[1] === 18) || // Network Interconnect Devices
|
||||
(parts[0] === 198 && parts[1] === 51 && parts[2] === 100) || // Documentation (TEST-NET-2)
|
||||
(parts[0] === 203 && parts[1] === 0 && parts[2] === 113) || // Documentation (TEST-NET-3)
|
||||
parts[0] >= 224
|
||||
) // Multicast and reserved ranges
|
||||
);
|
||||
}
|
||||
|
||||
function isPublicIPv6(ip) {
|
||||
const normalizedIP = ip.toLowerCase();
|
||||
|
||||
// Check for private or special-use IPv6 ranges
|
||||
return !(
|
||||
(
|
||||
normalizedIP.startsWith("fc") || // Unique Local Address (ULA)
|
||||
normalizedIP.startsWith("fd") || // Unique Local Address (ULA)
|
||||
normalizedIP.startsWith("fe80") || // Link-local
|
||||
normalizedIP.startsWith("::1") || // Loopback address (::1)
|
||||
normalizedIP.startsWith("2001:db8")
|
||||
) // Documentation range
|
||||
);
|
||||
}
|
||||
|
||||
t("All files should have valid record types", (t) => {
|
||||
files.forEach((file) => {
|
||||
const data = fs.readJsonSync(path.join(domainsPath, file));
|
||||
@@ -27,14 +95,30 @@ t("All files should have valid record types", (t) => {
|
||||
t.true(validRecordTypes.includes(key), `${file}: Invalid record type: ${key}`);
|
||||
});
|
||||
|
||||
checkCNAME(t, file, recordKeys);
|
||||
checkNSAndDS(t, file, recordKeys);
|
||||
// CNAME records cannot be combined with any other record type
|
||||
if (recordKeys.includes("CNAME")) {
|
||||
t.is(recordKeys.length, Number(1), `${file}: CNAME records cannot be combined with other records`);
|
||||
}
|
||||
|
||||
// NS records cannot be combined with any other record type, except for DS records
|
||||
if (recordKeys.includes("NS")) {
|
||||
t.true(
|
||||
recordKeys.length === 1 || (recordKeys.length === 2 && recordKeys.includes("DS")),
|
||||
`${file}: NS records cannot be combined with other records, except for DS records`
|
||||
);
|
||||
}
|
||||
|
||||
// DS records must be combined with NS records
|
||||
if (recordKeys.includes("DS")) {
|
||||
t.true(recordKeys.includes("NS"), `${file}: DS records must be combined with NS records`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
t("All files should not have duplicate record keys", (t) => {
|
||||
files.forEach((file) => {
|
||||
const data = fs.readJsonSync(path.join(domainsPath, file));
|
||||
|
||||
const recordKeys = Object.keys(data.record);
|
||||
const uniqueRecordKeys = new Set(recordKeys);
|
||||
|
||||
@@ -45,34 +129,199 @@ t("All files should not have duplicate record keys", (t) => {
|
||||
t("All files should have valid record values", (t) => {
|
||||
files.forEach((file) => {
|
||||
const data = fs.readJsonSync(path.join(domainsPath, file));
|
||||
|
||||
Object.keys(data.record).forEach((key) => {
|
||||
const value = data.record[key];
|
||||
|
||||
// *: string[]
|
||||
if (["A", "AAAA", "MX", "NS"].includes(key)) {
|
||||
t.true(Array.isArray(value), `${file}: Record value should be an array for ${key}`);
|
||||
|
||||
value.forEach((record) =>
|
||||
t.true(typeof record === "string", `${file}: Record value should be a string for ${key}`)
|
||||
);
|
||||
value.forEach((record) => {
|
||||
t.true(typeof record === "string", `${file}: Record value should be a string for ${key}`);
|
||||
});
|
||||
|
||||
if (key === "A") validateIPv4(t, file, key, value, data);
|
||||
if (key === "AAAA") validateIPv6(t, file, key, value);
|
||||
if (["MX", "NS"].includes(key)) validateHostname(t, file, key, value);
|
||||
} else if (["CNAME", "URL"].includes(key)) {
|
||||
// A: string[]
|
||||
if (key === "A") {
|
||||
value.forEach((record) => {
|
||||
t.regex(
|
||||
record,
|
||||
ipv4Regex,
|
||||
`${file}: Record value should be a valid IPv4 address for ${key} at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
isPublicIPv4(record, data.proxied),
|
||||
`${file}: Record value should be a public IPv4 address for ${key} at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// AAAA: string[]
|
||||
if (key === "AAAA") {
|
||||
value.forEach((record) => {
|
||||
t.regex(
|
||||
expandIPv6(record),
|
||||
ipv6Regex,
|
||||
`${file}: Record value should be a valid IPv6 address for ${key} at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
isPublicIPv6(record),
|
||||
`${file}: Record value should be a public IPv6 address for ${key} at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// *: string[]
|
||||
if (["MX", "NS"].includes(key)) {
|
||||
value.forEach((record) => {
|
||||
t.regex(
|
||||
record,
|
||||
hostnameRegex,
|
||||
`${file}: Record value should be a valid hostname for ${key} at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// *: string
|
||||
if (["CNAME", "URL"].includes(key)) {
|
||||
t.true(typeof value === "string", `${file}: Record value should be a string for ${key}`);
|
||||
|
||||
if (key === "CNAME") validateHostname(t, file, key, [value]);
|
||||
if (key === "URL") validateURL(t, file, key, value);
|
||||
} else if (["CAA", "DS", "SRV"].includes(key)) {
|
||||
if (key === "CNAME") {
|
||||
t.regex(value, hostnameRegex, `${file}: Record value should be a valid hostname for ${key}`);
|
||||
}
|
||||
|
||||
if (key === "URL") {
|
||||
t.notThrows(() => new URL(value), `${file}: Record value should be a valid URL for ${key}`);
|
||||
}
|
||||
}
|
||||
|
||||
// *: {}[]
|
||||
if (["CAA", "DS", "SRV"].includes(key)) {
|
||||
t.true(Array.isArray(value), `${file}: Record value should be an array for ${key}`);
|
||||
|
||||
value.forEach((record) =>
|
||||
t.true(typeof record === "object", `${file}: Record value should be an object for ${key}`)
|
||||
);
|
||||
value.forEach((record) => {
|
||||
t.true(
|
||||
typeof record === "object",
|
||||
`${file}: Record value should be an object for ${key} at index ${value.indexOf(record)}`
|
||||
);
|
||||
});
|
||||
|
||||
validateSpecialRecords(t, file, key, value);
|
||||
} else if (key === "TXT") {
|
||||
validateTXT(t, file, key, value);
|
||||
// CAA: { flags: number, tag: string, value: string }[]
|
||||
if (key === "CAA") {
|
||||
value.forEach((record) => {
|
||||
t.true(
|
||||
typeof record.flags === "number",
|
||||
`${file}: CAA record value should have a number for flags at index ${value.indexOf(record)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.tag === "string",
|
||||
`${file}: CAA record value should have a string for tag at index ${value.indexOf(record)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.value === "string",
|
||||
`${file}: CAA record value should have a string for value at index ${value.indexOf(record)}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// DS: { key_tag: number, algorithm: number, digest_type: number, digest: string }[]
|
||||
if (key === "DS") {
|
||||
value.forEach((record) => {
|
||||
t.true(
|
||||
typeof record.key_tag === "number",
|
||||
`${file}: DS record value should have a number for key_tag at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.algorithm === "number",
|
||||
`${file}: DS record value should have a number for algorithm at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.digest_type === "number",
|
||||
`${file}: DS record value should have a number for digest_type at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.digest === "string",
|
||||
`${file}: DS record value should have a string for digest at index ${value.indexOf(record)}`
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// SRV: { priority: number, weight: number, port: number, target: string }[]
|
||||
if (key === "SRV") {
|
||||
value.forEach((record) => {
|
||||
t.true(
|
||||
typeof record.priority === "number",
|
||||
`${file}: SRV record value should have a number for priority at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.weight === "number",
|
||||
`${file}: SRV record value should have a number for weight at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.port === "number",
|
||||
`${file}: SRV record value should have a number for port at index ${value.indexOf(record)}`
|
||||
);
|
||||
|
||||
t.true(
|
||||
typeof record.target === "string",
|
||||
`${file}: SRV record value should have a string for target at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
|
||||
t.regex(
|
||||
value.target,
|
||||
hostnameRegex,
|
||||
`${file}: SRV record value should be a valid hostname for target at index ${value.indexOf(
|
||||
record
|
||||
)}`
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// TXT: string | string[]
|
||||
if (key === "TXT") {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((record) => {
|
||||
t.true(
|
||||
typeof record === "string",
|
||||
`${file}: Record value should be a string for ${key} at index ${value.indexOf(record)}`
|
||||
);
|
||||
});
|
||||
} else {
|
||||
t.true(typeof value === "string", `${file}: Record value should be a string for ${key}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
module.exports.expandIPv6 = function (ip) {
|
||||
// Split into segments by ":"
|
||||
let segments = ip.split(":");
|
||||
|
||||
// Count the number of segments that are empty due to "::" shorthand
|
||||
const emptyIndex = segments.indexOf("");
|
||||
if (emptyIndex !== -1) {
|
||||
// Calculate how many "0000" segments are missing
|
||||
const nonEmptySegments = segments.filter((seg) => seg !== "");
|
||||
const missingSegments = 8 - nonEmptySegments.length;
|
||||
|
||||
// Insert the missing "0000" segments into the position of the empty segment
|
||||
segments = [
|
||||
...nonEmptySegments.slice(0, emptyIndex),
|
||||
...Array(missingSegments).fill("0000"),
|
||||
...nonEmptySegments.slice(emptyIndex)
|
||||
];
|
||||
}
|
||||
|
||||
// Expand each segment to 4 characters, padding with leading zeros
|
||||
const expandedSegments = segments.map((segment) => segment.padStart(4, "0"));
|
||||
|
||||
// Join the segments back together
|
||||
return expandedSegments.join(":");
|
||||
};
|
||||
|
||||
module.exports.isPublicIPv4 = function (ip, proxied) {
|
||||
const parts = ip.split(".").map(Number);
|
||||
|
||||
// Validate IPv4 address format
|
||||
if (parts.length !== 4 || parts.some((part) => isNaN(part) || part < 0 || part > 255)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Exception for 192.0.2.1, assuming the domain is proxied
|
||||
if (ip === "192.0.2.1" && proxied) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for private and reserved IPv4 ranges
|
||||
return !(
|
||||
// Private ranges
|
||||
(
|
||||
parts[0] === 10 ||
|
||||
(parts[0] === 172 && parts[1] >= 16 && parts[1] <= 31) ||
|
||||
(parts[0] === 192 && parts[1] === 168) ||
|
||||
// Reserved or special-use ranges
|
||||
(parts[0] === 100 && parts[1] >= 64 && parts[1] <= 127) || // Carrier-grade NAT
|
||||
(parts[0] === 169 && parts[1] === 254) || // Link-local
|
||||
(parts[0] === 192 && parts[1] === 0 && parts[2] === 0) || // IETF Protocol Assignments
|
||||
(parts[0] === 192 && parts[1] === 0 && parts[2] === 2) || // Documentation (TEST-NET-1)
|
||||
(parts[0] === 198 && parts[1] === 18) || // Network Interconnect Devices
|
||||
(parts[0] === 198 && parts[1] === 51 && parts[2] === 100) || // Documentation (TEST-NET-2)
|
||||
(parts[0] === 203 && parts[1] === 0 && parts[2] === 113) || // Documentation (TEST-NET-3)
|
||||
parts[0] >= 224
|
||||
) // Multicast and reserved ranges
|
||||
);
|
||||
};
|
||||
|
||||
module.exports.isPublicIPv6 = function (ip) {
|
||||
const normalizedIP = ip.toLowerCase();
|
||||
|
||||
// Check for private or special-use IPv6 ranges
|
||||
return !(
|
||||
(
|
||||
normalizedIP.startsWith("fc") || // Unique Local Address (ULA)
|
||||
normalizedIP.startsWith("fd") || // Unique Local Address (ULA)
|
||||
normalizedIP.startsWith("fe80") || // Link-local
|
||||
normalizedIP.startsWith("::1") || // Loopback address (::1)
|
||||
normalizedIP.startsWith("2001:db8")
|
||||
) // Documentation range
|
||||
);
|
||||
};
|
||||
@@ -1,112 +0,0 @@
|
||||
const { expandIPv6, isPublicIPv4, isPublicIPv6 } = require("./functions");
|
||||
|
||||
const hostnameRegex = /^(?=.{1,253}$)(?:(?:[_a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)\.)+[a-zA-Z]{2,63}$/;
|
||||
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}$/;
|
||||
const ipv6Regex =
|
||||
/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$|^::(?:[0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}$|^(?:[0-9a-fA-F]{1,4}:){1,7}:$|^(?:[0-9a-fA-F]{1,4}:){0,6}::(?:[0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}$/;
|
||||
|
||||
// Check CNAME records
|
||||
function checkCNAME(t, file, recordKeys) {
|
||||
if (recordKeys.includes("CNAME")) {
|
||||
t.is(recordKeys.length, 1, `${file}: CNAME records cannot be combined with other records`);
|
||||
}
|
||||
}
|
||||
|
||||
// Check NS and DS records
|
||||
function checkNSAndDS(t, file, recordKeys) {
|
||||
if (recordKeys.includes("NS")) {
|
||||
t.true(
|
||||
recordKeys.length === 1 || (recordKeys.length === 2 && recordKeys.includes("DS")),
|
||||
`${file}: NS records cannot be combined with other records, except for DS records`
|
||||
);
|
||||
}
|
||||
|
||||
if (recordKeys.includes("DS")) {
|
||||
t.true(recordKeys.includes("NS"), `${file}: DS records must be combined with NS records`);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate IPv4 record
|
||||
function validateIPv4(t, file, key, value, data) {
|
||||
value.forEach((record) => {
|
||||
t.regex(record, ipv4Regex, `${file}: Record value should be a valid IPv4 address for ${key}`);
|
||||
t.true(isPublicIPv4(record, data.proxied), `${file}: Record value should be a public IPv4 address for ${key}`);
|
||||
});
|
||||
}
|
||||
|
||||
// Validate IPv6 record
|
||||
function validateIPv6(t, file, key, value) {
|
||||
value.forEach((record) => {
|
||||
t.regex(expandIPv6(record), ipv6Regex, `${file}: Record value should be a valid IPv6 address for ${key}`);
|
||||
t.true(isPublicIPv6(record), `${file}: Record value should be a public IPv6 address for ${key}`);
|
||||
});
|
||||
}
|
||||
|
||||
// Validate hostname record
|
||||
function validateHostname(t, file, key, value) {
|
||||
value.forEach((record) => {
|
||||
t.regex(record, hostnameRegex, `${file}: Record value should be a valid hostname for ${key}`);
|
||||
});
|
||||
}
|
||||
|
||||
// Validate URL record
|
||||
function validateURL(t, file, key, value) {
|
||||
try {
|
||||
new URL(value);
|
||||
} catch (error) {
|
||||
t.fail(`${file}: Record value should be a valid URL for ${key}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate special records (CAA, DS, SRV)
|
||||
function validateSpecialRecords(t, file, key, value) {
|
||||
if (key === "CAA") {
|
||||
value.forEach((record) => {
|
||||
t.true(typeof record.flags === "number", `${file}: CAA record value should have a number for flags`);
|
||||
t.true(typeof record.tag === "string", `${file}: CAA record value should have a string for tag`);
|
||||
t.true(typeof record.value === "string", `${file}: CAA record value should have a string for value`);
|
||||
});
|
||||
}
|
||||
if (key === "DS") {
|
||||
value.forEach((record) => {
|
||||
t.true(typeof record.key_tag === "number", `${file}: DS record value should have a number for key_tag`);
|
||||
t.true(typeof record.algorithm === "number", `${file}: DS record value should have a number for algorithm`);
|
||||
t.true(
|
||||
typeof record.digest_type === "number",
|
||||
`${file}: DS record value should have a number for digest_type`
|
||||
);
|
||||
t.true(typeof record.digest === "string", `${file}: DS record value should have a string for digest`);
|
||||
});
|
||||
}
|
||||
if (key === "SRV") {
|
||||
value.forEach((record) => {
|
||||
t.true(typeof record.priority === "number", `${file}: SRV record value should have a number for priority`);
|
||||
t.true(typeof record.weight === "number", `${file}: SRV record value should have a number for weight`);
|
||||
t.true(typeof record.port === "number", `${file}: SRV record value should have a number for port`);
|
||||
t.true(typeof record.target === "string", `${file}: SRV record value should have a string for target`);
|
||||
t.regex(record.target, hostnameRegex, `${file}: SRV record value should have a valid hostname for target`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Validate TXT record
|
||||
function validateTXT(t, file, key, value) {
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((record) =>
|
||||
t.true(typeof record === "string", `${file}: Record value should be a string for ${key}`)
|
||||
);
|
||||
} else {
|
||||
t.true(typeof value === "string", `${file}: Record value should be a string for ${key}`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
checkCNAME,
|
||||
checkNSAndDS,
|
||||
validateIPv4,
|
||||
validateIPv6,
|
||||
validateHostname,
|
||||
validateURL,
|
||||
validateSpecialRecords,
|
||||
validateTXT
|
||||
};
|
||||
Reference in New Issue
Block a user