diff --git a/docs/domains-json.md b/docs/domains-json.md index e502fb144..054f0c2a2 100644 --- a/docs/domains-json.md +++ b/docs/domains-json.md @@ -4,6 +4,9 @@ To register `my-domain.is-a.dev`, you need to create a `domains/my-domain.json` ### Filename The file name must pass the following criteria - + +> NOTE: You can use `.` (dots) in your file name (for registering `blog.mysubdomain.is-a.dev`) but each of the following criteria must be valid for all part of your subdomain + * Must be alpha-numeric in lowercase with dashes as seperators * Must be more than 2 characters long * Must have a `.json` file extension @@ -25,7 +28,7 @@ In the owner object, the fields `username` and `email` are required. You can how } ``` -If you don't wish to share your email address here, please share your twitter or any other social media account. +If you don't wish to share your email address here, please share your twitter, discord or any other social media account. ```json { "owner": { diff --git a/domains/algebraic-effects.akshay.json b/domains/algebraic-effects.akshay.json new file mode 100644 index 000000000..563a84c7b --- /dev/null +++ b/domains/algebraic-effects.akshay.json @@ -0,0 +1,11 @@ +{ + "description": "Docs for algebraic effects library", + "repo": "https://github.com/phenax/algebraic-effects", + "owner": { + "username": "phenax", + "email": "phenax5@gmail.com" + }, + "record": { + "CNAME": "phenax.github.io" + } +} diff --git a/domains/badboy.json b/domains/badboy.json index c9435dfe2..6bd526298 100644 --- a/domains/badboy.json +++ b/domains/badboy.json @@ -2,7 +2,7 @@ "description": "Bad Boy's Website", "repo": "https://github.com/Bad-Boy-Codes/bad-boy-codes.github.io", "owner": { - "username": "badboy", + "username": "bad-boy-codes", "email": "badboyplays9999@gmail.com" }, "record": { diff --git a/domains/catzboy.json b/domains/catzboy.json new file mode 100644 index 000000000..260b616ad --- /dev/null +++ b/domains/catzboy.json @@ -0,0 +1,11 @@ +{ + "description": "Catzboy Profilo", + "repo": "https://github.com/Maruful007/Maruful007", + "owner": { + "username": "Maruful007", + "email": "marufulislamsami2007@gmail.com" + }, + "record": { + "CNAME": "maruful007.github.io" + } +} diff --git a/domains/censor.json b/domains/censor.json new file mode 100644 index 000000000..5fa90ee8e --- /dev/null +++ b/domains/censor.json @@ -0,0 +1,13 @@ +{ + "description": "My personal Website", + "repo": "https://github.com/cens6r/cens6r.github.io", + "owner": { + "username": "censor", + "email": "cens6r.dev@gmail.com", + "discord": "cens6r#0001", + "note": "It is faster to contact me on Discord." + }, + "record": { + "CNAME": "cens6r.github.io" + } +} diff --git a/domains/korauo.json b/domains/korauo.json new file mode 100644 index 000000000..90b615987 --- /dev/null +++ b/domains/korauo.json @@ -0,0 +1,11 @@ +{ + "owner": { + "username": "korauo", + "email": "korauo69@gmail.com", + "twitter": "korauo", + "discord": "korauo#1423" + }, + "record": { + "CNAME": "korauo.github.io" + } +} diff --git a/domains/kyuzu.json b/domains/kyuzu.json index f5276be41..471598040 100644 --- a/domains/kyuzu.json +++ b/domains/kyuzu.json @@ -1,13 +1,13 @@ { - "description": "Personal portfolio built with ReactJS", - "repo": "https://github.com/kyuzu/", - "owner": { - "username": "kyuzu", - "discord": "Kyuzu#9214", - "twitter": "kyuzudev", - "email": "" - }, - "record": { - "CNAME": "8ec71685ba9c73e0eaeabaa5.cname.deno.dev" - } + "description": "Personal portfolio built with ReactJS", + "repo": "https://github.com/kyuzu/portfolio", + "owner": { + "username": "kyuzu", + "discord": "Kyuzu#9214", + "twitter": "kyuzudev", + "email": "" + }, + "record": { + "CNAME": "280985daeff00a3fed6006ff.cname.deno.dev" + } } diff --git a/domains/lazyllama.json b/domains/lazyllama.json index 9db79af66..9ef0c5496 100644 --- a/domains/lazyllama.json +++ b/domains/lazyllama.json @@ -1,9 +1,9 @@ { "owner": { - "username": "hapyllama", + "username": "lazylllama", "email": "kws102522@gmail.com" }, "record": { - "CNAME": "hapyllama.github.io" + "CNAME": "lazylllama.github.io" } } diff --git a/domains/sea-shell.jj.json b/domains/sea-shell.jj.json new file mode 100644 index 000000000..c2cf1087e --- /dev/null +++ b/domains/sea-shell.jj.json @@ -0,0 +1,11 @@ +{ + "description": "website for the Sea Shell project", + "repo": "https://github.com/Sea-Shell/site", + "owner": { + "username": "TheBotlyNoob", + "email": "jj@jj.is-a.dev" + }, + "record": { + "A": ["35.230.85.45"] + } +} diff --git a/domains/suzumi.badboy.json b/domains/suzumi.badboy.json new file mode 100644 index 000000000..8c517b5d1 --- /dev/null +++ b/domains/suzumi.badboy.json @@ -0,0 +1,11 @@ +{ + "description": "Suzumi's Dashboard", + "repo": "https://github.com/Bad-Boy-Codes/bad-boy-codes.github.io", + "owner": { + "username": "bad-boy-codes", + "email": "badboyplays9999@gmail.com" + }, + "record": { + "CNAME": "suzumi.up.railway.app" + } +} diff --git a/domains/terminal.sea-shells.jj.json b/domains/terminal.sea-shells.jj.json new file mode 100644 index 000000000..a073f043d --- /dev/null +++ b/domains/terminal.sea-shells.jj.json @@ -0,0 +1,11 @@ +{ + "description": "online terminal for the Sea Shell project", + "repo": "https://github.com/Sea-Shell/online-terminal", + "owner": { + "username": "TheBotlyNoob", + "email": "jj@jj.is-a.dev" + }, + "record": { + "A": ["35.230.85.45"] + } +} diff --git a/tests/validations.test.js b/tests/validations.test.js index d4c6806e0..cc4b7bc02 100644 --- a/tests/validations.test.js +++ b/tests/validations.test.js @@ -55,6 +55,9 @@ describe('validateDomainData', () => { { ...defaultDomain, record: { CNAME: 'foobar.com', MX: ['ALT4.ASPMX.L.GOOGLE.COM'] } }, ...INVALID_NAMES.map(name => ({ ...defaultDomain, name })).slice(0, 1), { ...defaultDomain, record: { TXT: ['foobar wow nice!!!'] } }, + { ...defaultDomain, name: 'a.b' }, + { ...defaultDomain, name: 'ww2.baa' }, + { ...defaultDomain, name: 'help.baa' }, ]; const validCases = [ @@ -73,6 +76,8 @@ describe('validateDomainData', () => { { ...defaultDomain, record: { MX: ['ALT4.ASPMX.L.GOOGLE.COM'] } }, { ...defaultDomain, record: { TXT: 'foobar wow nice!!!' } }, { ...defaultDomain, record: { A: ['1.1.1.1'], MX: ['mx1.example.com'] } }, + { ...defaultDomain, name: 'gogo.foo.bar' }, + { ...defaultDomain, name: 'ww9.baa' }, ]; it('should return false for invalid data', () => { diff --git a/utils/invalid-domains.json b/utils/invalid-domains.json index 4c49294be..45599ab2e 100644 --- a/utils/invalid-domains.json +++ b/utils/invalid-domains.json @@ -5,6 +5,7 @@ "noreply", "notifications", "notification", + "_acme-challenge", "ww1", "ww2", "ww3", diff --git a/utils/validations.js b/utils/validations.js index 67a8d3df5..057aa4173 100644 --- a/utils/validations.js +++ b/utils/validations.js @@ -5,7 +5,7 @@ const INVALID_NAMES = require('./invalid-domains.json'); const isValidURL = and([R.is(String), testRegex(/^https?:\/\//ig)]); -const isValidDomain = and([R.is(String), testRegex(/^(([a-z0-9\-]+)\.)+[a-z]+$/ig)]); +const isValidDomain = and([R.is(String), testRegex(/^(([a-z0-9-]+)\.)+[a-z]+$/ig)]); const validateCnameRecord = type => and([ R.propIs(String, type), @@ -27,13 +27,19 @@ const validateMXRecord = type => and([ const validateDomainData = validate({ name: { - reason: 'The name of the file is invalid. It must be lowercased, alphanumeric and 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', fn: or([ R.equals('@'), and([ - R.compose(between(2, 100), R.length), - testRegex(/^[a-z0-9-]+$/g), - R.complement(R.includes(R.__, INVALID_NAMES)), + R.is(String), + R.compose( + R.all(and([ + R.compose(between(2, 100), R.length), + testRegex(/^[a-z0-9-]+$/g), + R.complement(R.includes(R.__, INVALID_NAMES)), + ])), + R.split('.'), + ), ]) ]), },