Merge branch 'main' into patch-3

This commit is contained in:
William Harrison authored and GitHub committed 2023-09-23 11:13:33 +08:00
commit c11a7c30d4
66 files changed
+548 -53

No files matched your search

+1 -1
View File
@@ -11,6 +11,6 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v1
with: with:
bun-version: 1.0.0 bun-version: 1.0.3
- run: bun install - run: bun install
- run: bun test - run: bun test
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1 - uses: oven-sh/setup-bun@v1
with: with:
bun-version: 1.0.0 bun-version: 1.0.3
- run: bun install - run: bun install
- run: bun test - run: bun test
- name: Publishing records - name: Publishing records
BIN
View File
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "cy920820",
"email": "cuiyang673308817@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
{ {
"owner": { "owner": {
"username": "obstructed", "username": "3kh0",
"email": "scamstur@gmail.com" "email": "echo-the-coder@tuta.io"
}, },
"record": { "record": {
"A": ["217.174.245.249"], "A": ["217.174.245.249"],
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "goesbyabhi",
"email": "abxisxekpanda@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "NotJack173",
"email": "NotJack137@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "Stef-00012",
"email": "stefano.delprete.08@gmail.com",
"discord": "694986201739952229"
},
"record": {
"CNAME": "api-stefdp.onrender.com"
}
}
+4 -4
View File
@@ -1,11 +1,11 @@
{ {
"repo": "https://github.com/atharvalt/atharvalt.github.io", "repo": "https://github.com/atharvaupadhyay/atharvaupadhyay.github.io",
"owner": { "owner": {
"username": "atharvalt", "username": "atharvaupadhyay",
"email": "atharva.upadhyay1099@gmail.com", "email": "atharva.upadhyay1099@gmail.com",
"discord": "シAtharva#5374" "discord": "atharvaupadhyay"
}, },
"record": { "record": {
"CNAME": "atharvalt.github.io" "CNAME": "atharvaupadhyay.github.io"
} }
} }
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "dexjr",
"email": "dexjrdexjr@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "bampenes",
"email": "rafinhabampa@hotmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "istrueuser",
"email": "thisistrueemail@gmail.com"
},
"record": {
"A": ["35.186.245.55"]
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "boggy539",
"email": "ethanbogdan@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+3 -3
View File
@@ -1,11 +1,11 @@
{ {
"description": "Personal website",
"repo": "https://github.com/diordnas/diordnas.github.io",
"owner": { "owner": {
"username": "Diordnas", "username": "Diordnas",
"email": "cassthepurple@gmail.com" "email": "cassthepurple@gmail.com"
}, },
"record": { "record": {
"A": ["217.174.245.249"], "CNAME": "diordnas.github.io"
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
} }
} }
@@ -4,6 +4,6 @@
"email": "stefano.delprete.08@gmail.com" "email": "stefano.delprete.08@gmail.com"
}, },
"record": { "record": {
"CNAME": "nl2-4.deploy.sbs" "CNAME": "cl-gl94ec41ff.gcdn.co"
} }
} }
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "cha0ticcoder",
"email": "chaoticplayern1@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "chandrabosep",
"email": "chandrabosep3112@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "justDarian",
"email": "Darian.mohaseb@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "Filo6699",
"email": "karka2-6@rambler.ru"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "Furrycality",
"email": "furrycality@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+1 -1
View File
@@ -4,6 +4,6 @@
"email": "hcskaiask@gmail.com" "email": "hcskaiask@gmail.com"
}, },
"record": { "record": {
"A": ["5.196.239.158"] "CNAME": "hcs1219.github.io"
} }
} }
+3 -2
View File
@@ -3,8 +3,9 @@
"username": "hecterbonha", "username": "hecterbonha",
"email": "untungsoandryanto@gmail.com" "email": "untungsoandryanto@gmail.com"
}, },
"record": { "record": {
"CNAME": "hecterbonha.github.io" "A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
} }
} }
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "heyjumanji",
"email": "madhuchutiya.unhinge650@silomails.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "hkamran80",
"email": "hkamran@hkamran.com"
},
"record": {
"URL": "https://hkamran.com/?ref=isadev"
}
}
+1 -3
View File
@@ -4,8 +4,6 @@
"email": "imzihad@gmail.com" "email": "imzihad@gmail.com"
}, },
"record": { "record": {
"A": ["52.77.224.107"], "CNAME": "ec2-13-250-29-91.ap-southeast-1.compute.amazonaws.com"
"MX": ["mx1.forwardemail.net", "mx2.forwardemail.net"],
"TXT": "forward-email=imzihad@gmail.com"
} }
} }
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "jacksoncraft859",
"email": "pollardjackson@outlook.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "jacksoncraft859",
"email": "pollardjackson@outlook.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+6 -6
View File
@@ -1,11 +1,11 @@
{ {
"owner": { "owner": {
"username": "ShadowPlayzYT22", "username": "DemonGamez",
"email": "peterwyneg@gmail.com" "email": "peterwyneg@gmail.com",
"discord": "1038747272701292584"
}, },
"record": { "record": {
"A": ["217.174.245.249"], "CNAME": "DemonGamez.github.io"
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
} }
} }
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "jamesisacutedog",
"email": "jamezemailreal@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "Wizrst641",
"email": "slxppyznet18@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "jcwisniewski",
"email": "julio.wisnieski@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "ue5377",
"email": "kai.ner.h13r@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "kaizinbr",
"email": "kaiolucas1812@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+3 -5
View File
@@ -4,8 +4,6 @@
"email": "givemelognotes@gmail.com" "email": "givemelognotes@gmail.com"
}, },
"record": { "record": {
"A": ["217.174.245.249"], "URL": "https://ka0un.github.io"
"MX": ["hosts.is-a.dev"], }
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all" }
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "Kresswell",
"email": "simonecresswell@outlook.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "Lenn106",
"email": "lennongreyson@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "chiragnahata",
"email": "chiragnahata05@gmail.com"
},
"record": {
"A": ["129.213.151.29"]
}
}
+3 -1
View File
@@ -4,6 +4,8 @@
"email": "illegalhacker2.0@gmail.com" "email": "illegalhacker2.0@gmail.com"
}, },
"record": { "record": {
"CNAME": "glitch.edgeapp.net" "A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
} }
} }
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "nixxvl",
"email": "noyboyroblox@gmail.com"
},
"record": {
"CNAME": "nixxvl.space"
}
}
+6 -5
View File
@@ -1,11 +1,12 @@
{ {
"description": "Personal website",
"repo": "https://github.com/nxrmqlly/nxrmqlly.github.io",
"owner": { "owner": {
"username": "nxrmqlly", "username": "nxrmqlly",
"email": "ritam.das3110@outlook.com" "email": "ritam.das3110@outlook.com",
"twitter": ""
}, },
"record": { "record": {
"A": ["217.174.245.249"], "CNAME": "nxrmqlly.github.io"
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
} }
} }
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "4pii4",
"email": "naivenevaii@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "4pii4",
"email": "naivenevaii@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "Pranjal-SB",
"email": "psbhatnagar.in@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "xrenata",
"email": "emirhan@duck.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "atharvalt",
"email": "beast.gaming1099@gmail.com"
},
"record": {
"CNAME": "atharvaupadhyay.github.io"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "legendsayantan",
"email": "legendsayantanpaul@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "scorcism",
"email": "abhishekpathak1720@gmail.com"
},
"record": {
"URL": "https://scor32k.vercel.app/"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "scorcism",
"email": "abhishekpathak1720@gmail.com"
},
"record": {
"URL": "https://github.com/scorcism"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "skysthelimitt",
"email": "skysth3limit@pm.me"
},
"record": {
"CNAME": "selenite.pages.dev"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "sharan-218",
"email": "yenugulasharan8019@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "stepersy",
"email": "stefano.persanoadorno@liceopertini.edu.it"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "jacksoncraft859",
"email": "pollardjackson@outlook.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+10
View File
@@ -0,0 +1,10 @@
{
"owner": {
"username": "sushi-ae",
"email": "frapdotpng@gmail.com"
},
"record": {
"CNAME": "sushi-ae.neocities.org"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "chiragnahata",
"email": "chiragnahata05@gmail.com"
},
"record": {
"A": ["129.213.151.29"]
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "hirakotm",
"email": "hirakoo@proton.me"
},
"record": {
"CNAME": "hirako-is-really-cool.pages.dev"
}
}
-11
View File
@@ -1,11 +0,0 @@
{
"owner": {
"username": "totoygamingyt",
"email": "hello@totoygamingyt.com",
"twitter": "TotoyGamingYT",
"discord": "totoygamingyt"
},
"record": {
"CNAME": "totoygamingyt.pages.dev"
}
}
+9
View File
@@ -0,0 +1,9 @@
{
"owner": {
"username": "istrueuser",
"email": "thisistrueemail@gmail.com"
},
"record": {
"A": ["35.186.245.55"]
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "U8K50",
"email": "u8k50850@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "jacksoncraft859",
"email": "pollardjackson@outlook.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "RavagerEdge",
"email": "wc92226@gmail.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+11
View File
@@ -0,0 +1,11 @@
{
"owner": {
"username": "zhougonglai",
"email": "838048635@qq.com"
},
"record": {
"A": ["217.174.245.249"],
"MX": ["hosts.is-a.dev"],
"TXT": "v=spf1 a mx ip4:217.174.245.249 ~all"
}
}
+1
View File
@@ -16,6 +16,7 @@
"author": "Akshay Nair <phenax5@gmail.com>", "author": "Akshay Nair <phenax5@gmail.com>",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"ip-regex": "^5.0.0",
"ramda": "^0.27.1" "ramda": "^0.27.1"
}, },
"devDependencies": { "devDependencies": {
+8
View File
@@ -59,6 +59,11 @@ describe('validateDomainData', () => {
{ ...defaultDomain, name: 'help.baa' }, { ...defaultDomain, name: 'help.baa' },
{ ...defaultDomain, name: '_github-pages-challenge-is-a-dev' }, { ...defaultDomain, name: '_github-pages-challenge-is-a-dev' },
{ ...defaultDomain, name: '_github-challenge-is-a-dev' }, { ...defaultDomain, name: '_github-challenge-is-a-dev' },
{ ...defaultDomain, record: { AAAA: [] } },
{ ...defaultDomain, record: { AAAA: ['182.22.222.22', '::1'] } },
{ ...defaultDomain, record: { AAAA: '182.22.222.22' } },
{ ...defaultDomain, record: { A: '::1' } },
{ ...defaultDomain, name: '_discord' },
]; ];
const validCases = [ const validCases = [
@@ -86,6 +91,9 @@ describe('validateDomainData', () => {
{ ...defaultDomain, name: '_github-challenge-hello01-ga' }, { ...defaultDomain, name: '_github-challenge-hello01-ga' },
{ ...defaultDomain, name: '_github-challenge-hello01_ga' }, { ...defaultDomain, name: '_github-challenge-hello01_ga' },
{ ...defaultDomain, record: { TXT: ['foobar wow nice!!!', 'more text'] } }, { ...defaultDomain, record: { TXT: ['foobar wow nice!!!', 'more text'] } },
{ ...defaultDomain, record: { AAAA: ['::1', '2001:db8:3333:4444:5555:6666:7777:8888'] } },
{ ...defaultDomain, record: { A: ['122.222.222.222'] } },
{ ...defaultDomain, name: '_discord.subdomain' },
]; ];
it('should return false for invalid data', () => { it('should return false for invalid data', () => {
+1 -1
View File
@@ -18,7 +18,7 @@ const DOMAINS_PATH = path.resolve('domains');
module.exports = { module.exports = {
ENV, ENV,
IS_TEST, IS_TEST,
VALID_RECORD_TYPES: ['CNAME', 'A', 'URL', 'MX', 'TXT'], VALID_RECORD_TYPES: ['CNAME', 'A', 'URL', 'MX', 'TXT', 'AAAA'],
DOMAIN_DOMAIN: DOMAIN_DOMAIN || 'booboo.xyz', DOMAIN_DOMAIN: DOMAIN_DOMAIN || 'booboo.xyz',
DOMAIN_USER: IS_TEST ? 'testuser' : DOMAIN_USER, DOMAIN_USER: IS_TEST ? 'testuser' : DOMAIN_USER,
DOMAIN_API_KEY: IS_TEST ? 'testkey' : DOMAIN_API_KEY, DOMAIN_API_KEY: IS_TEST ? 'testkey' : DOMAIN_API_KEY,
+2 -1
View File
@@ -14,5 +14,6 @@
"ww3", "ww3",
"ww4", "ww4",
"wwww", "wwww",
"your-domain-name" "your-domain-name",
"_discord"
] ]
+18 -5
View File
@@ -2,6 +2,8 @@ const R = require('ramda');
const { VALID_RECORD_TYPES } = require('./constants'); const { VALID_RECORD_TYPES } = require('./constants');
const { or, and, validate, between, testRegex, withLengthEq, withLengthGte } = require('./helpers'); const { or, and, validate, between, testRegex, withLengthEq, withLengthGte } = require('./helpers');
const INVALID_NAMES = require('./invalid-domains.json'); const INVALID_NAMES = require('./invalid-domains.json');
const ipRegex_ = require('ip-regex');
const ipRegex = ipRegex_.default ?? ipRegex_;
const isValidURL = and([R.is(String), testRegex(/^https?:\/\//ig)]); const isValidURL = and([R.is(String), testRegex(/^https?:\/\//ig)]);
@@ -17,6 +19,7 @@ const validateCnameRecord = type => and([
const validateARecord = type => and([ const validateARecord = type => and([
R.propIs(Array, type), R.propIs(Array, type),
R.propSatisfies(withLengthGte(1), type), R.propSatisfies(withLengthGte(1), type),
R.all(testRegex(ipRegex.v4({ exact: true }))),
]); ]);
const validateMXRecord = type => and([ const validateMXRecord = type => and([
@@ -25,8 +28,19 @@ const validateMXRecord = type => and([
R.propSatisfies(R.all(isValidDomain), type), R.propSatisfies(R.all(isValidDomain), type),
]); ]);
const validateAAAARecord = R.propSatisfies(and([
R.is(Array),
withLengthGte(1),
R.all(testRegex(ipRegex.v6({ exact: true }))),
]))
const checkRestrictedNames = R.complement(R.includes(R.__, INVALID_NAMES)) const checkRestrictedNames = R.complement(R.includes(R.__, INVALID_NAMES))
const extraSupportedNames = [
testRegex(/^_github(-pages)?-challenge-[a-z0-9-_]+$/i), // Exception for github verification records
R.equals('_discord'),
]
const validateDomainData = validate({ const validateDomainData = validate({
name: { name: {
reason: 'The name of the file is invalid. It must be lowercased, alphanumeric and each component must be more than 2 characters long', reason: 'The name of the file is invalid. It must be lowercased, alphanumeric and each component must be more than 2 characters long',
@@ -34,17 +48,15 @@ const validateDomainData = validate({
R.equals('@'), R.equals('@'),
and([ and([
R.is(String), R.is(String),
checkRestrictedNames,
R.compose( R.compose(
R.all(or([ R.all(or([
and([
testRegex(/^_github(-pages)?-challenge-[a-z0-9-_]+$/i), // Exception for github verification records
checkRestrictedNames,
]),
and([ and([
R.compose(between(2, 100), R.length), R.compose(between(2, 100), R.length),
testRegex(/^[a-z0-9-]+$/g), testRegex(/^[a-z0-9-]+$/g),
checkRestrictedNames, checkRestrictedNames,
]) ]),
...extraSupportedNames,
])), ])),
R.split('.'), R.split('.'),
), ),
@@ -75,6 +87,7 @@ const validateDomainData = validate({
[R.has('URL'), R.propSatisfies(isValidURL, 'URL')], [R.has('URL'), R.propSatisfies(isValidURL, 'URL')],
[R.has('MX'), validateMXRecord('MX')], [R.has('MX'), validateMXRecord('MX')],
[R.has('TXT'), R.propSatisfies(or([ R.is(String), R.is(Array) ]), 'TXT')], [R.has('TXT'), R.propSatisfies(or([ R.is(String), R.is(Array) ]), 'TXT')],
[R.has('AAAA'), validateAAAARecord('AAAA')],
[R.T, R.T], [R.T, R.T],
]), ]),
]), ]),