mirror of
https://github.com/Lissy93/web-check.git
synced 2025-06-20 11:47:42 +02:00
Adds checking for Blocklists
This commit is contained in:
parent
6b8c50a9aa
commit
519d2f0f79
@ -99,7 +99,7 @@ exports.handler = middleware(async (url) => {
|
|||||||
const results = await checkDomainAgainstDnsServers(domain);
|
const results = await checkDomainAgainstDnsServers(domain);
|
||||||
return {
|
return {
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
body: JSON.stringify(results)
|
body: JSON.stringify({ blocklists: results })
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
19
src/components/Results/BlockLists.tsx
Normal file
19
src/components/Results/BlockLists.tsx
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
import { Card } from 'components/Form/Card';
|
||||||
|
import Row from 'components/Form/Row';
|
||||||
|
|
||||||
|
const BlockListsCard = (props: {data: any, title: string, actionButtons: any }): JSX.Element => {
|
||||||
|
const blockLists = props.data.blocklists;
|
||||||
|
return (
|
||||||
|
<Card heading={props.title} actionButtons={props.actionButtons}>
|
||||||
|
{ blockLists.map((blocklist: any) => (
|
||||||
|
<Row
|
||||||
|
title={blocklist.serverIp}
|
||||||
|
lbl={blocklist.server}
|
||||||
|
val={blocklist.isBlocked ? '❌ Blocked' : '✅ Not Blocked'} />
|
||||||
|
))}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BlockListsCard;
|
@ -217,6 +217,7 @@ const jobNames = [
|
|||||||
'http-security',
|
'http-security',
|
||||||
'rank',
|
'rank',
|
||||||
'archives',
|
'archives',
|
||||||
|
'block-lists',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const initialJobs = jobNames.map((job: string) => {
|
export const initialJobs = jobNames.map((job: string) => {
|
||||||
|
@ -52,6 +52,7 @@ import HttpSecurityCard from 'components/Results/HttpSecurity';
|
|||||||
import FirewallCard from 'components/Results/Firewall';
|
import FirewallCard from 'components/Results/Firewall';
|
||||||
import ArchivesCard from 'components/Results/Archives';
|
import ArchivesCard from 'components/Results/Archives';
|
||||||
import RankCard from 'components/Results/Rank';
|
import RankCard from 'components/Results/Rank';
|
||||||
|
import BlockListsCard from 'components/Results/BlockLists';
|
||||||
|
|
||||||
import keys from 'utils/get-keys';
|
import keys from 'utils/get-keys';
|
||||||
import { determineAddressType, AddressType } from 'utils/address-type-checker';
|
import { determineAddressType, AddressType } from 'utils/address-type-checker';
|
||||||
@ -439,6 +440,14 @@ const Results = (): JSX.Element => {
|
|||||||
fetchRequest: () => fetch(`${api}/rank?url=${address}`).then(res => parseJson(res)),
|
fetchRequest: () => fetch(`${api}/rank?url=${address}`).then(res => parseJson(res)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Check site against DNS blocklists
|
||||||
|
const [blockListsResults, updateBlockListsResults] = useMotherHook({
|
||||||
|
jobId: 'block-lists',
|
||||||
|
updateLoadingJobs,
|
||||||
|
addressInfo: { address, addressType, expectedAddressTypes: urlTypeOnly },
|
||||||
|
fetchRequest: () => fetch(`${api}/block-lists?url=${address}`).then(res => parseJson(res)),
|
||||||
|
});
|
||||||
|
|
||||||
/* Cancel remaining jobs after 10 second timeout */
|
/* Cancel remaining jobs after 10 second timeout */
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const checkJobs = () => {
|
const checkJobs = () => {
|
||||||
@ -493,6 +502,7 @@ const Results = (): JSX.Element => {
|
|||||||
{ id: 'dns-server', title: 'DNS Server', result: dnsServerResults, Component: DnsServerCard, refresh: updateDnsServerResults },
|
{ id: 'dns-server', title: 'DNS Server', result: dnsServerResults, Component: DnsServerCard, refresh: updateDnsServerResults },
|
||||||
{ id: 'linked-pages', title: 'Linked Pages', result: linkedPagesResults, Component: ContentLinksCard, refresh: updateLinkedPagesResults },
|
{ id: 'linked-pages', title: 'Linked Pages', result: linkedPagesResults, Component: ContentLinksCard, refresh: updateLinkedPagesResults },
|
||||||
{ id: 'txt-records', title: 'TXT Records', result: txtRecordResults, Component: TxtRecordCard, refresh: updateTxtRecordResults },
|
{ id: 'txt-records', title: 'TXT Records', result: txtRecordResults, Component: TxtRecordCard, refresh: updateTxtRecordResults },
|
||||||
|
{ id: 'block-lists', title: 'Block Lists', result: blockListsResults, Component: BlockListsCard, refresh: updateBlockListsResults },
|
||||||
{ id: 'features', title: 'Site Features', result: siteFeaturesResults, Component: SiteFeaturesCard, refresh: updateSiteFeaturesResults },
|
{ id: 'features', title: 'Site Features', result: siteFeaturesResults, Component: SiteFeaturesCard, refresh: updateSiteFeaturesResults },
|
||||||
{ id: 'sitemap', title: 'Pages', result: sitemapResults, Component: SitemapCard, refresh: updateSitemapResults },
|
{ id: 'sitemap', title: 'Pages', result: sitemapResults, Component: SitemapCard, refresh: updateSitemapResults },
|
||||||
{ id: 'carbon', title: 'Carbon Footprint', result: carbonResults, Component: CarbonFootprintCard, refresh: updateCarbonResults },
|
{ id: 'carbon', title: 'Carbon Footprint', result: carbonResults, Component: CarbonFootprintCard, refresh: updateCarbonResults },
|
||||||
|
@ -462,6 +462,14 @@ const docs: Doc[] = [
|
|||||||
],
|
],
|
||||||
screenshot: 'https://i.ibb.co/nkbczgb/Screenshot-from-2023-08-14-22-02-40.png',
|
screenshot: 'https://i.ibb.co/nkbczgb/Screenshot-from-2023-08-14-22-02-40.png',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'block-lists',
|
||||||
|
title: 'Block Detection',
|
||||||
|
description: 'Checks access to the URL using 10+ of the most popular privacy, malware and parental control blocking DNS servers.',
|
||||||
|
use: '',
|
||||||
|
resources: [],
|
||||||
|
screenshot: '',
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// id: '',
|
// id: '',
|
||||||
// title: '',
|
// title: '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user