diff --git a/.github/workflows/bot.yml b/.github/workflows/bot.yml deleted file mode 100644 index 4c68ceaa2..000000000 --- a/.github/workflows/bot.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Helper - -on: - pull_request: - types: - - closed - -jobs: - instructions: - name: instructions - runs-on: ubuntu-latest - steps: - - run: curl https://notify-api.is-a.dev/pr/merged/${{ github.event.pull_request.number }} - if: github.event.action == 'closed' && github.event.pull_request.merged == true -# - uses: actions/checkout@v2 -# - name: Comment -# if: github.event.action == 'closed' && github.event.pull_request.merged == true -# uses: actions/github-script@v3 -# with: -# github-token: ${{secrets.GITHUB_TOKEN}} -# script: | -# const { hasLabel } = require(`${process.env.GITHUB_WORKSPACE}/scripts/action-utils.js`); -# const { instructions } = require(`${process.env.GITHUB_WORKSPACE}/scripts/reply.js`); -# if (hasLabel(context, 'domain')) -# console.log('Domain'); -# await instructions(context, github); diff --git a/domains/_discord.jirafey.json b/domains/_discord.jirafey.json new file mode 100644 index 000000000..363a429d5 --- /dev/null +++ b/domains/_discord.jirafey.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "jirafey", + "email": "jirafey@tuta.io" + }, + "record": { + "TXT": "dh=3c80d94ed181b223255b5fbf35f8fda6a402058f" + } +} diff --git a/domains/notify-api.json b/domains/_github-challenge-is-a-dev-org.json similarity index 73% rename from domains/notify-api.json rename to domains/_github-challenge-is-a-dev-org.json index ef2dd2748..db1e677a9 100644 --- a/domains/notify-api.json +++ b/domains/_github-challenge-is-a-dev-org.json @@ -5,6 +5,6 @@ }, "record": { - "CNAME": "dns.beadman-network.com" + "TXT": "2c9dfbe7c8" } } diff --git a/domains/_github-pages-challenge-is-a-dev.team.json b/domains/_github-pages-challenge-is-a-dev.team.json new file mode 100644 index 000000000..d7e139dbd --- /dev/null +++ b/domains/_github-pages-challenge-is-a-dev.team.json @@ -0,0 +1,10 @@ +{ + "owner": { + "username": "is-a-dev", + "email": "phenax5@gmail.com" + }, + + "record": { + "TXT": "c551c059fb167540ec0498d9011556" + } +} diff --git a/domains/a-j.json b/domains/a-j.json new file mode 100644 index 000000000..17469e2f2 --- /dev/null +++ b/domains/a-j.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "alijafari-gd", + "email": "ali.jafari.sn@gmail.com" + }, + "record": { + "URL": "https://alijafari.is-a.dev" + } +} diff --git a/domains/aayank.json b/domains/aayank.json new file mode 100644 index 000000000..269b5017e --- /dev/null +++ b/domains/aayank.json @@ -0,0 +1,14 @@ +{ + "owner": { + "username": "aayank13", + "email": "aayank1306@gmail.com" + }, + "record": { + "A": [ + "217.174.245.249", + "51.161.54.161" + ], + "MX": ["mail.is-a.dev"], + "TXT": "v=spf1 mx a:mail.is-a.dev ~all" + } +} \ No newline at end of file diff --git a/domains/aivietnamllm.json b/domains/aivietnamllm.json new file mode 100644 index 000000000..100cd8b28 --- /dev/null +++ b/domains/aivietnamllm.json @@ -0,0 +1,14 @@ +{ + "owner": { + "username": "BachNgoH", + "email": "nlmbao2015@gmail.com" + }, + "record": { + "A": [ + "217.174.245.249", + "51.161.54.161" + ], + "MX": ["mail.is-a.dev"], + "TXT": "v=spf1 mx a:mail.is-a.dev ~all" + } +} \ No newline at end of file diff --git a/domains/alijafari.json b/domains/alijafari.json new file mode 100644 index 000000000..e638a8338 --- /dev/null +++ b/domains/alijafari.json @@ -0,0 +1,14 @@ +{ + "owner": { + "username": "alijafari-gd", + "email": "ali.jafari.sn@gmail.com" + }, + "record": { + "A": [ + "217.174.245.249", + "51.161.54.161" + ], + "MX": ["mail.is-a.dev"], + "TXT": "v=spf1 mx a:mail.is-a.dev ~all" + } +} \ No newline at end of file diff --git a/domains/anubhav.json b/domains/anubhav.json new file mode 100644 index 000000000..db76a0aed --- /dev/null +++ b/domains/anubhav.json @@ -0,0 +1,14 @@ +{ + "owner": { + "username": "Anubhav-Pathak", + "email": "anubhavpathak99@gmail.com" + }, + "record": { + "A": [ + "217.174.245.249", + "51.161.54.161" + ], + "MX": ["mail.is-a.dev"], + "TXT": "v=spf1 mx a:mail.is-a.dev ~all" + } +} \ No newline at end of file diff --git a/domains/blek.json b/domains/blek.json new file mode 100644 index 000000000..df17670cf --- /dev/null +++ b/domains/blek.json @@ -0,0 +1,11 @@ +{ + "description": "blek is a dev", + "owner": { + "username": "b1ek", + "email": "me@blek.codes" + }, + "record": { + "A": [ "185.130.226.115" ], + "AAAA": [ "2a05:b40:0:570:4563:92af:9a56:7fc8" ] + } +} diff --git a/domains/bot.dracx.json b/domains/bot.dracx.json new file mode 100644 index 000000000..68f770565 --- /dev/null +++ b/domains/bot.dracx.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "DarindaDraX", + "email": "123kishanvish@gmail.com" + }, + "record": { + "A": ["69.30.249.53"] + } +} diff --git a/domains/dinuhifi.json b/domains/dinuhifi.json new file mode 100644 index 000000000..3ad0f1f57 --- /dev/null +++ b/domains/dinuhifi.json @@ -0,0 +1,14 @@ +{ + "owner": { + "username": "dinuhifi", + "email": "dinesh23110077@snuchennai.edu.in" + }, + "record": { + "A": [ + "217.174.245.249", + "51.161.54.161" + ], + "MX": ["mail.is-a.dev"], + "TXT": "v=spf1 mx a:mail.is-a.dev ~all" + } +} \ No newline at end of file diff --git a/domains/hackpig520.json b/domains/hackpig520.json new file mode 100644 index 000000000..8f3286541 --- /dev/null +++ b/domains/hackpig520.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "xiaozhu2007", + "email": "lz19986912007@163.com" + }, + "record": { + "CNAME": "hashnode.network" + } +} diff --git a/domains/lavalink.trung.json b/domains/lavalink.trung.json new file mode 100644 index 000000000..c372c8070 --- /dev/null +++ b/domains/lavalink.trung.json @@ -0,0 +1,9 @@ +{ + "owner": { + "username": "vuthanhtrung2010", + "email": "vuthanhtrungsuper@gmail.com" + }, + "record": { + "A": ["69.30.249.53"] + } +} diff --git a/domains/nik.json b/domains/nik.json index 36ee7b613..fae6c2cf1 100644 --- a/domains/nik.json +++ b/domains/nik.json @@ -1,6 +1,6 @@ { "owner": { - "username": "Nikhil", + "username": "nikxso", "email": "nikhilsoniya123@gmail.com", "discord": "nikxso#0000" }, diff --git a/domains/saptarshi.json b/domains/saptarshi.json new file mode 100644 index 000000000..8bdad1157 --- /dev/null +++ b/domains/saptarshi.json @@ -0,0 +1,12 @@ +{ + "owner": { + "username": "saptarshihalder", + "email": "saptarshihalder69@gmail.com", + "discord": "747718545307336797" + }, + + "record": { + "CNAME": "saptarshihalder.github.io" + } + } + diff --git a/domains/siddhant.json b/domains/siddhant.json index 8f704162e..e4890fd6c 100644 --- a/domains/siddhant.json +++ b/domains/siddhant.json @@ -6,6 +6,6 @@ "email": "pandeysiddhant21@gmail.com" }, "record": { - "URL": "https://siddhantt.netlify.app" + "URL": "https://siddhantt.vercel.app/" } } diff --git a/domains/uptime.trung.json b/domains/uptime.trung.json index c372c8070..d2832a9c2 100644 --- a/domains/uptime.trung.json +++ b/domains/uptime.trung.json @@ -4,6 +4,6 @@ "email": "vuthanhtrungsuper@gmail.com" }, "record": { - "A": ["69.30.249.53"] + "CNAME": "manage.uptime.trung.is-a.dev" } } diff --git a/domains/wm.json b/domains/wm.json new file mode 100644 index 000000000..7c1c9f373 --- /dev/null +++ b/domains/wm.json @@ -0,0 +1,14 @@ +{ + "owner": { + "username": "cmdwm", + "email": "will@willm.xyz" + }, + "record": { + "A": [ + "217.174.245.249", + "51.161.54.161" + ], + "MX": ["mail.is-a.dev"], + "TXT": "v=spf1 mx a:mail.is-a.dev ~all" + } +} \ No newline at end of file diff --git a/domains/zeazolf.json b/domains/zeazolf.json new file mode 100644 index 000000000..2397e8492 --- /dev/null +++ b/domains/zeazolf.json @@ -0,0 +1,14 @@ +{ + "owner": { + "username": "ZeaZolf", + "email": "ZeaZolfPc@gmail.com" + }, + "record": { + "A": [ + "217.174.245.249", + "51.161.54.161" + ], + "MX": ["mail.is-a.dev"], + "TXT": "v=spf1 mx a:mail.is-a.dev ~all" + } +} \ No newline at end of file diff --git a/scripts/register-domains.js b/scripts/register-domains.js index 55e201a57..20670f8af 100644 --- a/scripts/register-domains.js +++ b/scripts/register-domains.js @@ -15,7 +15,7 @@ const toHostList = R.chain(data => { // URL redirection must contain explicit A record // Wildcard A record breaks when used with MX // Ref: https://github.com/is-a-dev/register/issues/2365 - if (data.record.URL && data.record.MX || data.name === '@') { + if ((data.record.URL && data.record.MX) || data.name === '@') { data.record.A = [ DOMAIN_HOST_IP ] } diff --git a/tests/cpanel.test.js b/tests/cpanel.test.js index d2fbd35a3..162a9a5d3 100644 --- a/tests/cpanel.test.js +++ b/tests/cpanel.test.js @@ -12,7 +12,7 @@ describe('Cpanel client', () => { describe('fetchzonerecords', () => { it('should make the correct request', async () => { const fetch = mockFetch((url, request) => { - expect(url).toBe('https://example.com:2000/json-api/cpanel?customonly=1&domain=a.b&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); + expect(url).toBe('https://example.com:2000/json-api/cpanel?customonly=0&domain=a.b&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); expect(request).toEqual({ headers: { Authorization: 'cpanel boy:boybyebye', @@ -35,7 +35,7 @@ describe('Cpanel client', () => { it('should make the correct request with query', async () => { const fetch = mockFetch((url, request) => { - expect(url).toBe('https://example.com:2000/json-api/cpanel?customonly=1&domain=foobar.boeey&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); + expect(url).toBe('https://example.com:2000/json-api/cpanel?customonly=0&domain=foobar.boeey&cpanel_jsonapi_user=boy&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&cpanel_jsonapi_apiversion=2'); expect(request).toEqual({ headers: { Authorization: 'cpanel boy:boybyebye', diff --git a/utils/domain-service.js b/utils/domain-service.js index 5cbafaa2a..fe75aef04 100644 --- a/utils/domain-service.js +++ b/utils/domain-service.js @@ -59,6 +59,9 @@ const recordToEmailMx = ({ name, address, priority }) => ({ const getHostKey = host => `${host.name.toLowerCase()}##${host.type.toLowerCase()}##${host.address.toLowerCase()}`; +const isReserved = (domain) => + domain.name.startsWith('*') || !VALID_RECORD_TYPES.includes(domain.type) + const diffRecords = (oldRecords, newRecords) => { const isMatchingRecord = (a, b) => getHostKey(a) === getHostKey(b); @@ -84,13 +87,9 @@ const executeBatch = (batches) => batches.reduce((promise, batch, index) => { }); }, Promise.resolve()); -const isReserved = (domain) => - domain.name.startsWith('*') || - !VALID_RECORD_TYPES.includes(domain.type) - const getDomainService = ({ cpanel }) => { const fetchZoneRecords = R.compose( - then(R.filter(R.complement(isReserved))), + then(R.reject(isReserved)), then(R.map(zoneToRecord)), cpanel.zone.fetch ); @@ -134,7 +133,6 @@ const getDomainService = ({ cpanel }) => { batchLazyTasks(BATCH_SIZE), R.filter(Boolean), R.map(R.cond([ - [R.propEq('name', 'www'), R.always(null)], // Ignore www [R.propEq('type', 'URL'), addRedirection], [R.T, addZoneRecord], ])),