From d7a4700f96d691e9ffb3816ea5f7b4a52e304341 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 20 May 2021 21:34:08 +0530 Subject: [PATCH] adds psl validation TXT record --- default.nix | 2 +- domains/_psl.json | 11 +++++++++++ scripts/register-domains.js | 3 ++- tests/domains.test.js | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 domains/_psl.json diff --git a/default.nix b/default.nix index 1eec77277..3f84d1e03 100644 --- a/default.nix +++ b/default.nix @@ -6,7 +6,7 @@ let nodejs-15_x yarn docker-compose - #dnsutils + dnsutils #certbot ]; in diff --git a/domains/_psl.json b/domains/_psl.json new file mode 100644 index 000000000..6647add63 --- /dev/null +++ b/domains/_psl.json @@ -0,0 +1,11 @@ +{ + "description": "PSL validation record for is-a.dev", + "repo": "https://github.com/is-a-dev/is-a-dev.github.io", + "owner": { + "username": "phenax", + "email": "phenax5@gmail.com" + }, + "record": { + "TXT": "https://github.com/publicsuffix/list/pull/1327" + } +} diff --git a/scripts/register-domains.js b/scripts/register-domains.js index 69435063c..1cefbda7f 100644 --- a/scripts/register-domains.js +++ b/scripts/register-domains.js @@ -3,7 +3,8 @@ const { VALID_RECORD_TYPES, TTL, ENV } = require('../utils/constants'); const { domainService: dc } = require('../utils/domain-service'); const { getDomains: gd } = require('../utils/get-domain'); -const getRecords = R.compose(R.toPairs, R.pick(VALID_RECORD_TYPES)); +// Allow TXT records while publishing (for pcl validation) +const getRecords = R.compose(R.toPairs, R.pick(VALID_RECORD_TYPES.concat(['TXT']))); const toHostList = R.chain(data => { const rs = getRecords(data.record); diff --git a/tests/domains.test.js b/tests/domains.test.js index 6c58d7037..44c2a5422 100644 --- a/tests/domains.test.js +++ b/tests/domains.test.js @@ -12,6 +12,7 @@ describe('Domains', () => { it('should be valid', (done) => { getDomains() + .then(R.reject(R.propEq('name', '_psl'))) .then(R.map(data => { const { errors } = validateDomainData(data); if (errors.length) {