Full Toolkit for Next-Level Domain Analysis
Improve explainer alerts π©βπ«
Felix Wotschofskydf8d3142bfb2
diff --git a/app/lookup/[domain]/map/_components/base-alert.tsx b/app/lookup/[domain]/_components/icon-alert.tsxsimilarity index 67%rename from app/lookup/[domain]/map/_components/base-alert.tsxrename to app/lookup/[domain]/_components/icon-alert.tsxindex b4ad0ed..7df34b9 100644--- a/app/lookup/[domain]/map/_components/base-alert.tsx+++ b/app/lookup/[domain]/_components/icon-alert.tsx@@ -3,18 +3,22 @@ import type { FC } from 'react';import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';-type BaseAlertProps = {+import { cn } from '@/lib/utils';++type IconAlertProps = {+ className?: string;icon: LucideIcon;title: string;children: React.ReactNode;};-export const BaseAlert: FC<BaseAlertProps> = ({+export const IconAlert: FC<IconAlertProps> = ({+ className,icon: Icon,title,children,}) => (- <Alert className="mx-auto mt-24 max-w-max">+ <Alert className={cn('mx-auto max-w-max', className)}><Icon className="h-4 w-4" /><AlertTitle>{title}</AlertTitle><AlertDescription>{children}</AlertDescription>diff --git a/app/lookup/[domain]/certs/layout.tsx b/app/lookup/[domain]/certs/layout.tsxnew file mode 100644index 0000000..798a1ab--- /dev/null+++ b/app/lookup/[domain]/certs/layout.tsx@@ -0,0 +1,38 @@+import { InfoIcon } from 'lucide-react';+import type { FC, ReactNode } from 'react';++import { IconAlert } from '../_components/icon-alert';++type CertsLayoutProps = {+ children: ReactNode;+};++const CertsLayout: FC<CertsLayoutProps> = ({ children }) => (+ <>+ <IconAlert className="my-12" icon={InfoIcon} title="How it works">+ Every certificate issued for a domain by a trusted CA{' '}+ <a+ className="underline decoration-dotted underline-offset-4"+ href="https://certificate.transparency.dev/"+ target="_blank"+ rel="noreferrer nofollow"+ >+ is publicly announced and stored+ </a>+ .<br />+ The entires on this page were collected by{' '}+ <a+ className="underline decoration-dotted underline-offset-4"+ href="https://crt.sh/"+ target="_blank"+ rel="noreferrer nofollow"+ >+ crt.sh+ </a>+ .+ </IconAlert>+ {children}+ </>+);++export default CertsLayout;diff --git a/app/lookup/[domain]/map/page.tsx b/app/lookup/[domain]/map/page.tsxindex 0a93256..4edd8d9 100644--- a/app/lookup/[domain]/map/page.tsx+++ b/app/lookup/[domain]/map/page.tsx@@ -7,7 +7,7 @@ import { isUserBot } from '@/lib/api';import { getGlobalLookupResults, getHasDifferences } from '@/lib/map';import { InternalDoHResolver } from '@/lib/resolvers/internal';-import { BaseAlert } from './_components/base-alert';+import { IconAlert } from '../_components/icon-alert';import { ResultsGlobe } from './_components/results-globe';export const runtime = 'edge';@@ -37,12 +37,16 @@ const MapResultsPage: FC<MapResultsPageProps> = async ({if (isBot) {console.log('Bot detected, blocking request, UA:', userAgent);return (- <BaseAlert icon={ShieldAlertIcon} title="Bot or crawler detected!">+ <IconAlert+ className="mt-24"+ icon={ShieldAlertIcon}+ title="Bot or crawler detected!"+ >To protect our infrastructure, this page is not available for bots orcrawlers.<br />But don't be sad, there's nothing to crawl here anyway.- </BaseAlert>+ </IconAlert>);}@@ -55,17 +59,25 @@ const MapResultsPage: FC<MapResultsPageProps> = async ({return (<>{hasDifferences ? (- <BaseAlert icon={InfoIcon} title="Different records detected!">+ <IconAlert+ className="mt-12"+ icon={InfoIcon}+ title="Different records detected!"+ >Not all regions have the same records for this domain. This{' '}<i>could</i> be an indication for the use of GeoDNS.<br /> Keep in mind however, that some providers rotate their IPaddresses, which can also lead to different results.- </BaseAlert>+ </IconAlert>) : (- <BaseAlert icon={CheckCircleIcon} title="All records are the same!">+ <IconAlert+ className="mt-12"+ icon={CheckCircleIcon}+ title="All records are the same!"+ >All records are the same for all regions. Therefore propagation wassuccessful and the domain is not using GeoDNS.- </BaseAlert>+ </IconAlert>)}<div className="mx-[-2rem]">diff --git a/app/lookup/[domain]/subdomains/layout.tsx b/app/lookup/[domain]/subdomains/layout.tsxnew file mode 100644index 0000000..a536676--- /dev/null+++ b/app/lookup/[domain]/subdomains/layout.tsx@@ -0,0 +1,33 @@+import { InfoIcon } from 'lucide-react';+import Link from 'next/link';+import type { FC, ReactNode } from 'react';++import { IconAlert } from '../_components/icon-alert';++type SubdomainsLayoutProps = {+ children: ReactNode;+ params: {+ domain: string;+ };+};++const SubdomainsLayout: FC<SubdomainsLayoutProps> = ({+ children,+ params: { domain },+}) => (+ <>+ <IconAlert className="my-12" icon={InfoIcon} title="How it works">+ This is a deduplicated list of all subdomains found in the{' '}+ <Link+ className="underline decoration-dotted underline-offset-4"+ href={`/lookup/${domain}/certs`}+ >+ certificate transparency logs+ </Link>{' '}+ for this domain.+ </IconAlert>+ {children}+ </>+);++export default SubdomainsLayout;