diff --git a/src/dns-lookup/blocklists.ts b/src/dns-lookup/blocklists.ts deleted file mode 100644 index 17a1c7cf..00000000 --- a/src/dns-lookup/blocklists.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2019 DigitalOcean - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -import { ipBlocklists, domainBlocklists } from "./data/blocklists" -import cfDNS from "../shared/utils/cfDNS" - -// Reverses the IP address for DNSBL lookups. -const reverseIp = (ip: string) => ip.split(".").reverse().join(".") - -// Get the result of a blocklist check -const checkBlocklist = async (name: string, blocklist: string, type: string) => { - const res = await cfDNS(`${name}.${blocklist}`, "A") - if (!res.ok) return - if ((await res.json()).Answer) { - const resp = {} as any - resp[type] = blocklist - return resp - } -} - -const checkIpBlocklists = (ip: string) => { - const promises = [] - for (const blocklist of ipBlocklists) { - promises.push(checkBlocklist(reverseIp(ip), blocklist, "ip")) - } - return promises -} - -const checkDomainBlocklists = (domain: string) => { - const promises = [] - for (const blocklist of domainBlocklists) { - promises.push(checkBlocklist(domain, blocklist, "domain")) - } - return promises -} - -// Gets any blocklists that the IP/domain is in. -const getBlocklists = async (ip: string, domain: string) => { - const blocklists = { - ip: [], - domain: [], - } as any - - const promises = [...checkIpBlocklists(ip)] - if (domain) promises.push(...checkDomainBlocklists(domain)) - - const data = await Promise.all(promises) - data.forEach(item => { - if (!item) return - if (item.ip) blocklists.domain.push(item.ip) - if (item.domain) blocklists.domain.push(item.domain) - }) - - return blocklists -} - -export default getBlocklists diff --git a/src/dns-lookup/data/blocklists.ts b/src/dns-lookup/data/blocklists.ts deleted file mode 100644 index 52d5bcd5..00000000 --- a/src/dns-lookup/data/blocklists.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2019 DigitalOcean - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -export const ipBlocklists = [ - "zen.spamhaus.org", - "sbl.spamhaus.org", - "xbl.spamhaus.org", - "dnsbl.spfbl.net", - "spam.spamrats.com", -] - -export const domainBlocklists = [ - "dbl.spamhaus.org", - "0spam.org", - "dbl.suomispam.net", -] diff --git a/src/dns-lookup/i18n/en/templates/index.ts b/src/dns-lookup/i18n/en/templates/index.ts index 81a0e144..a3d88e76 100644 --- a/src/dns-lookup/i18n/en/templates/index.ts +++ b/src/dns-lookup/i18n/en/templates/index.ts @@ -1,6 +1,5 @@ import app from "./app" import dodns from "./dodns" -import mxBlocklist from "./mx_blocklist" import records from "./records" import truncatedRecord from "./truncated_record" import whois from "./whois" @@ -11,7 +10,7 @@ import clipboardModal from "./clipboard_modal" import dmarcExplainer from "./dmarc_explainer" export default { - app, dodns, mxBlocklist, records, truncatedRecord, + app, dodns, records, truncatedRecord, whois, propagationModal, recordSelectionModal, dnsDiff, clipboardModal, dmarcExplainer, } as {[key: string]: {[key: string]: any}} diff --git a/src/dns-lookup/i18n/en/templates/mx_blocklist.ts b/src/dns-lookup/i18n/en/templates/mx_blocklist.ts deleted file mode 100644 index 46f9cd50..00000000 --- a/src/dns-lookup/i18n/en/templates/mx_blocklist.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default { - notBlocked: "Domain/IP is not blocked by any blocklists.", - whatDoesItMean: "What does a mailing blocklist mean?", - ipBlocked: "IP blocked by BLOCKLIST.", - domainBlocked: "Domain blocked by BLOCKLIST.", -} as {[key: string]: string} diff --git a/src/dns-lookup/templates/mx_blocklist.vue b/src/dns-lookup/templates/mx_blocklist.vue deleted file mode 100644 index ad243d14..00000000 --- a/src/dns-lookup/templates/mx_blocklist.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/src/dns-lookup/templates/record.vue b/src/dns-lookup/templates/record.vue index 5ce7d203..189f287c 100644 --- a/src/dns-lookup/templates/record.vue +++ b/src/dns-lookup/templates/record.vue @@ -1,5 +1,5 @@