mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-11-30 09:00:34 +03:00
Translations for diagnostics, and resole checks
This commit is contained in:
1 parent
005cb5e92c
commit
b8b5cd111a
21 files changed
+2310
-1126
No files matched your search
@@ -153,8 +153,9 @@ function scanDirectory(dirPath: string): HardcodedText[] {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Validate safeName to prevent path traversal and unsafe characters
|
||||
if (safeName.includes('..') || /[^a-zA-Z0-9._-]/.test(safeName)) {
|
||||
// Validate safeName to prevent path traversal
|
||||
// Allow SvelteKit file naming patterns: +page.svelte, [lang], (sections), etc.
|
||||
if (safeName.includes('..')) {
|
||||
console.error(`Unsafe file or directory name blocked: ${safeName}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,28 +1,190 @@
|
||||
{
|
||||
"title": "DMARC Record Checker",
|
||||
"description": "Check and validate DMARC (Domain-based Message Authentication) records",
|
||||
"title": "DMARC Policy Checker",
|
||||
"subtitle": "Analyze DMARC (Domain-based Message Authentication, Reporting & Conformance) policies. Check policy configuration, alignment settings, and identify potential security issues.",
|
||||
|
||||
"examples": {
|
||||
"title": "DMARC Examples",
|
||||
"items": {
|
||||
"google": {
|
||||
"domain": "google.com",
|
||||
"description": "Google DMARC policy",
|
||||
"tooltip": "Check DMARC policy for google.com (Google DMARC policy)"
|
||||
},
|
||||
"github": {
|
||||
"domain": "github.com",
|
||||
"description": "GitHub enterprise DMARC",
|
||||
"tooltip": "Check DMARC policy for github.com (GitHub enterprise DMARC)"
|
||||
},
|
||||
"microsoft": {
|
||||
"domain": "microsoft.com",
|
||||
"description": "Microsoft DMARC configuration",
|
||||
"tooltip": "Check DMARC policy for microsoft.com (Microsoft DMARC configuration)"
|
||||
},
|
||||
"paypal": {
|
||||
"domain": "paypal.com",
|
||||
"description": "PayPal strict DMARC policy",
|
||||
"tooltip": "Check DMARC policy for paypal.com (PayPal strict DMARC policy)"
|
||||
},
|
||||
"amazon": {
|
||||
"domain": "amazon.com",
|
||||
"description": "Amazon DMARC implementation",
|
||||
"tooltip": "Check DMARC policy for amazon.com (Amazon DMARC implementation)"
|
||||
},
|
||||
"salesforce": {
|
||||
"domain": "salesforce.com",
|
||||
"description": "Salesforce DMARC setup",
|
||||
"tooltip": "Check DMARC policy for salesforce.com (Salesforce DMARC setup)"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"form": {
|
||||
"title": "DMARC Check",
|
||||
"domain": {
|
||||
"label": "Domain",
|
||||
"placeholder": "example.com"
|
||||
},
|
||||
"check": "Check DMARC",
|
||||
"checking": "Checking...",
|
||||
"error": "Please enter a domain"
|
||||
"title": "DMARC Policy Check",
|
||||
"domainLabel": "Domain Name",
|
||||
"domainTooltip": "Enter the domain to check DMARC policy for",
|
||||
"domainPlaceholder": "example.com",
|
||||
"checkButton": "Check DMARC Policy",
|
||||
"checking": "Checking DMARC..."
|
||||
},
|
||||
|
||||
"results": {
|
||||
"title": "DMARC Record Results",
|
||||
"found": "DMARC Record Found",
|
||||
"not_found": "DMARC Record Not Found",
|
||||
"policy": "Policy",
|
||||
"subdomain_policy": "Subdomain Policy",
|
||||
"percentage": "Percentage",
|
||||
"rua": "Aggregate Reports (RUA)",
|
||||
"ruf": "Forensic Reports (RUF)",
|
||||
"valid": "Valid",
|
||||
"invalid": "Invalid"
|
||||
"title": "DMARC Policy Analysis",
|
||||
"copy": "Copy Results",
|
||||
"copied": "Copied!",
|
||||
|
||||
"status": {
|
||||
"secure": "DMARC Configuration Secure",
|
||||
"issuesFound": "DMARC Issues Found",
|
||||
"needsImprovement": "DMARC Needs Improvement",
|
||||
"noCriticalIssues": "No critical issues detected",
|
||||
"issuesIdentified": "{count} issue{plural} identified"
|
||||
},
|
||||
|
||||
"recordSection": {
|
||||
"title": "DMARC Record",
|
||||
"location": "_dmarc.{domain}"
|
||||
},
|
||||
|
||||
"policyConfiguration": {
|
||||
"title": "Policy Configuration",
|
||||
"mainPolicy": "Main Policy",
|
||||
"subdomainPolicy": "Subdomain Policy",
|
||||
"coverage": "Coverage",
|
||||
"dkimAlignment": "DKIM Alignment",
|
||||
"spfAlignment": "SPF Alignment",
|
||||
"failureOptions": "Failure Options",
|
||||
|
||||
"policies": {
|
||||
"reject": "Reject non-compliant messages",
|
||||
"quarantine": "Quarantine suspicious messages",
|
||||
"none": "Monitor only, no action",
|
||||
"unknown": "Unknown policy"
|
||||
},
|
||||
|
||||
"alignment": {
|
||||
"strict": "Strict",
|
||||
"relaxed": "Relaxed",
|
||||
"strictDescription": "Exact domain match",
|
||||
"relaxedDescription": "Organizational domain match"
|
||||
},
|
||||
|
||||
"coverageDescription": "of messages affected",
|
||||
|
||||
"failureOptionsDescriptions": {
|
||||
"both": "DKIM and SPF failure",
|
||||
"any": "Any alignment failure",
|
||||
"dkim": "DKIM failure only",
|
||||
"spf": "SPF failure only",
|
||||
"custom": "Custom configuration"
|
||||
}
|
||||
},
|
||||
|
||||
"reporting": {
|
||||
"title": "Reporting Configuration",
|
||||
"aggregateReports": "Aggregate Reports (RUA)",
|
||||
"forensicReports": "Forensic Reports (RUF)",
|
||||
"notConfigured": "Not configured"
|
||||
},
|
||||
|
||||
"issues": {
|
||||
"title": "Issues & Recommendations",
|
||||
"messages": {
|
||||
"policyNone": "Policy is set to \"none\" - no action taken on DMARC failures",
|
||||
"relaxedAlignment": "Both DKIM and SPF alignment are relaxed - consider strict alignment",
|
||||
"noAggregateReporting": "No aggregate reporting address (rua) specified",
|
||||
"noForensicReporting": "No forensic reporting address (ruf) specified",
|
||||
"partialCoverage": "Only {percentage}% of messages are subject to DMARC policy"
|
||||
},
|
||||
"severityLevels": {
|
||||
"high": "HIGH",
|
||||
"medium": "MEDIUM",
|
||||
"low": "LOW"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"noRecord": {
|
||||
"title": "No DMARC Record Found",
|
||||
"message": "Domain {domain} does not have a DMARC policy configured at {dmarcDomain}.",
|
||||
"helpText": "This means the domain is not protected by DMARC. Consider implementing a DMARC policy to prevent email spoofing."
|
||||
},
|
||||
|
||||
"error": {
|
||||
"title": "DMARC Check Failed",
|
||||
"lookupFailed": "DMARC check failed: {status}",
|
||||
"unknownError": "Unknown error occurred"
|
||||
},
|
||||
|
||||
"copy": {
|
||||
"header": "DMARC Check for {domain}",
|
||||
"generatedAt": "Generated at: {timestamp}",
|
||||
"recordLabel": "DMARC Record:",
|
||||
"parsedPolicyLabel": "Parsed Policy:",
|
||||
"mainPolicyLabel": "Main Policy:",
|
||||
"subdomainPolicyLabel": "Subdomain Policy:",
|
||||
"dkimAlignmentLabel": "DKIM Alignment:",
|
||||
"spfAlignmentLabel": "SPF Alignment:",
|
||||
"percentageLabel": "Percentage:",
|
||||
"aggregateReportsLabel": "Aggregate Reports:",
|
||||
"forensicReportsLabel": "Forensic Reports:",
|
||||
"failureOptionsLabel": "Failure Options:",
|
||||
"issuesFoundLabel": "Issues Found:",
|
||||
"noIssuesFound": "No issues found - DMARC configuration looks good!",
|
||||
"alignmentStrict": "strict",
|
||||
"alignmentRelaxed": "relaxed"
|
||||
},
|
||||
|
||||
"educational": {
|
||||
"title": "Understanding DMARC",
|
||||
|
||||
"policies": {
|
||||
"title": "DMARC Policies",
|
||||
"none": "Monitor mode - collect data but take no action on failures",
|
||||
"quarantine": "Mark suspicious messages, often sent to spam folder",
|
||||
"reject": "Reject non-compliant messages outright (strongest security)"
|
||||
},
|
||||
|
||||
"alignmentModes": {
|
||||
"title": "Alignment Modes",
|
||||
"relaxed": "Allows organizational domain matching (default)",
|
||||
"strict": "Requires exact domain matching (more secure)"
|
||||
},
|
||||
|
||||
"reportingTypes": {
|
||||
"title": "Reporting Types",
|
||||
"aggregate": "Daily summary reports of DMARC activity",
|
||||
"forensic": "Real-time failure reports with message samples"
|
||||
},
|
||||
|
||||
"bestPractices": {
|
||||
"title": "Best Practices",
|
||||
"items": {
|
||||
"startMonitoring": "Start with p=none to monitor before enforcement",
|
||||
"gradualEnforcement": "Gradually increase to p=quarantine then p=reject",
|
||||
"setupReporting": "Set up aggregate reporting to monitor DMARC activity",
|
||||
"strictAlignment": "Use strict alignment for enhanced security when possible",
|
||||
"subdomainPolicy": "Consider subdomain policy for comprehensive coverage"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +1,124 @@
|
||||
{
|
||||
"title": "DNSSEC Validation Chain",
|
||||
"description": "Trace and validate the DNSSEC chain of trust for a domain",
|
||||
"title": "DNSSEC Validation Chain Checker",
|
||||
"subtitle": "Validate DNSSEC chain from root to domain, verify DS/DNSKEY matching and RRSIG signatures",
|
||||
|
||||
"examples": {
|
||||
"title": "Quick Examples",
|
||||
"items": {
|
||||
"govuk": {
|
||||
"domain": "gov.uk",
|
||||
"description": "UK Government (DNSSEC Enabled)",
|
||||
"tooltip": "Check DNSSEC for gov.uk"
|
||||
},
|
||||
"cloudflare": {
|
||||
"domain": "cloudflare.com",
|
||||
"description": "Cloudflare (DNSSEC Enabled)",
|
||||
"tooltip": "Check DNSSEC for cloudflare.com"
|
||||
},
|
||||
"failed": {
|
||||
"domain": "dnssec-failed.org",
|
||||
"description": "DNSSEC Failed Test",
|
||||
"tooltip": "Check DNSSEC for dnssec-failed.org"
|
||||
},
|
||||
"google": {
|
||||
"domain": "google.com",
|
||||
"description": "Google (DNSSEC Enabled)",
|
||||
"tooltip": "Check DNSSEC for google.com"
|
||||
},
|
||||
"isc": {
|
||||
"domain": "isc.org",
|
||||
"description": "ISC (DNSSEC Pioneer)",
|
||||
"tooltip": "Check DNSSEC for isc.org"
|
||||
},
|
||||
"ietf": {
|
||||
"domain": "ietf.org",
|
||||
"description": "IETF (DNSSEC Enabled)",
|
||||
"tooltip": "Check DNSSEC for ietf.org"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"form": {
|
||||
"title": "DNSSEC Chain Validation",
|
||||
"domain": {
|
||||
"label": "Domain",
|
||||
"placeholder": "example.com"
|
||||
},
|
||||
"validate": "Validate DNSSEC Chain",
|
||||
"validating": "Validating...",
|
||||
"error": "Please enter a domain"
|
||||
"title": "Domain Name",
|
||||
"domainLabel": "Domain to Validate",
|
||||
"domainPlaceholder": "example.com",
|
||||
"validateButton": "Validate DNSSEC Chain",
|
||||
"validating": "Validating..."
|
||||
},
|
||||
|
||||
"loading": {
|
||||
"title": "Validating DNSSEC Chain",
|
||||
"message": "Querying DNS records from root to {domain}..."
|
||||
},
|
||||
|
||||
"error": {
|
||||
"title": "Validation Failed",
|
||||
"invalidDomain": "Please enter a valid domain name",
|
||||
"validationFailed": "DNSSEC validation failed",
|
||||
"unexpectedError": "An unexpected error occurred"
|
||||
},
|
||||
|
||||
"results": {
|
||||
"title": "DNSSEC Validation Results",
|
||||
"secure": "Secure",
|
||||
"insecure": "Insecure",
|
||||
"bogus": "Bogus",
|
||||
"chain_valid": "Chain Valid",
|
||||
"chain_broken": "Chain Broken",
|
||||
"ds_records": "DS Records",
|
||||
"dnskey_records": "DNSKEY Records",
|
||||
"rrsig_records": "RRSIG Records"
|
||||
"summary": {
|
||||
"valid": "DNSSEC Valid",
|
||||
"invalid": "DNSSEC Invalid",
|
||||
"domain": "Domain:",
|
||||
"chainLinks": "Chain Links:",
|
||||
"validated": "Validated:",
|
||||
"status": "Status:",
|
||||
"secure": "Secure",
|
||||
"brokenChain": "Broken Chain",
|
||||
"errors": "Validation Errors:"
|
||||
},
|
||||
"chain": {
|
||||
"title": "DNSSEC Chain",
|
||||
"level": "Level {level}",
|
||||
"ds": {
|
||||
"title": "DS Records",
|
||||
"tooltip": "Delegation Signer records link this zone to the parent zone",
|
||||
"keyTag": "Key Tag:",
|
||||
"keyTagTooltip": "Identifier for the DNSKEY this DS record refers to",
|
||||
"algorithm": "Algorithm:",
|
||||
"algorithmTooltip": "Cryptographic algorithm used for signing",
|
||||
"digestType": "Digest Type:",
|
||||
"digestTypeTooltip": "Hash algorithm used to create the digest",
|
||||
"hash": "Hash:",
|
||||
"hashTooltip": "Hash of the DNSKEY record"
|
||||
},
|
||||
"dnskey": {
|
||||
"title": "DNSKEY Records",
|
||||
"tooltip": "Public keys used to verify DNSSEC signatures",
|
||||
"keyTag": "Key Tag:",
|
||||
"keyTagTooltip": "Identifier for this DNSKEY",
|
||||
"flags": "Flags:",
|
||||
"flagsTooltip": "Key properties: 256=ZSK, 257=KSK",
|
||||
"algorithm": "Algorithm:",
|
||||
"algorithmTooltip": "Cryptographic algorithm used for signing",
|
||||
"matchedDS": "Matched DS",
|
||||
"matchedDSTooltip": "This DNSKEY matches a DS record in the parent zone",
|
||||
"ksk": "KSK",
|
||||
"kskTooltip": "Key Signing Key - signs other DNSKEYs",
|
||||
"zsk": "ZSK",
|
||||
"zskTooltip": "Zone Signing Key - signs zone data"
|
||||
},
|
||||
"rrsig": {
|
||||
"title": "RRSIG Records",
|
||||
"tooltip": "Digital signatures created with DNSKEY to authenticate DNS data",
|
||||
"typeCovered": "Type Covered:",
|
||||
"typeCoveredTooltip": "DNS record type this signature covers",
|
||||
"keyTag": "Key Tag:",
|
||||
"keyTagTooltip": "Identifies which DNSKEY created this signature",
|
||||
"signer": "Signer:",
|
||||
"signerTooltip": "Zone that created this signature",
|
||||
"valid": "Valid",
|
||||
"validTooltip": "Signature is valid and within time window",
|
||||
"invalid": "Invalid",
|
||||
"invalidTooltip": "Signature is expired or not yet valid"
|
||||
},
|
||||
"errors": {
|
||||
"title": "Errors"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,78 +1,71 @@
|
||||
{
|
||||
"title": "Email DMARC Policy Checker",
|
||||
"subtitle": "Check DMARC (Domain-based Message Authentication, Reporting & Conformance) policies with focus on email deliverability impact. Understand how DMARC affects your email delivery and reputation.",
|
||||
|
||||
"subtitle": "Check DMARC policy for email authentication, analyze deliverability impact, and get implementation recommendations",
|
||||
"examples": {
|
||||
"title": "DMARC Examples",
|
||||
"items": {
|
||||
"gmail": {
|
||||
"domain": "gmail.com",
|
||||
"description": "Google Gmail DMARC policy",
|
||||
"tooltip": "Check DMARC policy for gmail.com"
|
||||
"tooltip": "Check DMARC configuration for gmail.com"
|
||||
},
|
||||
"outlook": {
|
||||
"domain": "outlook.com",
|
||||
"description": "Microsoft Outlook DMARC setup",
|
||||
"tooltip": "Check DMARC policy for outlook.com"
|
||||
"tooltip": "Check DMARC configuration for outlook.com"
|
||||
},
|
||||
"github": {
|
||||
"domain": "github.com",
|
||||
"description": "GitHub enterprise DMARC",
|
||||
"tooltip": "Check DMARC policy for github.com"
|
||||
"tooltip": "Check DMARC configuration for github.com"
|
||||
},
|
||||
"paypal": {
|
||||
"domain": "paypal.com",
|
||||
"description": "PayPal strict DMARC policy",
|
||||
"tooltip": "Check DMARC policy for paypal.com"
|
||||
"tooltip": "Check DMARC configuration for paypal.com"
|
||||
},
|
||||
"amazon": {
|
||||
"domain": "amazon.com",
|
||||
"description": "Amazon DMARC implementation",
|
||||
"tooltip": "Check DMARC policy for amazon.com"
|
||||
"tooltip": "Check DMARC configuration for amazon.com"
|
||||
},
|
||||
"salesforce": {
|
||||
"domain": "salesforce.com",
|
||||
"description": "Salesforce DMARC configuration",
|
||||
"tooltip": "Check DMARC policy for salesforce.com"
|
||||
"tooltip": "Check DMARC configuration for salesforce.com"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"form": {
|
||||
"title": "DMARC Policy Check",
|
||||
"domainLabel": "Domain Name",
|
||||
"domainPlaceholder": "example.com",
|
||||
"checking": "Checking DMARC...",
|
||||
"checkButton": "Check DMARC Policy"
|
||||
"checkButton": "Check DMARC Policy",
|
||||
"checking": "Checking DMARC..."
|
||||
},
|
||||
|
||||
"results": {
|
||||
"title": "DMARC Policy Analysis",
|
||||
"copyButton": "Copy Results",
|
||||
"copied": "Copied!",
|
||||
|
||||
"deliverability": {
|
||||
"title": "Email Deliverability Impact",
|
||||
"recommendations": "Deliverability Recommendations"
|
||||
},
|
||||
|
||||
"record": {
|
||||
"title": "DMARC Record"
|
||||
},
|
||||
|
||||
"policy": {
|
||||
"title": "Policy Configuration",
|
||||
"mainPolicy": "Main Policy",
|
||||
"subdomainPolicy": "Subdomain Policy",
|
||||
"coverage": "Coverage",
|
||||
"coverageDescription": "of messages affected",
|
||||
"coverage": "Coverage Percentage",
|
||||
"coverageDescription": "Percentage of mail subject to policy",
|
||||
"dkimAlignment": "DKIM Alignment",
|
||||
"spfAlignment": "SPF Alignment",
|
||||
"failureOptions": "Failure Options",
|
||||
|
||||
"failureOptions": "Failure Reporting Options",
|
||||
"values": {
|
||||
"reject": "Reject non-compliant messages",
|
||||
"quarantine": "Quarantine suspicious messages",
|
||||
"reject": "Block all unauthorized emails",
|
||||
"quarantine": "Mark as spam/junk",
|
||||
"none": "Monitor only, no action",
|
||||
"unknown": "Unknown policy",
|
||||
"strict": "Strict",
|
||||
@@ -80,16 +73,14 @@
|
||||
"strictDescription": "Exact domain match required",
|
||||
"relaxedDescription": "Organizational domain match allowed"
|
||||
},
|
||||
|
||||
"failureOptionsValues": {
|
||||
"0": "DKIM and SPF failure",
|
||||
"1": "Any alignment failure",
|
||||
"d": "DKIM failure only",
|
||||
"s": "SPF failure only",
|
||||
"custom": "Custom configuration"
|
||||
"0": "Generate reports if all mechanisms fail",
|
||||
"1": "Generate reports if any mechanism fails",
|
||||
"d": "Generate reports if DKIM check fails",
|
||||
"s": "Generate reports if SPF check fails",
|
||||
"custom": "Custom failure reporting configuration"
|
||||
}
|
||||
},
|
||||
|
||||
"reporting": {
|
||||
"title": "Email Reporting Configuration",
|
||||
"aggregateTitle": "Aggregate Reports (RUA)",
|
||||
@@ -102,10 +93,9 @@
|
||||
"forensicNotConfiguredHint": "Optional - provides detailed failure analysis"
|
||||
}
|
||||
},
|
||||
|
||||
"noRecord": {
|
||||
"title": "No DMARC Record Found",
|
||||
"message": "Domain {domain} does not have a DMARC policy configured at _dmarc.{domain}.",
|
||||
"message": "No DMARC record was found for {domain}",
|
||||
"impactTitle": "Email Deliverability Impact:",
|
||||
"impacts": {
|
||||
"noProtection": "No protection against email spoofing",
|
||||
@@ -114,41 +104,36 @@
|
||||
"recommendation": "Consider implementing DMARC starting with p=none for monitoring"
|
||||
}
|
||||
},
|
||||
|
||||
"error": {
|
||||
"title": "DMARC Check Failed"
|
||||
},
|
||||
|
||||
"education": {
|
||||
"title": "Understanding DMARC for Email Delivery",
|
||||
"policiesTitle": "DMARC Policies & Email Impact",
|
||||
"policies": {
|
||||
"none": "none: Monitor mode - no delivery impact, collect data only",
|
||||
"quarantine": "quarantine: Failed messages may go to spam/junk folder",
|
||||
"reject": "reject: Failed messages rejected outright - strongest protection"
|
||||
"none": "none: Monitoring mode - no action taken on failures, only reporting",
|
||||
"quarantine": "quarantine: Failed emails are marked as spam or moved to quarantine",
|
||||
"reject": "reject: Failed emails are rejected outright, strongest protection"
|
||||
},
|
||||
|
||||
"bestPracticesTitle": "Email Delivery Best Practices",
|
||||
"bestPractices": {
|
||||
"startNone": "Start with p=none to monitor before enforcement",
|
||||
"gradual": "Gradually increase to p=quarantine then p=reject",
|
||||
"reporting": "Set up aggregate reporting to monitor delivery",
|
||||
"testAlignment": "Test alignment requirements carefully",
|
||||
"subdomain": "Consider subdomain policy for comprehensive coverage"
|
||||
"startNone": "Start with p=none to monitor without affecting email delivery",
|
||||
"gradual": "Gradually move to p=quarantine, then p=reject as you fix issues",
|
||||
"reporting": "Set up aggregate reporting (rua=) to track authentication results",
|
||||
"testAlignment": "Test DKIM and SPF alignment before enforcing strict policies",
|
||||
"subdomain": "Consider subdomain policy (sp=) if subdomains send email"
|
||||
},
|
||||
|
||||
"alignmentTitle": "Alignment Modes & Delivery",
|
||||
"alignmentTitle": "Alignment Modes",
|
||||
"alignment": {
|
||||
"relaxed": "Relaxed (r): Allows organizational domain matching (safer for delivery)",
|
||||
"strict": "Strict (s): Requires exact domain matching (higher security, delivery risk)"
|
||||
"relaxed": "Relaxed (r): Allows organizational domain matches (subdomain.example.com matches example.com)",
|
||||
"strict": "Strict (s): Requires exact domain match for DKIM/SPF alignment"
|
||||
},
|
||||
|
||||
"issuesTitle": "Common Delivery Issues",
|
||||
"issuesTitle": "Common Email Delivery Issues",
|
||||
"issues": {
|
||||
"thirdParty": "Strict alignment with third-party senders",
|
||||
"forwarding": "Forwarded emails failing DMARC checks",
|
||||
"mailingLists": "Mailing lists modifying message headers",
|
||||
"percentage": "Percentage rollout causing inconsistent delivery"
|
||||
"thirdParty": "Third-party senders may fail if not properly configured in SPF/DKIM",
|
||||
"forwarding": "Email forwarding can break SPF alignment",
|
||||
"mailingLists": "Mailing lists may modify messages, breaking DKIM signatures",
|
||||
"percentage": "Use pct= to gradually roll out enforcement (default 100%)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,119 @@
|
||||
{
|
||||
"title": "RDAP ASN Lookup",
|
||||
"description": "Look up registration data for an Autonomous System Number using RDAP",
|
||||
"title": "ASN RDAP Lookup",
|
||||
"subtitle": "Query Autonomous System Number allocation and registration data using RDAP through Regional Internet Registries. ASNs identify networks on the global Internet routing table and are essential for BGP routing operations.",
|
||||
|
||||
"examples": {
|
||||
"title": "Common ASN Examples",
|
||||
"items": {
|
||||
"google": {
|
||||
"asn": "AS15169",
|
||||
"description": "Google LLC - Major cloud provider",
|
||||
"tooltip": "Perform RDAP lookup for AS15169 (Google LLC - Major cloud provider)"
|
||||
},
|
||||
"cloudflare": {
|
||||
"asn": "AS13335",
|
||||
"description": "Cloudflare - CDN and security services",
|
||||
"tooltip": "Perform RDAP lookup for AS13335 (Cloudflare - CDN and security services)"
|
||||
},
|
||||
"amazon": {
|
||||
"asn": "AS16509",
|
||||
"description": "Amazon.com - AWS cloud infrastructure",
|
||||
"tooltip": "Perform RDAP lookup for AS16509 (Amazon.com - AWS cloud infrastructure)"
|
||||
},
|
||||
"microsoft": {
|
||||
"asn": "AS8075",
|
||||
"description": "Microsoft Corporation - Azure cloud",
|
||||
"tooltip": "Perform RDAP lookup for AS8075 (Microsoft Corporation - Azure cloud)"
|
||||
},
|
||||
"meta": {
|
||||
"asn": "AS32934",
|
||||
"description": "Meta Platforms - Facebook services",
|
||||
"tooltip": "Perform RDAP lookup for AS32934 (Meta Platforms - Facebook services)"
|
||||
},
|
||||
"googleCloud": {
|
||||
"asn": "AS396982",
|
||||
"description": "Google Cloud Platform - Additional ranges",
|
||||
"tooltip": "Perform RDAP lookup for AS396982 (Google Cloud Platform - Additional ranges)"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"form": {
|
||||
"title": "ASN Lookup",
|
||||
"asn": {
|
||||
"label": "ASN",
|
||||
"placeholder": "AS15169 or 15169"
|
||||
},
|
||||
"lookup": "Lookup ASN",
|
||||
"looking_up": "Looking up...",
|
||||
"error": "Please enter a valid ASN"
|
||||
"title": "RDAP Lookup Configuration",
|
||||
"asnLabel": "Autonomous System Number",
|
||||
"asnPlaceholder": "AS15169 or 15169",
|
||||
"asnTooltip": "Enter an Autonomous System Number to query allocation data via RDAP",
|
||||
"asnHint": "Supports both formats: AS15169 or 15169 (AS prefix is optional)",
|
||||
"lookupButton": "Lookup ASN",
|
||||
"performing": "Performing RDAP Lookup..."
|
||||
},
|
||||
|
||||
"results": {
|
||||
"title": "ASN Registration Data",
|
||||
"title": "RDAP Data for {asn}",
|
||||
"copy": "Copy Raw JSON",
|
||||
"copied": "Copied!",
|
||||
"asn": "ASN",
|
||||
"name": "Name",
|
||||
"country": "Country",
|
||||
"registry": "Registry",
|
||||
"registration_date": "Registration Date",
|
||||
"last_updated": "Last Updated",
|
||||
"status": "Status",
|
||||
"entities": "Entities",
|
||||
"remarks": "Remarks"
|
||||
"asnTooltip": "The ASN that was queried",
|
||||
"rdapService": "RDAP Service",
|
||||
"rdapServiceTooltip": "RDAP service used for the query",
|
||||
"notAvailable": "Not available",
|
||||
"asnInfo": {
|
||||
"title": "ASN Information",
|
||||
"organizationName": "Organization Name:",
|
||||
"type": "Type:",
|
||||
"country": "Country:",
|
||||
"registry": "Registry:"
|
||||
},
|
||||
"allocation": {
|
||||
"title": "Allocation Details",
|
||||
"status": "Status:",
|
||||
"allocationDate": "Allocation Date:",
|
||||
"lastChanged": "Last Changed:"
|
||||
},
|
||||
"contacts": {
|
||||
"title": "Contact Information",
|
||||
"registrant": "Registrant",
|
||||
"administrative": "Administrative",
|
||||
"technical": "Technical",
|
||||
"abuse": "Abuse",
|
||||
"contact": "Contact",
|
||||
"handle": "Handle: {handle}"
|
||||
}
|
||||
},
|
||||
|
||||
"error": {
|
||||
"title": "RDAP Lookup Failed",
|
||||
"lookupFailed": "ASN RDAP lookup failed: {status}",
|
||||
"troubleshooting": {
|
||||
"title": "Troubleshooting Tips:",
|
||||
"validFormat": "Ensure the ASN format is valid (e.g., AS15169 or just 15169)",
|
||||
"asnExists": "Check if the ASN exists and is currently allocated",
|
||||
"privateASN": "Private ASNs (64512-65534, 4200000000-4294967294) may not have public RDAP data",
|
||||
"rateLimiting": "Some RIRs may have rate limiting or access restrictions",
|
||||
"tryAgain": "Try again in a few moments if the service is temporarily unavailable"
|
||||
}
|
||||
},
|
||||
|
||||
"educational": {
|
||||
"title": "About ASN RDAP Lookups",
|
||||
"whatIsASN": {
|
||||
"title": "What is an ASN?",
|
||||
"description": "Autonomous System Numbers identify networks on the global Internet routing table and are essential for BGP routing operations. Each ASN represents a collection of IP address blocks under unified administrative control."
|
||||
},
|
||||
"asnRanges": {
|
||||
"title": "ASN Ranges by Registry",
|
||||
"arin": "ARIN: AS1 - AS23551, AS393216 - AS394239",
|
||||
"ripe": "RIPE NCC: AS24576 - AS25599, AS34816 - AS35839",
|
||||
"apnic": "APNIC: AS23552 - AS24575, AS37888 - AS38911",
|
||||
"lacnic": "LACNIC: AS26592 - AS27647, AS61440 - AS61951",
|
||||
"afrinic": "AFRINIC: AS36864 - AS37887, AS327680 - AS328703"
|
||||
},
|
||||
"whatYouGet": {
|
||||
"title": "What You'll Get",
|
||||
"organization": "Organization name and type",
|
||||
"country": "Country of registration",
|
||||
"allocation": "Allocation date and status",
|
||||
"contacts": "Contact information (admin, technical, abuse)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,119 @@
|
||||
{
|
||||
"title": "RDAP Domain Lookup",
|
||||
"description": "Look up registration data for a domain name using RDAP",
|
||||
"title": "Domain RDAP Lookup",
|
||||
"subtitle": "Query domain registration data using RDAP (Registration Data Access Protocol). RDAP is the modern successor to WHOIS, providing structured JSON responses through IANA bootstrap registry routing.",
|
||||
|
||||
"examples": {
|
||||
"title": "Common Domain Examples",
|
||||
"items": {
|
||||
"example": {
|
||||
"domain": "example.com",
|
||||
"description": "Example domain for testing",
|
||||
"tooltip": "Perform RDAP lookup for example.com (Example domain for testing)"
|
||||
},
|
||||
"google": {
|
||||
"domain": "google.com",
|
||||
"description": "Popular domain with comprehensive records",
|
||||
"tooltip": "Perform RDAP lookup for google.com (Popular domain with comprehensive records)"
|
||||
},
|
||||
"github": {
|
||||
"domain": "github.com",
|
||||
"description": "Tech company domain",
|
||||
"tooltip": "Perform RDAP lookup for github.com (Tech company domain)"
|
||||
},
|
||||
"stackoverflow": {
|
||||
"domain": "stackoverflow.com",
|
||||
"description": "Community platform domain",
|
||||
"tooltip": "Perform RDAP lookup for stackoverflow.com (Community platform domain)"
|
||||
},
|
||||
"cloudflare": {
|
||||
"domain": "cloudflare.com",
|
||||
"description": "CDN provider domain",
|
||||
"tooltip": "Perform RDAP lookup for cloudflare.com (CDN provider domain)"
|
||||
},
|
||||
"iana": {
|
||||
"domain": "iana.org",
|
||||
"description": "Internet registry domain",
|
||||
"tooltip": "Perform RDAP lookup for iana.org (Internet registry domain)"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"form": {
|
||||
"title": "Domain Lookup",
|
||||
"domain": {
|
||||
"label": "Domain Name",
|
||||
"placeholder": "example.com"
|
||||
},
|
||||
"lookup": "Lookup Domain",
|
||||
"looking_up": "Looking up...",
|
||||
"error": "Please enter a valid domain name"
|
||||
"title": "RDAP Lookup Configuration",
|
||||
"domainLabel": "Domain Name",
|
||||
"domainPlaceholder": "example.com",
|
||||
"domainTooltip": "Enter a domain name to query registration data via RDAP",
|
||||
"lookupButton": "Lookup Domain",
|
||||
"performing": "Performing RDAP Lookup..."
|
||||
},
|
||||
|
||||
"results": {
|
||||
"title": "Domain Registration Data",
|
||||
"title": "RDAP Data for {domain}",
|
||||
"copy": "Copy Raw JSON",
|
||||
"copied": "Copied!",
|
||||
"domain": "Domain",
|
||||
"registrar": "Registrar",
|
||||
"registration_date": "Registration Date",
|
||||
"expiration_date": "Expiration Date",
|
||||
"last_updated": "Last Updated",
|
||||
"status": "Status",
|
||||
"nameservers": "Nameservers",
|
||||
"dnssec": "DNSSEC",
|
||||
"entities": "Entities",
|
||||
"registrant": "Registrant",
|
||||
"admin": "Admin Contact",
|
||||
"tech": "Tech Contact"
|
||||
"domainTooltip": "The domain name that was queried",
|
||||
"rdapService": "RDAP Service",
|
||||
"rdapServiceTooltip": "RDAP service used for the query",
|
||||
"notAvailable": "Not available",
|
||||
"domainInfo": {
|
||||
"title": "Domain Information",
|
||||
"domainName": "Domain Name:",
|
||||
"status": "Status:",
|
||||
"registrar": "Registrar:"
|
||||
},
|
||||
"dates": {
|
||||
"title": "Important Dates",
|
||||
"registration": "Registration Date:",
|
||||
"lastUpdated": "Last Updated:",
|
||||
"expiration": "Expiration Date:",
|
||||
"expiresSoon": "Expires Soon!"
|
||||
},
|
||||
"nameservers": {
|
||||
"title": "Nameservers ({count})"
|
||||
},
|
||||
"contacts": {
|
||||
"title": "Contact Information",
|
||||
"registrant": "Registrant",
|
||||
"administrative": "Administrative",
|
||||
"technical": "Technical",
|
||||
"contact": "Contact",
|
||||
"handle": "Handle: {handle}"
|
||||
}
|
||||
},
|
||||
|
||||
"error": {
|
||||
"title": "RDAP Lookup Failed",
|
||||
"unknownError": "Unknown error occurred",
|
||||
"lookupFailed": "Domain RDAP lookup failed: {status}",
|
||||
"troubleshooting": {
|
||||
"title": "Troubleshooting Tips:",
|
||||
"validDomain": "Ensure the domain name is valid and properly formatted",
|
||||
"domainExists": "Check if the domain actually exists and is registered",
|
||||
"rateLimiting": "Some registries may have rate limiting or access restrictions",
|
||||
"tryAgain": "Try again in a few moments if the service is temporarily unavailable"
|
||||
}
|
||||
},
|
||||
|
||||
"educational": {
|
||||
"title": "About RDAP Domain Lookups",
|
||||
"whatIsRDAP": {
|
||||
"title": "What is RDAP?",
|
||||
"description": "RDAP (Registration Data Access Protocol) is the modern successor to WHOIS, providing structured JSON responses for domain registration information through IANA bootstrap registry routing."
|
||||
},
|
||||
"whatYouGet": {
|
||||
"title": "What You'll Get",
|
||||
"statusDates": "Registration status and dates",
|
||||
"nameservers": "Nameserver information",
|
||||
"registrar": "Registrar details",
|
||||
"contacts": "Contact information (if available)"
|
||||
},
|
||||
"rdapVsWhois": {
|
||||
"title": "RDAP vs WHOIS",
|
||||
"structuredJSON": "Structured JSON instead of free text",
|
||||
"unicodeSupport": "Unicode support for internationalized domains",
|
||||
"rateLimiting": "Built-in rate limiting and privacy controls",
|
||||
"restfulAPI": "RESTful API with standard HTTP methods"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,121 @@
|
||||
{
|
||||
"title": "RDAP IP Lookup",
|
||||
"description": "Look up registration data for an IP address or network using RDAP",
|
||||
"title": "IP Address RDAP Lookup",
|
||||
"subtitle": "Look up IP address allocation and registration data using RDAP through Regional Internet Registry (RIR) services. Automatically routes queries to the appropriate RIR based on IP address prefix.",
|
||||
|
||||
"examples": {
|
||||
"title": "Common IP Examples",
|
||||
"items": {
|
||||
"googleDNS": {
|
||||
"ip": "8.8.8.8",
|
||||
"description": "Google DNS - Public DNS service",
|
||||
"tooltip": "Perform RDAP lookup for 8.8.8.8 (Google DNS - Public DNS service)"
|
||||
},
|
||||
"cloudflareDNS": {
|
||||
"ip": "1.1.1.1",
|
||||
"description": "Cloudflare DNS - Fast public resolver",
|
||||
"tooltip": "Perform RDAP lookup for 1.1.1.1 (Cloudflare DNS - Fast public resolver)"
|
||||
},
|
||||
"openDNS": {
|
||||
"ip": "208.67.222.222",
|
||||
"description": "OpenDNS - Cisco public DNS",
|
||||
"tooltip": "Perform RDAP lookup for 208.67.222.222 (OpenDNS - Cisco public DNS)"
|
||||
},
|
||||
"rfc5737": {
|
||||
"ip": "192.0.2.1",
|
||||
"description": "RFC 5737 - Documentation IP range",
|
||||
"tooltip": "Perform RDAP lookup for 192.0.2.1 (RFC 5737 - Documentation IP range)"
|
||||
},
|
||||
"googleIPv6": {
|
||||
"ip": "2001:4860:4860::8888",
|
||||
"description": "Google IPv6 DNS",
|
||||
"tooltip": "Perform RDAP lookup for 2001:4860:4860::8888 (Google IPv6 DNS)"
|
||||
},
|
||||
"cloudflareIPv6": {
|
||||
"ip": "2606:4700:4700::1111",
|
||||
"description": "Cloudflare IPv6 DNS",
|
||||
"tooltip": "Perform RDAP lookup for 2606:4700:4700::1111 (Cloudflare IPv6 DNS)"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"form": {
|
||||
"title": "IP Lookup",
|
||||
"ip": {
|
||||
"label": "IP Address",
|
||||
"placeholder": "8.8.8.8 or 2001:4860:4860::8888"
|
||||
},
|
||||
"lookup": "Lookup IP",
|
||||
"looking_up": "Looking up...",
|
||||
"error": "Please enter a valid IP address"
|
||||
"title": "RDAP Lookup Configuration",
|
||||
"ipLabel": "IP Address",
|
||||
"ipPlaceholder": "8.8.8.8 or 2001:4860:4860::8888",
|
||||
"ipTooltip": "Enter an IPv4 or IPv6 address to query allocation data via RDAP",
|
||||
"ipHint": "Supports both IPv4 (e.g., 8.8.8.8) and IPv6 (e.g., 2001:4860:4860::8888) addresses",
|
||||
"lookupButton": "Lookup IP Address",
|
||||
"performing": "Performing RDAP Lookup..."
|
||||
},
|
||||
|
||||
"results": {
|
||||
"title": "IP Registration Data",
|
||||
"ip_address": "IP Address",
|
||||
"network": "Network",
|
||||
"cidr": "CIDR",
|
||||
"name": "Name",
|
||||
"country": "Country",
|
||||
"registry": "Registry",
|
||||
"registration_date": "Registration Date",
|
||||
"last_updated": "Last Updated",
|
||||
"status": "Status",
|
||||
"type": "Type",
|
||||
"entities": "Entities"
|
||||
"title": "RDAP Data for {ip}",
|
||||
"copy": "Copy Raw JSON",
|
||||
"copied": "Copied!",
|
||||
"ipAddress": "IP Address",
|
||||
"ipAddressTooltip": "The IP address that was queried",
|
||||
"rdapService": "RDAP Service",
|
||||
"rdapServiceTooltip": "RDAP service used for the query",
|
||||
"notAvailable": "Not available",
|
||||
"networkInfo": {
|
||||
"title": "Network Information",
|
||||
"networkBlock": "Network Block:",
|
||||
"networkName": "Network Name:",
|
||||
"type": "Type:",
|
||||
"country": "Country:",
|
||||
"registry": "Registry:"
|
||||
},
|
||||
"allocation": {
|
||||
"title": "Allocation Details",
|
||||
"status": "Status:",
|
||||
"allocationDate": "Allocation Date:",
|
||||
"lastChanged": "Last Changed:"
|
||||
},
|
||||
"contacts": {
|
||||
"title": "Contact Information",
|
||||
"registrant": "Registrant",
|
||||
"administrative": "Administrative",
|
||||
"technical": "Technical",
|
||||
"abuse": "Abuse",
|
||||
"contact": "Contact",
|
||||
"handle": "Handle: {handle}"
|
||||
}
|
||||
},
|
||||
|
||||
"error": {
|
||||
"title": "RDAP Lookup Failed",
|
||||
"unknownError": "Unknown error occurred",
|
||||
"lookupFailed": "IP RDAP lookup failed: {status}",
|
||||
"troubleshooting": {
|
||||
"title": "Troubleshooting Tips:",
|
||||
"validIP": "Ensure the IP address is valid and properly formatted",
|
||||
"privateIP": "Private IP addresses (RFC 1918) may not have RDAP data",
|
||||
"rateLimiting": "Some RIRs may have rate limiting or access restrictions",
|
||||
"specialUse": "Reserved or special-use addresses may not be publicly queryable",
|
||||
"tryAgain": "Try again in a few moments if the service is temporarily unavailable"
|
||||
}
|
||||
},
|
||||
|
||||
"educational": {
|
||||
"title": "About IP Address RDAP Lookups",
|
||||
"howItWorks": {
|
||||
"title": "How it Works",
|
||||
"description": "IP RDAP provides detailed allocation information from Regional Internet Registries (RIRs). The tool automatically routes queries to the appropriate RIR using IANA bootstrap registries."
|
||||
},
|
||||
"rirs": {
|
||||
"title": "Regional Internet Registries",
|
||||
"arin": "ARIN: North America, parts of Caribbean",
|
||||
"ripe": "RIPE NCC: Europe, Central Asia, Middle East",
|
||||
"apnic": "APNIC: Asia Pacific region",
|
||||
"lacnic": "LACNIC: Latin America, parts of Caribbean",
|
||||
"afrinic": "AFRINIC: Africa"
|
||||
},
|
||||
"whatYouGet": {
|
||||
"title": "What You'll Get",
|
||||
"networkBlock": "Network block and CIDR prefix",
|
||||
"allocationType": "Allocation type and country",
|
||||
"organization": "Organization responsible for the block",
|
||||
"contacts": "Contact information (registrant, admin, technical, abuse)"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domain = $state('google.com');
|
||||
@@ -10,14 +11,38 @@
|
||||
let copiedState = $state(false);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ domain: 'google.com', description: 'Google DMARC policy' },
|
||||
{ domain: 'github.com', description: 'GitHub enterprise DMARC' },
|
||||
{ domain: 'microsoft.com', description: 'Microsoft DMARC configuration' },
|
||||
{ domain: 'paypal.com', description: 'PayPal strict DMARC policy' },
|
||||
{ domain: 'amazon.com', description: 'Amazon DMARC implementation' },
|
||||
{ domain: 'salesforce.com', description: 'Salesforce DMARC setup' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/dns-dmarc-check.examples.items.google.domain'),
|
||||
description: $t('diagnostics/dns-dmarc-check.examples.items.google.description'),
|
||||
tooltip: $t('diagnostics/dns-dmarc-check.examples.items.google.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dmarc-check.examples.items.github.domain'),
|
||||
description: $t('diagnostics/dns-dmarc-check.examples.items.github.description'),
|
||||
tooltip: $t('diagnostics/dns-dmarc-check.examples.items.github.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dmarc-check.examples.items.microsoft.domain'),
|
||||
description: $t('diagnostics/dns-dmarc-check.examples.items.microsoft.description'),
|
||||
tooltip: $t('diagnostics/dns-dmarc-check.examples.items.microsoft.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dmarc-check.examples.items.paypal.domain'),
|
||||
description: $t('diagnostics/dns-dmarc-check.examples.items.paypal.description'),
|
||||
tooltip: $t('diagnostics/dns-dmarc-check.examples.items.paypal.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dmarc-check.examples.items.amazon.domain'),
|
||||
description: $t('diagnostics/dns-dmarc-check.examples.items.amazon.description'),
|
||||
tooltip: $t('diagnostics/dns-dmarc-check.examples.items.amazon.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dmarc-check.examples.items.salesforce.domain'),
|
||||
description: $t('diagnostics/dns-dmarc-check.examples.items.salesforce.description'),
|
||||
tooltip: $t('diagnostics/dns-dmarc-check.examples.items.salesforce.tooltip'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function checkDMARC() {
|
||||
loading = true;
|
||||
@@ -35,12 +60,12 @@
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`DMARC check failed: ${response.status}`);
|
||||
throw new Error($t('diagnostics/dns-dmarc-check.error.lookupFailed', { status: response.status }));
|
||||
}
|
||||
|
||||
results = await response.json();
|
||||
} catch (err: unknown) {
|
||||
error = (err as Error).message;
|
||||
error = err instanceof Error ? err.message : $t('diagnostics/dns-dmarc-check.error.unknownError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -102,7 +127,7 @@
|
||||
// Policy issues
|
||||
if (parsed.policy === 'none') {
|
||||
issues.push({
|
||||
message: 'Policy is set to "none" - no action taken on DMARC failures',
|
||||
message: $t('diagnostics/dns-dmarc-check.results.issues.messages.policyNone'),
|
||||
severity: 'high',
|
||||
});
|
||||
}
|
||||
@@ -110,7 +135,7 @@
|
||||
// Alignment issues
|
||||
if (parsed.alignment.dkim === 'r' && parsed.alignment.spf === 'r') {
|
||||
issues.push({
|
||||
message: 'Both DKIM and SPF alignment are relaxed - consider strict alignment',
|
||||
message: $t('diagnostics/dns-dmarc-check.results.issues.messages.relaxedAlignment'),
|
||||
severity: 'medium',
|
||||
});
|
||||
}
|
||||
@@ -118,14 +143,14 @@
|
||||
// Reporting issues
|
||||
if (!parsed.reporting.aggregate) {
|
||||
issues.push({
|
||||
message: 'No aggregate reporting address (rua) specified',
|
||||
message: $t('diagnostics/dns-dmarc-check.results.issues.messages.noAggregateReporting'),
|
||||
severity: 'medium',
|
||||
});
|
||||
}
|
||||
|
||||
if (!parsed.reporting.forensic) {
|
||||
issues.push({
|
||||
message: 'No forensic reporting address (ruf) specified',
|
||||
message: $t('diagnostics/dns-dmarc-check.results.issues.messages.noForensicReporting'),
|
||||
severity: 'low',
|
||||
});
|
||||
}
|
||||
@@ -134,7 +159,7 @@
|
||||
const percentage = parseInt(parsed.percentage);
|
||||
if (percentage < 100) {
|
||||
issues.push({
|
||||
message: `Only ${percentage}% of messages are subject to DMARC policy`,
|
||||
message: $t('diagnostics/dns-dmarc-check.results.issues.messages.partialCoverage', { percentage }),
|
||||
severity: percentage < 50 ? 'high' : 'medium',
|
||||
});
|
||||
}
|
||||
@@ -152,34 +177,43 @@
|
||||
async function copyResults() {
|
||||
if (!results) return;
|
||||
|
||||
let text = `DMARC Check for ${domain}\n`;
|
||||
text += `Generated at: ${new Date().toISOString()}\n\n`;
|
||||
let text = $t('diagnostics/dns-dmarc-check.copy.header', { domain }) + '\n';
|
||||
text += $t('diagnostics/dns-dmarc-check.copy.generatedAt', { timestamp: new Date().toISOString() }) + '\n\n';
|
||||
|
||||
if (results.record) {
|
||||
text += `DMARC Record:\n${results.record}\n\n`;
|
||||
text += $t('diagnostics/dns-dmarc-check.copy.recordLabel') + `\n${results.record}\n\n`;
|
||||
}
|
||||
|
||||
if (results.parsed) {
|
||||
const p = results.parsed;
|
||||
text += `Parsed Policy:\n`;
|
||||
text += ` Main Policy: ${p.policy}\n`;
|
||||
if (p.subdomainPolicy) text += ` Subdomain Policy: ${p.subdomainPolicy}\n`;
|
||||
text += ` DKIM Alignment: ${p.alignment.dkim} (${p.alignment.dkim === 's' ? 'strict' : 'relaxed'})\n`;
|
||||
text += ` SPF Alignment: ${p.alignment.spf} (${p.alignment.spf === 's' ? 'strict' : 'relaxed'})\n`;
|
||||
text += ` Percentage: ${p.percentage}%\n`;
|
||||
if (p.reporting.aggregate) text += ` Aggregate Reports: ${p.reporting.aggregate}\n`;
|
||||
if (p.reporting.forensic) text += ` Forensic Reports: ${p.reporting.forensic}\n`;
|
||||
text += ` Failure Options: ${p.reporting.failureOptions}\n\n`;
|
||||
text += $t('diagnostics/dns-dmarc-check.copy.parsedPolicyLabel') + `\n`;
|
||||
text += ` ` + $t('diagnostics/dns-dmarc-check.copy.mainPolicyLabel') + ` ${p.policy}\n`;
|
||||
if (p.subdomainPolicy)
|
||||
text += ` ` + $t('diagnostics/dns-dmarc-check.copy.subdomainPolicyLabel') + ` ${p.subdomainPolicy}\n`;
|
||||
text +=
|
||||
` ` +
|
||||
$t('diagnostics/dns-dmarc-check.copy.dkimAlignmentLabel') +
|
||||
` ${p.alignment.dkim} (${p.alignment.dkim === 's' ? $t('diagnostics/dns-dmarc-check.copy.alignmentStrict') : $t('diagnostics/dns-dmarc-check.copy.alignmentRelaxed')})\n`;
|
||||
text +=
|
||||
` ` +
|
||||
$t('diagnostics/dns-dmarc-check.copy.spfAlignmentLabel') +
|
||||
` ${p.alignment.spf} (${p.alignment.spf === 's' ? $t('diagnostics/dns-dmarc-check.copy.alignmentStrict') : $t('diagnostics/dns-dmarc-check.copy.alignmentRelaxed')})\n`;
|
||||
text += ` ` + $t('diagnostics/dns-dmarc-check.copy.percentageLabel') + ` ${p.percentage}%\n`;
|
||||
if (p.reporting.aggregate)
|
||||
text += ` ` + $t('diagnostics/dns-dmarc-check.copy.aggregateReportsLabel') + ` ${p.reporting.aggregate}\n`;
|
||||
if (p.reporting.forensic)
|
||||
text += ` ` + $t('diagnostics/dns-dmarc-check.copy.forensicReportsLabel') + ` ${p.reporting.forensic}\n`;
|
||||
text += ` ` + $t('diagnostics/dns-dmarc-check.copy.failureOptionsLabel') + ` ${p.reporting.failureOptions}\n\n`;
|
||||
}
|
||||
|
||||
const issues = getIssues();
|
||||
if (issues.length > 0) {
|
||||
text += `Issues Found:\n`;
|
||||
text += $t('diagnostics/dns-dmarc-check.copy.issuesFoundLabel') + `\n`;
|
||||
issues.forEach((issue) => {
|
||||
text += ` [${issue.severity.toUpperCase()}] ${issue.message}\n`;
|
||||
});
|
||||
} else {
|
||||
text += `No issues found - DMARC configuration looks good!\n`;
|
||||
text += $t('diagnostics/dns-dmarc-check.copy.noIssuesFound') + `\n`;
|
||||
}
|
||||
|
||||
await navigator.clipboard.writeText(text);
|
||||
@@ -190,11 +224,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>DMARC Policy Checker</h1>
|
||||
<p>
|
||||
Analyze DMARC (Domain-based Message Authentication, Reporting & Conformance) policies. Check policy configuration,
|
||||
alignment settings, and identify potential security issues.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/dns-dmarc-check.title')}</h1>
|
||||
<p>{$t('diagnostics/dns-dmarc-check.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -202,7 +233,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>DMARC Examples</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -210,7 +241,7 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Check DMARC policy for ${example.domain} (${example.description})`}
|
||||
use:tooltip={example.tooltip}
|
||||
>
|
||||
<h5>{example.domain}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -223,17 +254,17 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>DMARC Policy Check</h3>
|
||||
<h3>{$t('diagnostics/dns-dmarc-check.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-group">
|
||||
<label for="domain" use:tooltip={'Enter the domain to check DMARC policy for'}>
|
||||
Domain Name
|
||||
<label for="domain" use:tooltip={$t('diagnostics/dns-dmarc-check.form.domainTooltip')}>
|
||||
{$t('diagnostics/dns-dmarc-check.form.domainLabel')}
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domain}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/dns-dmarc-check.form.domainPlaceholder')}
|
||||
onchange={() => {
|
||||
clearExampleSelection();
|
||||
if (domain) checkDMARC();
|
||||
@@ -246,10 +277,10 @@
|
||||
<button class="check-btn lookup-btn" onclick={checkDMARC} disabled={loading || !domain.trim()}>
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Checking DMARC...
|
||||
{$t('diagnostics/dns-dmarc-check.form.checking')}
|
||||
{:else}
|
||||
<Icon name="shield-check" size="sm" />
|
||||
Check DMARC Policy
|
||||
{$t('diagnostics/dns-dmarc-check.form.checkButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -260,10 +291,12 @@
|
||||
{#if results && results.hasRecord}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>DMARC Policy Analysis</h3>
|
||||
<h3>{$t('diagnostics/dns-dmarc-check.results.title')}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={copiedState}>
|
||||
<Icon name={copiedState ? 'check' : 'copy'} size="xs" />
|
||||
{copiedState ? 'Copied!' : 'Copy Results'}
|
||||
{copiedState
|
||||
? $t('diagnostics/dns-dmarc-check.results.copied')
|
||||
: $t('diagnostics/dns-dmarc-check.results.copy')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
@@ -290,18 +323,21 @@
|
||||
<div>
|
||||
<h4>
|
||||
{#if issues.length === 0}
|
||||
DMARC Configuration Secure
|
||||
{$t('diagnostics/dns-dmarc-check.results.status.secure')}
|
||||
{:else if issues.some((i) => i.severity === 'high')}
|
||||
DMARC Issues Found
|
||||
{$t('diagnostics/dns-dmarc-check.results.status.issuesFound')}
|
||||
{:else}
|
||||
DMARC Needs Improvement
|
||||
{$t('diagnostics/dns-dmarc-check.results.status.needsImprovement')}
|
||||
{/if}
|
||||
</h4>
|
||||
<p>
|
||||
{#if issues.length === 0}
|
||||
No critical issues detected
|
||||
{$t('diagnostics/dns-dmarc-check.results.status.noCriticalIssues')}
|
||||
{:else}
|
||||
{issues.length} issue{issues.length > 1 ? 's' : ''} identified
|
||||
{$t('diagnostics/dns-dmarc-check.results.status.issuesIdentified', {
|
||||
count: issues.length,
|
||||
plural: issues.length > 1 ? 's' : '',
|
||||
})}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
@@ -311,9 +347,11 @@
|
||||
<!-- Original Record -->
|
||||
{#if results.record}
|
||||
<div class="record-section">
|
||||
<h4>DMARC Record</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.results.recordSection.title')}</h4>
|
||||
<div class="record-display">
|
||||
<div class="record-location">_dmarc.{domain}</div>
|
||||
<div class="record-location">
|
||||
{$t('diagnostics/dns-dmarc-check.results.recordSection.location', { domain })}
|
||||
</div>
|
||||
<code>{results.record}</code>
|
||||
</div>
|
||||
</div>
|
||||
@@ -321,25 +359,25 @@
|
||||
|
||||
<!-- Parsed Policy -->
|
||||
<div class="policy-section">
|
||||
<h4>Policy Configuration</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.title')}</h4>
|
||||
<div class="policy-grid">
|
||||
<!-- Main Policy -->
|
||||
<div class="policy-item">
|
||||
<div class="policy-header">
|
||||
<Icon name="shield" size="sm" />
|
||||
<span>Main Policy</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.mainPolicy')}</span>
|
||||
</div>
|
||||
<div class="policy-value {getPolicyColor(parsed.policy)}">
|
||||
<span class="policy-text">{parsed.policy}</span>
|
||||
<span class="policy-description">
|
||||
{#if parsed.policy === 'reject'}
|
||||
Reject non-compliant messages
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.policies.reject')}
|
||||
{:else if parsed.policy === 'quarantine'}
|
||||
Quarantine suspicious messages
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.policies.quarantine')}
|
||||
{:else if parsed.policy === 'none'}
|
||||
Monitor only, no action
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.policies.none')}
|
||||
{:else}
|
||||
Unknown policy
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.policies.unknown')}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
@@ -350,7 +388,7 @@
|
||||
<div class="policy-item">
|
||||
<div class="policy-header">
|
||||
<Icon name="git-branch" size="sm" />
|
||||
<span>Subdomain Policy</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.subdomainPolicy')}</span>
|
||||
</div>
|
||||
<div class="policy-value {getPolicyColor(parsed.subdomainPolicy)}">
|
||||
<span class="policy-text">{parsed.subdomainPolicy}</span>
|
||||
@@ -362,11 +400,13 @@
|
||||
<div class="policy-item">
|
||||
<div class="policy-header">
|
||||
<Icon name="percent" size="sm" />
|
||||
<span>Coverage</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.coverage')}</span>
|
||||
</div>
|
||||
<div class="policy-value {parseInt(parsed.percentage) === 100 ? 'success' : 'warning'}">
|
||||
<span class="policy-text">{parsed.percentage}%</span>
|
||||
<span class="policy-description">of messages affected</span>
|
||||
<span class="policy-description"
|
||||
>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.coverageDescription')}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -374,12 +414,18 @@
|
||||
<div class="policy-item">
|
||||
<div class="policy-header">
|
||||
<Icon name="key" size="sm" />
|
||||
<span>DKIM Alignment</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.dkimAlignment')}</span>
|
||||
</div>
|
||||
<div class="policy-value {getAlignmentColor(parsed.alignment.dkim)}">
|
||||
<span class="policy-text">{parsed.alignment.dkim === 's' ? 'Strict' : 'Relaxed'}</span>
|
||||
<span class="policy-text">
|
||||
{parsed.alignment.dkim === 's'
|
||||
? $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.strict')
|
||||
: $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.relaxed')}
|
||||
</span>
|
||||
<span class="policy-description">
|
||||
{parsed.alignment.dkim === 's' ? 'Exact domain match' : 'Organizational domain match'}
|
||||
{parsed.alignment.dkim === 's'
|
||||
? $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.strictDescription')
|
||||
: $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.relaxedDescription')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -388,12 +434,18 @@
|
||||
<div class="policy-item">
|
||||
<div class="policy-header">
|
||||
<Icon name="mail" size="sm" />
|
||||
<span>SPF Alignment</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.spfAlignment')}</span>
|
||||
</div>
|
||||
<div class="policy-value {getAlignmentColor(parsed.alignment.spf)}">
|
||||
<span class="policy-text">{parsed.alignment.spf === 's' ? 'Strict' : 'Relaxed'}</span>
|
||||
<span class="policy-text">
|
||||
{parsed.alignment.spf === 's'
|
||||
? $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.strict')
|
||||
: $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.relaxed')}
|
||||
</span>
|
||||
<span class="policy-description">
|
||||
{parsed.alignment.spf === 's' ? 'Exact domain match' : 'Organizational domain match'}
|
||||
{parsed.alignment.spf === 's'
|
||||
? $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.strictDescription')
|
||||
: $t('diagnostics/dns-dmarc-check.results.policyConfiguration.alignment.relaxedDescription')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -402,21 +454,21 @@
|
||||
<div class="policy-item">
|
||||
<div class="policy-header">
|
||||
<Icon name="settings" size="sm" />
|
||||
<span>Failure Options</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.failureOptions')}</span>
|
||||
</div>
|
||||
<div class="policy-value secondary">
|
||||
<span class="policy-text">{parsed.reporting.failureOptions}</span>
|
||||
<span class="policy-description">
|
||||
{#if parsed.reporting.failureOptions === '0'}
|
||||
DKIM and SPF failure
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.failureOptionsDescriptions.both')}
|
||||
{:else if parsed.reporting.failureOptions === '1'}
|
||||
Any alignment failure
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.failureOptionsDescriptions.any')}
|
||||
{:else if parsed.reporting.failureOptions === 'd'}
|
||||
DKIM failure only
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.failureOptionsDescriptions.dkim')}
|
||||
{:else if parsed.reporting.failureOptions === 's'}
|
||||
SPF failure only
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.failureOptionsDescriptions.spf')}
|
||||
{:else}
|
||||
Custom configuration
|
||||
{$t('diagnostics/dns-dmarc-check.results.policyConfiguration.failureOptionsDescriptions.custom')}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
@@ -426,18 +478,20 @@
|
||||
|
||||
<!-- Reporting Configuration -->
|
||||
<div class="reporting-section">
|
||||
<h4>Reporting Configuration</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.results.reporting.title')}</h4>
|
||||
<div class="reporting-grid">
|
||||
<div class="reporting-item">
|
||||
<div class="reporting-header">
|
||||
<Icon name="bar-chart" size="sm" />
|
||||
<span>Aggregate Reports (RUA)</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.reporting.aggregateReports')}</span>
|
||||
</div>
|
||||
<div class="reporting-value">
|
||||
{#if parsed.reporting.aggregate}
|
||||
<span class="email-address">{parsed.reporting.aggregate}</span>
|
||||
{:else}
|
||||
<span class="not-configured">Not configured</span>
|
||||
<span class="not-configured"
|
||||
>{$t('diagnostics/dns-dmarc-check.results.reporting.notConfigured')}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -445,13 +499,15 @@
|
||||
<div class="reporting-item">
|
||||
<div class="reporting-header">
|
||||
<Icon name="search" size="sm" />
|
||||
<span>Forensic Reports (RUF)</span>
|
||||
<span>{$t('diagnostics/dns-dmarc-check.results.reporting.forensicReports')}</span>
|
||||
</div>
|
||||
<div class="reporting-value">
|
||||
{#if parsed.reporting.forensic}
|
||||
<span class="email-address">{parsed.reporting.forensic}</span>
|
||||
{:else}
|
||||
<span class="not-configured">Not configured</span>
|
||||
<span class="not-configured"
|
||||
>{$t('diagnostics/dns-dmarc-check.results.reporting.notConfigured')}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -461,7 +517,7 @@
|
||||
<!-- Issues -->
|
||||
{#if issues.length > 0}
|
||||
<div class="issues-section">
|
||||
<h4>Issues & Recommendations</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.results.issues.title')}</h4>
|
||||
<div class="issues-list">
|
||||
{#each issues as issue, index (index)}
|
||||
<div class="issue-item {getSeverityColor(issue.severity)}">
|
||||
@@ -494,13 +550,12 @@
|
||||
<div class="warning-content">
|
||||
<Icon name="info" size="md" />
|
||||
<div>
|
||||
<strong>No DMARC Record Found</strong>
|
||||
<strong>{$t('diagnostics/dns-dmarc-check.noRecord.title')}</strong>
|
||||
<p>
|
||||
Domain <code>{domain}</code> does not have a DMARC policy configured at <code>{results.domain}</code>.
|
||||
{$t('diagnostics/dns-dmarc-check.noRecord.message', { domain, dmarcDomain: results.domain })}
|
||||
</p>
|
||||
<p class="help-text">
|
||||
This means the domain is not protected by DMARC. Consider implementing a DMARC policy to prevent email
|
||||
spoofing.
|
||||
{$t('diagnostics/dns-dmarc-check.noRecord.helpText')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -514,7 +569,7 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>DMARC Check Failed</strong>
|
||||
<strong>{$t('diagnostics/dns-dmarc-check.error.title')}</strong>
|
||||
<p>{error || results.error}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -525,53 +580,64 @@
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>Understanding DMARC</h3>
|
||||
<h3>{$t('diagnostics/dns-dmarc-check.educational.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>DMARC Policies</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.educational.policies.title')}</h4>
|
||||
<div class="policy-explanations">
|
||||
<div class="explanation-item">
|
||||
<strong>none:</strong> Monitor mode - collect data but take no action on failures
|
||||
<strong>none:</strong>
|
||||
{$t('diagnostics/dns-dmarc-check.educational.policies.none')}
|
||||
</div>
|
||||
<div class="explanation-item">
|
||||
<strong>quarantine:</strong> Mark suspicious messages, often sent to spam folder
|
||||
<strong>quarantine:</strong>
|
||||
{$t('diagnostics/dns-dmarc-check.educational.policies.quarantine')}
|
||||
</div>
|
||||
<div class="explanation-item">
|
||||
<strong>reject:</strong> Reject non-compliant messages outright (strongest security)
|
||||
<strong>reject:</strong>
|
||||
{$t('diagnostics/dns-dmarc-check.educational.policies.reject')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Alignment Modes</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.educational.alignmentModes.title')}</h4>
|
||||
<div class="alignment-explanations">
|
||||
<div class="explanation-item">
|
||||
<strong>Relaxed (r):</strong> Allows organizational domain matching (default)
|
||||
<strong>Relaxed (r):</strong>
|
||||
{$t('diagnostics/dns-dmarc-check.educational.alignmentModes.relaxed')}
|
||||
</div>
|
||||
<div class="explanation-item">
|
||||
<strong>Strict (s):</strong> Requires exact domain matching (more secure)
|
||||
<strong>Strict (s):</strong>
|
||||
{$t('diagnostics/dns-dmarc-check.educational.alignmentModes.strict')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Reporting Types</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.educational.reportingTypes.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>Aggregate (RUA):</strong> Daily summary reports of DMARC activity</li>
|
||||
<li><strong>Forensic (RUF):</strong> Real-time failure reports with message samples</li>
|
||||
<li>
|
||||
<strong>Aggregate (RUA):</strong>
|
||||
{$t('diagnostics/dns-dmarc-check.educational.reportingTypes.aggregate')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Forensic (RUF):</strong>
|
||||
{$t('diagnostics/dns-dmarc-check.educational.reportingTypes.forensic')}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Best Practices</h4>
|
||||
<h4>{$t('diagnostics/dns-dmarc-check.educational.bestPractices.title')}</h4>
|
||||
<ul>
|
||||
<li>Start with <code>p=none</code> to monitor before enforcement</li>
|
||||
<li>Gradually increase to <code>p=quarantine</code> then <code>p=reject</code></li>
|
||||
<li>Set up aggregate reporting to monitor DMARC activity</li>
|
||||
<li>Use strict alignment for enhanced security when possible</li>
|
||||
<li>Consider subdomain policy for comprehensive coverage</li>
|
||||
<li>{$t('diagnostics/dns-dmarc-check.educational.bestPractices.items.startMonitoring')}</li>
|
||||
<li>{$t('diagnostics/dns-dmarc-check.educational.bestPractices.items.gradualEnforcement')}</li>
|
||||
<li>{$t('diagnostics/dns-dmarc-check.educational.bestPractices.items.setupReporting')}</li>
|
||||
<li>{$t('diagnostics/dns-dmarc-check.educational.bestPractices.items.strictAlignment')}</li>
|
||||
<li>{$t('diagnostics/dns-dmarc-check.educational.bestPractices.items.subdomainPolicy')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domain = $state('');
|
||||
@@ -9,14 +10,32 @@
|
||||
let error = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ domain: 'gov.uk', description: 'UK Government (DNSSEC Enabled)' },
|
||||
{ domain: 'cloudflare.com', description: 'Cloudflare (DNSSEC Enabled)' },
|
||||
{ domain: 'dnssec-failed.org', description: 'DNSSEC Failed Test' },
|
||||
{ domain: 'google.com', description: 'Google (DNSSEC Enabled)' },
|
||||
{ domain: 'isc.org', description: 'ISC (DNSSEC Pioneer)' },
|
||||
{ domain: 'ietf.org', description: 'IETF (DNSSEC Enabled)' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/dns-dnssec-validation-chain.examples.items.govuk.domain'),
|
||||
description: $t('diagnostics/dns-dnssec-validation-chain.examples.items.govuk.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dnssec-validation-chain.examples.items.cloudflare.domain'),
|
||||
description: $t('diagnostics/dns-dnssec-validation-chain.examples.items.cloudflare.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dnssec-validation-chain.examples.items.failed.domain'),
|
||||
description: $t('diagnostics/dns-dnssec-validation-chain.examples.items.failed.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dnssec-validation-chain.examples.items.google.domain'),
|
||||
description: $t('diagnostics/dns-dnssec-validation-chain.examples.items.google.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dnssec-validation-chain.examples.items.isc.domain'),
|
||||
description: $t('diagnostics/dns-dnssec-validation-chain.examples.items.isc.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-dnssec-validation-chain.examples.items.ietf.domain'),
|
||||
description: $t('diagnostics/dns-dnssec-validation-chain.examples.items.ietf.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
const isInputValid = $derived(() => {
|
||||
const trimmed = domain.trim();
|
||||
@@ -29,7 +48,7 @@
|
||||
|
||||
async function validateChain() {
|
||||
if (!isInputValid) {
|
||||
error = 'Please enter a valid domain name';
|
||||
error = $t('diagnostics/dns-dnssec-validation-chain.error.invalidDomain');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -47,12 +66,12 @@
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.message || 'DNSSEC validation failed');
|
||||
throw new Error(data.message || $t('diagnostics/dns-dnssec-validation-chain.error.validationFailed'));
|
||||
}
|
||||
|
||||
results = data;
|
||||
} catch (err) {
|
||||
error = err instanceof Error ? err.message : 'An unexpected error occurred';
|
||||
error = err instanceof Error ? err.message : $t('diagnostics/dns-dnssec-validation-chain.error.unexpectedError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -95,8 +114,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>DNSSEC Validation Chain Checker</h1>
|
||||
<p>Validate DNSSEC chain from root to domain, verify DS/DNSKEY matching and RRSIG signatures</p>
|
||||
<h1>{$t('diagnostics/dns-dnssec-validation-chain.title')}</h1>
|
||||
<p>{$t('diagnostics/dns-dnssec-validation-chain.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -104,7 +123,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
<h4>{$t('diagnostics/dns-dnssec-validation-chain.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -112,7 +131,9 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Check DNSSEC for ${example.domain}`}
|
||||
use:tooltip={$t(
|
||||
`diagnostics/dns-dnssec-validation-chain.examples.items.${['govuk', 'cloudflare', 'failed', 'google', 'isc', 'ietf'][i]}.tooltip`,
|
||||
)}
|
||||
>
|
||||
<h5>{example.description}</h5>
|
||||
<p>{example.domain}</p>
|
||||
@@ -125,7 +146,7 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>Domain Name</h3>
|
||||
<h3>{$t('diagnostics/dns-dnssec-validation-chain.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<form
|
||||
@@ -136,12 +157,12 @@
|
||||
}}
|
||||
>
|
||||
<div class="form-group flex-grow">
|
||||
<label for="domain">Domain to Validate</label>
|
||||
<label for="domain">{$t('diagnostics/dns-dnssec-validation-chain.form.domainLabel')}</label>
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domain}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/dns-dnssec-validation-chain.form.domainPlaceholder')}
|
||||
disabled={loading}
|
||||
onchange={() => clearExampleSelection()}
|
||||
/>
|
||||
@@ -150,10 +171,10 @@
|
||||
<button type="submit" disabled={loading || !isInputValid} class="primary submit-btn">
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Validating...
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.form.validating')}
|
||||
{:else}
|
||||
<Icon name="shield" size="sm" />
|
||||
Validate DNSSEC Chain
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.form.validateButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</form>
|
||||
@@ -166,7 +187,7 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>Validation Failed</strong>
|
||||
<strong>{$t('diagnostics/dns-dnssec-validation-chain.error.title')}</strong>
|
||||
<p>{error}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -180,8 +201,8 @@
|
||||
<div class="loading-state">
|
||||
<Icon name="loader" size="lg" animate="spin" />
|
||||
<div class="loading-text">
|
||||
<h3>Validating DNSSEC Chain</h3>
|
||||
<p>Querying DNS records from root to {domain}...</p>
|
||||
<h3>{$t('diagnostics/dns-dnssec-validation-chain.loading.title')}</h3>
|
||||
<p>{$t('diagnostics/dns-dnssec-validation-chain.loading.message', { domain })}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -191,7 +212,7 @@
|
||||
{#if results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header">
|
||||
<h3>DNSSEC Validation Results</h3>
|
||||
<h3>{$t('diagnostics/dns-dnssec-validation-chain.results.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<!-- Summary -->
|
||||
@@ -200,38 +221,43 @@
|
||||
<h3>
|
||||
{#if results.valid}
|
||||
<Icon name="check-circle" size="sm" />
|
||||
DNSSEC Valid
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.results.summary.valid')}
|
||||
{:else}
|
||||
<Icon name="x-circle" size="sm" />
|
||||
DNSSEC Invalid
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.results.summary.invalid')}
|
||||
{/if}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Domain:</span>
|
||||
<span class="info-label">{$t('diagnostics/dns-dnssec-validation-chain.results.summary.domain')}</span>
|
||||
<span class="info-value">{results.domain}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">Chain Links:</span>
|
||||
<span class="info-label"
|
||||
>{$t('diagnostics/dns-dnssec-validation-chain.results.summary.chainLinks')}</span
|
||||
>
|
||||
<span class="info-value">{results.summary.totalLinks}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">Validated:</span>
|
||||
<span class="info-label">{$t('diagnostics/dns-dnssec-validation-chain.results.summary.validated')}</span
|
||||
>
|
||||
<span class="info-value">{results.summary.validatedLinks}/{results.summary.totalLinks}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">Status:</span>
|
||||
<span class="info-label">{$t('diagnostics/dns-dnssec-validation-chain.results.summary.status')}</span>
|
||||
<span class="info-value" class:success={results.valid} class:error={!results.valid}>
|
||||
{results.valid ? 'Secure' : 'Broken Chain'}
|
||||
{results.valid
|
||||
? $t('diagnostics/dns-dnssec-validation-chain.results.summary.secure')
|
||||
: $t('diagnostics/dns-dnssec-validation-chain.results.summary.brokenChain')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if results.summary.errors.length > 0}
|
||||
<div class="errors-section">
|
||||
<h4>Validation Errors:</h4>
|
||||
<h4>{$t('diagnostics/dns-dnssec-validation-chain.results.summary.errors')}</h4>
|
||||
<ul>
|
||||
{#each results.summary.errors as err, i (i)}
|
||||
<li>{err}</li>
|
||||
@@ -245,7 +271,7 @@
|
||||
<!-- Chain Links -->
|
||||
<div class="chain-section">
|
||||
<div class="card-header">
|
||||
<h3>DNSSEC Chain</h3>
|
||||
<h3>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="chain-visualization">
|
||||
@@ -260,7 +286,11 @@
|
||||
{/if}
|
||||
<h4>
|
||||
{link.name}
|
||||
<span class="level">Level {link.level}</span>
|
||||
<span class="level"
|
||||
>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.level', {
|
||||
level: link.level,
|
||||
})}</span
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
@@ -269,32 +299,45 @@
|
||||
<!-- DS Records -->
|
||||
{#if link.ds && link.ds.length > 0}
|
||||
<div class="record-section">
|
||||
<h5 use:tooltip={'Delegation Signer records link this zone to the parent zone'}>
|
||||
<h5 use:tooltip={$t('diagnostics/dns-dnssec-validation-chain.results.chain.ds.tooltip')}>
|
||||
<Icon name="key" size="xs" />
|
||||
DS Records
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.results.chain.ds.title')}
|
||||
</h5>
|
||||
{#each link.ds as ds, j (j)}
|
||||
<div class="record-item">
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Identifier for the DNSKEY this DS record refers to'}
|
||||
>Key Tag:</span
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.ds.keyTagTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.ds.keyTag')}</span
|
||||
>
|
||||
<code>{ds.keyTag}</code>
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Cryptographic algorithm used for signing'}
|
||||
>Algorithm:</span
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.ds.algorithmTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.ds.algorithm')}</span
|
||||
>
|
||||
<code>{getAlgorithmName(ds.algorithm)}</code>
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Hash algorithm used to create the digest'}
|
||||
>Digest Type:</span
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.ds.digestTypeTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.ds.digestType')}</span
|
||||
>
|
||||
<code>{getDigestTypeName(ds.digestType)}</code>
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Hash of the DNSKEY record'}>Hash:</span>
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t('diagnostics/dns-dnssec-validation-chain.results.chain.ds.hashTooltip')}
|
||||
>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.ds.hash')}</span
|
||||
>
|
||||
<code class="hash">{ds.digest.substring(0, 40)}...</code>
|
||||
</div>
|
||||
</div>
|
||||
@@ -305,36 +348,61 @@
|
||||
<!-- DNSKEY Records -->
|
||||
{#if link.dnskey && link.dnskey.length > 0}
|
||||
<div class="record-section">
|
||||
<h5 use:tooltip={'Public keys used to verify DNSSEC signatures'}>
|
||||
<h5 use:tooltip={$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.tooltip')}>
|
||||
<Icon name="lock" size="xs" />
|
||||
DNSKEY Records
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.title')}
|
||||
</h5>
|
||||
{#each link.dnskey as key, j (j)}
|
||||
<div class="record-item" class:matched={key.matched}>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Identifier for this DNSKEY'}>Key Tag:</span>
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.keyTagTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.keyTag')}</span
|
||||
>
|
||||
<code>{key.keyTag}</code>
|
||||
{#if key.matched}
|
||||
<span
|
||||
class="badge success"
|
||||
use:tooltip={'This DNSKEY matches a DS record in the parent zone'}>Matched DS</span
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.matchedDSTooltip',
|
||||
)}
|
||||
>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.matchedDS')}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Key properties: 256=ZSK, 257=KSK'}>Flags:</span>
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.flagsTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.flags')}</span
|
||||
>
|
||||
<code>{key.flags}</code>
|
||||
{#if key.isKSK}
|
||||
<span class="badge info" use:tooltip={'Key Signing Key - signs other DNSKEYs'}>KSK</span
|
||||
<span
|
||||
class="badge info"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.kskTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.ksk')}</span
|
||||
>
|
||||
{/if}
|
||||
{#if key.isZSK}
|
||||
<span class="badge info" use:tooltip={'Zone Signing Key - signs zone data'}>ZSK</span>
|
||||
<span
|
||||
class="badge info"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.zskTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.zsk')}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Cryptographic algorithm used for signing'}
|
||||
>Algorithm:</span
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.algorithmTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.dnskey.algorithm')}</span
|
||||
>
|
||||
<code>{getAlgorithmName(key.algorithm)}</code>
|
||||
</div>
|
||||
@@ -346,35 +414,52 @@
|
||||
<!-- RRSIG Records -->
|
||||
{#if link.rrsig && link.rrsig.length > 0}
|
||||
<div class="record-section">
|
||||
<h5 use:tooltip={'Digital signatures created with DNSKEY to authenticate DNS data'}>
|
||||
<h5 use:tooltip={$t('diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.tooltip')}>
|
||||
<Icon name="signature" size="xs" />
|
||||
RRSIG Records
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.title')}
|
||||
</h5>
|
||||
{#each link.rrsig as sig, j (j)}
|
||||
<div class="record-item" class:valid={sig.valid} class:invalid={!sig.valid}>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'DNS record type this signature covers'}
|
||||
>Type Covered:</span
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.typeCoveredTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.typeCovered')}</span
|
||||
>
|
||||
<code>{sig.typeCovered}</code>
|
||||
{#if sig.valid}
|
||||
<span class="badge success" use:tooltip={'Signature is valid and within time window'}
|
||||
>Valid</span
|
||||
<span
|
||||
class="badge success"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.validTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.valid')}</span
|
||||
>
|
||||
{:else}
|
||||
<span class="badge error" use:tooltip={'Signature is expired or not yet valid'}
|
||||
>Invalid</span
|
||||
<span
|
||||
class="badge error"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.invalidTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.invalid')}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Identifies which DNSKEY created this signature'}
|
||||
>Key Tag:</span
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.keyTagTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.keyTag')}</span
|
||||
>
|
||||
<code>{sig.keyTag}</code>
|
||||
</div>
|
||||
<div class="record-details">
|
||||
<span class="label" use:tooltip={'Zone that created this signature'}>Signer:</span>
|
||||
<span
|
||||
class="label"
|
||||
use:tooltip={$t(
|
||||
'diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.signerTooltip',
|
||||
)}>{$t('diagnostics/dns-dnssec-validation-chain.results.chain.rrsig.signer')}</span
|
||||
>
|
||||
<code>{sig.signerName}</code>
|
||||
</div>
|
||||
</div>
|
||||
@@ -387,7 +472,7 @@
|
||||
<div class="record-section errors">
|
||||
<h5>
|
||||
<Icon name="alert-triangle" size="xs" />
|
||||
Errors
|
||||
{$t('diagnostics/dns-dnssec-validation-chain.results.chain.errors.title')}
|
||||
</h5>
|
||||
<ul>
|
||||
{#each link.errors as err, j (j)}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import ResultsCard from '$lib/components/common/ResultsCard.svelte';
|
||||
import ErrorCard from '$lib/components/common/ErrorCard.svelte';
|
||||
import WarningCard from '$lib/components/common/WarningCard.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domainName = $state('example.com');
|
||||
@@ -25,34 +26,104 @@
|
||||
return validationResult.isValid;
|
||||
});
|
||||
|
||||
const recordTypes = [
|
||||
{ value: 'A', label: 'A', description: 'IPv4 address records' },
|
||||
{ value: 'AAAA', label: 'AAAA', description: 'IPv6 address records' },
|
||||
{ value: 'CNAME', label: 'CNAME', description: 'Canonical name records' },
|
||||
{ value: 'MX', label: 'MX', description: 'Mail exchange records' },
|
||||
{ value: 'TXT', label: 'TXT', description: 'Text records' },
|
||||
{ value: 'NS', label: 'NS', description: 'Name server records' },
|
||||
{ value: 'SOA', label: 'SOA', description: 'Start of authority records' },
|
||||
{ value: 'CAA', label: 'CAA', description: 'Certificate authority authorization' },
|
||||
{ value: 'PTR', label: 'PTR', description: 'Pointer records' },
|
||||
{ value: 'SRV', label: 'SRV', description: 'Service records' },
|
||||
];
|
||||
const recordTypes = $derived([
|
||||
{
|
||||
value: 'A',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.A.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.A.description'),
|
||||
},
|
||||
{
|
||||
value: 'AAAA',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.AAAA.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.AAAA.description'),
|
||||
},
|
||||
{
|
||||
value: 'CNAME',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.CNAME.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.CNAME.description'),
|
||||
},
|
||||
{
|
||||
value: 'MX',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.MX.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.MX.description'),
|
||||
},
|
||||
{
|
||||
value: 'TXT',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.TXT.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.TXT.description'),
|
||||
},
|
||||
{
|
||||
value: 'NS',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.NS.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.NS.description'),
|
||||
},
|
||||
{
|
||||
value: 'SOA',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.SOA.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.SOA.description'),
|
||||
},
|
||||
{
|
||||
value: 'CAA',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.CAA.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.CAA.description'),
|
||||
},
|
||||
{
|
||||
value: 'PTR',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.PTR.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.PTR.description'),
|
||||
},
|
||||
{
|
||||
value: 'SRV',
|
||||
label: $t('diagnostics/dns-lookup.recordTypes.SRV.label'),
|
||||
description: $t('diagnostics/dns-lookup.recordTypes.SRV.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
const resolvers = [
|
||||
{ value: 'cloudflare', label: 'Cloudflare (1.1.1.1)' },
|
||||
{ value: 'google', label: 'Google (8.8.8.8)' },
|
||||
{ value: 'quad9', label: 'Quad9 (9.9.9.9)' },
|
||||
{ value: 'opendns', label: 'OpenDNS (208.67.222.222)' },
|
||||
];
|
||||
const resolvers = $derived([
|
||||
{ value: 'cloudflare', label: $t('diagnostics/dns-lookup.resolvers.cloudflare') },
|
||||
{ value: 'google', label: $t('diagnostics/dns-lookup.resolvers.google') },
|
||||
{ value: 'quad9', label: $t('diagnostics/dns-lookup.resolvers.quad9') },
|
||||
{ value: 'opendns', label: $t('diagnostics/dns-lookup.resolvers.opendns') },
|
||||
]);
|
||||
|
||||
const examplesList = [
|
||||
{ domain: 'example.com', type: 'A', description: 'Basic A record lookup' },
|
||||
{ domain: 'google.com', type: 'MX', description: 'Mail server records' },
|
||||
{ domain: 'cloudflare.com', type: 'AAAA', description: 'IPv6 addresses' },
|
||||
{ domain: '_dmarc.github.com', type: 'TXT', description: 'DMARC policy record' },
|
||||
{ domain: 'microsoft.com', type: 'TXT', description: 'Multiple TXT records (SPF, verification)' },
|
||||
{ domain: 'netflix.com', type: 'NS', description: 'Name server records' },
|
||||
];
|
||||
const examplesList = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/dns-lookup.examples.items.exampleA.domain'),
|
||||
type: $t('diagnostics/dns-lookup.examples.items.exampleA.type'),
|
||||
description: $t('diagnostics/dns-lookup.examples.items.exampleA.description'),
|
||||
tooltip: $t('diagnostics/dns-lookup.examples.items.exampleA.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-lookup.examples.items.googleMX.domain'),
|
||||
type: $t('diagnostics/dns-lookup.examples.items.googleMX.type'),
|
||||
description: $t('diagnostics/dns-lookup.examples.items.googleMX.description'),
|
||||
tooltip: $t('diagnostics/dns-lookup.examples.items.googleMX.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-lookup.examples.items.cloudflareAAAA.domain'),
|
||||
type: $t('diagnostics/dns-lookup.examples.items.cloudflareAAAA.type'),
|
||||
description: $t('diagnostics/dns-lookup.examples.items.cloudflareAAAA.description'),
|
||||
tooltip: $t('diagnostics/dns-lookup.examples.items.cloudflareAAAA.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-lookup.examples.items.githubDMARC.domain'),
|
||||
type: $t('diagnostics/dns-lookup.examples.items.githubDMARC.type'),
|
||||
description: $t('diagnostics/dns-lookup.examples.items.githubDMARC.description'),
|
||||
tooltip: $t('diagnostics/dns-lookup.examples.items.githubDMARC.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-lookup.examples.items.microsoftTXT.domain'),
|
||||
type: $t('diagnostics/dns-lookup.examples.items.microsoftTXT.type'),
|
||||
description: $t('diagnostics/dns-lookup.examples.items.microsoftTXT.description'),
|
||||
tooltip: $t('diagnostics/dns-lookup.examples.items.microsoftTXT.tooltip'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-lookup.examples.items.netflixNS.domain'),
|
||||
type: $t('diagnostics/dns-lookup.examples.items.netflixNS.type'),
|
||||
description: $t('diagnostics/dns-lookup.examples.items.netflixNS.description'),
|
||||
tooltip: $t('diagnostics/dns-lookup.examples.items.netflixNS.tooltip'),
|
||||
},
|
||||
]);
|
||||
|
||||
const examples = useExamples(examplesList);
|
||||
|
||||
@@ -62,7 +133,7 @@
|
||||
// Client-side validation
|
||||
const validation = validateDNSLookupInput(domainName, useCustomResolver, customResolver);
|
||||
if (!validation.isValid) {
|
||||
diagnosticState.setError(validation.error || 'Invalid input');
|
||||
diagnosticState.setError(validation.error || $t('diagnostics/dns-lookup.error.invalidInput'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -121,12 +192,12 @@
|
||||
|
||||
// Fallback to status-based messages
|
||||
if (response.status === 400) {
|
||||
throw new Error('Invalid request. Please check your input values.');
|
||||
throw new Error($t('diagnostics/dns-lookup.error.invalidRequest'));
|
||||
} else if (response.status === 500 || response.status === 403) {
|
||||
throw new Error('DNS lookup service temporarily unavailable. Please try again.');
|
||||
throw new Error($t('diagnostics/dns-lookup.error.serviceUnavailable'));
|
||||
}
|
||||
|
||||
throw new Error(`Lookup failed (${response.status})`);
|
||||
throw new Error($t('diagnostics/dns-lookup.error.lookupFailed', { status: response.status }));
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
@@ -153,11 +224,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>DNS Lookup Tool</h1>
|
||||
<p>
|
||||
Resolve DNS records for any domain using various public resolvers or custom DNS servers. Supports all common
|
||||
record types with detailed response information.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/dns-lookup.title')}</h1>
|
||||
<p>{$t('diagnostics/dns-lookup.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -165,26 +233,28 @@
|
||||
examples={examplesList}
|
||||
selectedIndex={examples.selectedIndex}
|
||||
onSelect={loadExample}
|
||||
getLabel={(ex) => `${ex.domain} (${ex.type})`}
|
||||
getDescription={(ex) => ex.description}
|
||||
getTooltip={(ex) => `Query ${ex.type} records for ${ex.domain}`}
|
||||
getLabel={(ex: { domain: string; type: string }) => `${ex.domain} (${ex.type})`}
|
||||
getDescription={(ex: { description: string }) => ex.description}
|
||||
getTooltip={(ex: { tooltip: string }) => ex.tooltip}
|
||||
/>
|
||||
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>Lookup Configuration</h3>
|
||||
<h3>{$t('diagnostics/dns-lookup.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<!-- First Row: Domain Name -->
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="domain" use:tooltip={'Enter the domain name to query'}> Domain Name </label>
|
||||
<label for="domain" use:tooltip={$t('diagnostics/dns-lookup.form.domainTooltip')}>
|
||||
{$t('diagnostics/dns-lookup.form.domainLabel')}
|
||||
</label>
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domainName}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/dns-lookup.form.domainPlaceholder')}
|
||||
onchange={() => {
|
||||
examples.clear();
|
||||
if (domainName) performLookup();
|
||||
@@ -196,7 +266,9 @@
|
||||
<!-- Second Row: Record Type and DNS Resolver -->
|
||||
<div class="form-row two-columns">
|
||||
<div class="form-group">
|
||||
<label for="type" use:tooltip={'Select the DNS record type to query'}> Record Type </label>
|
||||
<label for="type" use:tooltip={$t('diagnostics/dns-lookup.form.recordTypeTooltip')}>
|
||||
{$t('diagnostics/dns-lookup.form.recordTypeLabel')}
|
||||
</label>
|
||||
<select
|
||||
id="type"
|
||||
bind:value={recordType}
|
||||
@@ -212,7 +284,9 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="dns-resolver" use:tooltip={'Choose a DNS resolver to use for the query'}> DNS Resolver </label>
|
||||
<label for="dns-resolver" use:tooltip={$t('diagnostics/dns-lookup.form.dnsResolverTooltip')}>
|
||||
{$t('diagnostics/dns-lookup.form.dnsResolverLabel')}
|
||||
</label>
|
||||
{#if !useCustomResolver}
|
||||
<select
|
||||
id="dns-resolver"
|
||||
@@ -231,7 +305,7 @@
|
||||
<input
|
||||
type="text"
|
||||
bind:value={customResolver}
|
||||
placeholder="8.8.8.8 or custom IP"
|
||||
placeholder={$t('diagnostics/dns-lookup.form.customResolverPlaceholder')}
|
||||
onchange={() => {
|
||||
examples.clear();
|
||||
if (domainName) performLookup();
|
||||
@@ -247,7 +321,7 @@
|
||||
if (domainName) performLookup();
|
||||
}}
|
||||
/>
|
||||
Use custom resolver
|
||||
{$t('diagnostics/dns-lookup.form.useCustomResolver')}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -257,10 +331,10 @@
|
||||
loading={diagnosticState.loading}
|
||||
disabled={!validation.isValid}
|
||||
icon="search"
|
||||
loadingText="Performing Lookup..."
|
||||
loadingText={$t('diagnostics/dns-lookup.form.performing')}
|
||||
onclick={performLookup}
|
||||
>
|
||||
Lookup DNS Records
|
||||
{$t('diagnostics/dns-lookup.form.lookupButton')}
|
||||
</ActionButton>
|
||||
</div>
|
||||
</div>
|
||||
@@ -276,9 +350,11 @@
|
||||
<div class="warning-content">
|
||||
<Icon name="info" size="md" />
|
||||
<div>
|
||||
<strong>No Records Found</strong>
|
||||
<strong>{$t('diagnostics/dns-lookup.noRecords.title')}</strong>
|
||||
<p>{diagnosticState.results.message}</p>
|
||||
<p class="help-text">Using resolver: {diagnosticState.results.resolver}</p>
|
||||
<p class="help-text">
|
||||
{$t('diagnostics/dns-lookup.noRecords.usingResolver', { resolver: diagnosticState.results.resolver })}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -288,7 +364,7 @@
|
||||
<!-- Results -->
|
||||
{#if diagnosticState.results && !diagnosticState.results.noRecords}
|
||||
<ResultsCard
|
||||
title="DNS Records Found"
|
||||
title={$t('diagnostics/dns-lookup.results.title')}
|
||||
onCopy={copyResults}
|
||||
copied={clipboard.isCopied()}
|
||||
showCopyButton={diagnosticState.results.Answer?.length > 0}
|
||||
@@ -299,7 +375,7 @@
|
||||
<div class="record-item">
|
||||
<div class="record-data mono">{record.data}</div>
|
||||
{#if record.TTL}
|
||||
<div class="record-ttl" use:tooltip={'Time To Live - how long this record can be cached'}>
|
||||
<div class="record-ttl" use:tooltip={$t('diagnostics/dns-lookup.results.ttlTooltip')}>
|
||||
TTL: {record.TTL}s
|
||||
</div>
|
||||
{/if}
|
||||
@@ -310,14 +386,14 @@
|
||||
<div class="card warning-card no-records">
|
||||
<div class="warning-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<p>No records found for <code>{domainName}</code> ({recordType})</p>
|
||||
<p>{$t('diagnostics/dns-lookup.results.noRecordsMessage', { domain: domainName, type: recordType })}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</ResultsCard>
|
||||
{/if}
|
||||
|
||||
<ErrorCard title="Lookup Failed" error={diagnosticState.error} />
|
||||
<ErrorCard title={$t('diagnostics/dns-lookup.error.title')} error={diagnosticState.error} />
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domain = $state('google.com');
|
||||
@@ -10,14 +11,32 @@
|
||||
let copiedState = $state(false);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ domain: 'google.com', description: 'Google DNS infrastructure check' },
|
||||
{ domain: 'github.com', description: 'GitHub nameserver configuration' },
|
||||
{ domain: 'cloudflare.com', description: 'Cloudflare NS/SOA setup' },
|
||||
{ domain: 'stackoverflow.com', description: 'Stack Overflow DNS consistency' },
|
||||
{ domain: 'microsoft.com', description: 'Microsoft nameserver analysis' },
|
||||
{ domain: 'aws.amazon.com', description: 'AWS subdomain NS/SOA check' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/dns-ns-soa-check.examples.items.google.domain'),
|
||||
description: $t('diagnostics/dns-ns-soa-check.examples.items.google.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-ns-soa-check.examples.items.github.domain'),
|
||||
description: $t('diagnostics/dns-ns-soa-check.examples.items.github.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-ns-soa-check.examples.items.cloudflare.domain'),
|
||||
description: $t('diagnostics/dns-ns-soa-check.examples.items.cloudflare.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-ns-soa-check.examples.items.stackoverflow.domain'),
|
||||
description: $t('diagnostics/dns-ns-soa-check.examples.items.stackoverflow.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-ns-soa-check.examples.items.microsoft.domain'),
|
||||
description: $t('diagnostics/dns-ns-soa-check.examples.items.microsoft.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-ns-soa-check.examples.items.aws.domain'),
|
||||
description: $t('diagnostics/dns-ns-soa-check.examples.items.aws.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function checkNSSOA() {
|
||||
loading = true;
|
||||
@@ -40,7 +59,7 @@
|
||||
|
||||
results = await response.json();
|
||||
} catch (err: unknown) {
|
||||
error = err instanceof Error ? err.message : 'Unknown error occurred';
|
||||
error = err instanceof Error ? err.message : $t('common.errors.unknownError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -157,11 +176,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>NS/SOA Consistency Checker</h1>
|
||||
<p>
|
||||
Verify DNS nameserver and SOA (Start of Authority) record consistency. Check that all listed nameservers resolve
|
||||
correctly and analyze SOA parameters for proper DNS configuration.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/dns-ns-soa-check.title')}</h1>
|
||||
<p>{$t('diagnostics/dns-ns-soa-check.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -169,7 +185,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>NS/SOA Examples</h4>
|
||||
<h4>{$t('diagnostics/dns-ns-soa-check.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -177,7 +193,9 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Check NS/SOA consistency for ${example.domain}`}
|
||||
use:tooltip={$t(
|
||||
`diagnostics/dns-ns-soa-check.examples.items.${['google', 'github', 'cloudflare', 'stackoverflow', 'microsoft', 'aws'][i]}.tooltip`,
|
||||
)}
|
||||
>
|
||||
<h5>{example.domain}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -190,17 +208,17 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>NS/SOA Check</h3>
|
||||
<h3>{$t('diagnostics/dns-ns-soa-check.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-group">
|
||||
<label for="domain" use:tooltip={'Enter the domain to check nameserver and SOA consistency for'}>
|
||||
Domain Name
|
||||
<label for="domain" use:tooltip={$t('diagnostics/dns-ns-soa-check.form.domainTooltip')}>
|
||||
{$t('diagnostics/dns-ns-soa-check.form.domainLabel')}
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domain}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/dns-ns-soa-check.form.domainPlaceholder')}
|
||||
onchange={() => {
|
||||
clearExampleSelection();
|
||||
if (domain) checkNSSOA();
|
||||
@@ -213,10 +231,10 @@
|
||||
<button class="check-btn lookup-btn" onclick={checkNSSOA} disabled={loading || !domain.trim()}>
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Checking NS/SOA...
|
||||
{$t('diagnostics/dns-ns-soa-check.form.checking')}
|
||||
{:else}
|
||||
<Icon name="server" size="sm" />
|
||||
Check NS/SOA Records
|
||||
{$t('diagnostics/dns-ns-soa-check.form.checkButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -227,12 +245,14 @@
|
||||
{#if results && !results.error}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>NS/SOA Analysis Results</h3>
|
||||
<h3>{$t('diagnostics/dns-ns-soa-check.results.title')}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={copiedState}>
|
||||
<span class={copiedState ? 'text-green-500' : ''}
|
||||
><Icon name={copiedState ? 'check' : 'copy'} size="xs" /></span
|
||||
>
|
||||
{copiedState ? 'Copied!' : 'Copy Results'}
|
||||
{copiedState
|
||||
? $t('diagnostics/dns-ns-soa-check.results.copied')
|
||||
: $t('diagnostics/dns-ns-soa-check.results.copyButton')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
@@ -252,11 +272,11 @@
|
||||
<div>
|
||||
<h4>
|
||||
{#if status.status === 'good'}
|
||||
DNS Configuration Healthy
|
||||
{$t('diagnostics/dns-ns-soa-check.results.status.healthy')}
|
||||
{:else if status.status === 'partial'}
|
||||
DNS Issues Detected
|
||||
{$t('diagnostics/dns-ns-soa-check.results.status.issues')}
|
||||
{:else}
|
||||
DNS Configuration Problems
|
||||
{$t('diagnostics/dns-ns-soa-check.results.status.problems')}
|
||||
{/if}
|
||||
</h4>
|
||||
<p>{status.message}</p>
|
||||
@@ -268,7 +288,9 @@
|
||||
<!-- Nameservers -->
|
||||
{#if results.nameservers?.length > 0}
|
||||
<div class="nameservers-section">
|
||||
<h4>Nameservers ({results.nameservers.length})</h4>
|
||||
<h4>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.nameservers.title', { count: results.nameservers.length })}
|
||||
</h4>
|
||||
<div class="nameserver-grid">
|
||||
{#each results.nameserverChecks as check, _index (_index)}
|
||||
<div class="nameserver-item {check.resolved ? 'success' : 'error'}">
|
||||
@@ -286,7 +308,7 @@
|
||||
{:else if !check.resolved}
|
||||
<div class="nameserver-error">
|
||||
<Icon name="alert-triangle" size="xs" />
|
||||
<span>Failed to resolve</span>
|
||||
<span>{$t('diagnostics/dns-ns-soa-check.results.nameservers.failedToResolve')}</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -299,11 +321,11 @@
|
||||
{#if results.soa}
|
||||
{@const parsed = parseSOA(results.soa)}
|
||||
<div class="soa-section">
|
||||
<h4>SOA (Start of Authority) Record</h4>
|
||||
<h4>{$t('diagnostics/dns-ns-soa-check.results.soa.title')}</h4>
|
||||
|
||||
<!-- Raw SOA -->
|
||||
<div class="soa-raw">
|
||||
<h5>Raw SOA Record</h5>
|
||||
<h5>{$t('diagnostics/dns-ns-soa-check.results.soa.rawTitle')}</h5>
|
||||
<div class="soa-display">
|
||||
<code>{results.soa}</code>
|
||||
</div>
|
||||
@@ -312,28 +334,38 @@
|
||||
<!-- Parsed SOA -->
|
||||
{#if parsed}
|
||||
<div class="soa-parsed">
|
||||
<h5>Parsed SOA Parameters</h5>
|
||||
<h5>{$t('diagnostics/dns-ns-soa-check.results.soa.parsedTitle')}</h5>
|
||||
<div class="soa-grid">
|
||||
<div class="soa-item">
|
||||
<div class="soa-label" use:tooltip={'The primary nameserver for this zone'}>Primary NS</div>
|
||||
<div
|
||||
class="soa-label"
|
||||
use:tooltip={$t('diagnostics/dns-ns-soa-check.results.soa.primaryNSTooltip')}
|
||||
>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.soa.primaryNS')}
|
||||
</div>
|
||||
<div class="soa-value">{parsed.primaryNS}</div>
|
||||
</div>
|
||||
|
||||
<div class="soa-item">
|
||||
<div class="soa-label" use:tooltip={'Email address of the zone administrator (@ replaced with .)'}>
|
||||
Administrator
|
||||
<div
|
||||
class="soa-label"
|
||||
use:tooltip={$t('diagnostics/dns-ns-soa-check.results.soa.administratorTooltip')}
|
||||
>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.soa.administrator')}
|
||||
</div>
|
||||
<div class="soa-value">{parsed.admin}</div>
|
||||
</div>
|
||||
|
||||
<div class="soa-item">
|
||||
<div class="soa-label" use:tooltip={'Zone serial number - used to track zone changes'}>Serial</div>
|
||||
<div class="soa-label" use:tooltip={$t('diagnostics/dns-ns-soa-check.results.soa.serialTooltip')}>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.soa.serial')}
|
||||
</div>
|
||||
<div class="soa-value mono">{parsed.serial}</div>
|
||||
</div>
|
||||
|
||||
<div class="soa-item">
|
||||
<div class="soa-label" use:tooltip={'How often secondary servers should check for updates'}>
|
||||
Refresh
|
||||
<div class="soa-label" use:tooltip={$t('diagnostics/dns-ns-soa-check.results.soa.refreshTooltip')}>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.soa.refresh')}
|
||||
</div>
|
||||
<div class="soa-value">
|
||||
<span class="mono">{parsed.refresh}s</span>
|
||||
@@ -342,8 +374,8 @@
|
||||
</div>
|
||||
|
||||
<div class="soa-item">
|
||||
<div class="soa-label" use:tooltip={'How long to wait before retrying a failed zone transfer'}>
|
||||
Retry
|
||||
<div class="soa-label" use:tooltip={$t('diagnostics/dns-ns-soa-check.results.soa.retryTooltip')}>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.soa.retry')}
|
||||
</div>
|
||||
<div class="soa-value">
|
||||
<span class="mono">{parsed.retry}s</span>
|
||||
@@ -352,11 +384,8 @@
|
||||
</div>
|
||||
|
||||
<div class="soa-item">
|
||||
<div
|
||||
class="soa-label"
|
||||
use:tooltip={"When secondary servers should stop answering queries if they can't contact the primary"}
|
||||
>
|
||||
Expire
|
||||
<div class="soa-label" use:tooltip={$t('diagnostics/dns-ns-soa-check.results.soa.expireTooltip')}>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.soa.expire')}
|
||||
</div>
|
||||
<div class="soa-value">
|
||||
<span class="mono">{parsed.expire}s</span>
|
||||
@@ -365,8 +394,11 @@
|
||||
</div>
|
||||
|
||||
<div class="soa-item">
|
||||
<div class="soa-label" use:tooltip={'Default TTL for negative responses (NXDOMAIN)'}>
|
||||
Minimum TTL
|
||||
<div
|
||||
class="soa-label"
|
||||
use:tooltip={$t('diagnostics/dns-ns-soa-check.results.soa.minimumTTLTooltip')}
|
||||
>
|
||||
{$t('diagnostics/dns-ns-soa-check.results.soa.minimumTTL')}
|
||||
</div>
|
||||
<div class="soa-value">
|
||||
<span class="mono">{parsed.minimum}s</span>
|
||||
@@ -377,18 +409,18 @@
|
||||
|
||||
<!-- Configuration Analysis -->
|
||||
<div class="recommendations-section">
|
||||
<h5>Configuration Analysis</h5>
|
||||
<h5>{$t('diagnostics/dns-ns-soa-check.results.analysis.title')}</h5>
|
||||
<div class="recommendation-list">
|
||||
<!-- Serial number check -->
|
||||
{#if parsed.serial.toString().length === 10 && parsed.serial.toString().startsWith('202')}
|
||||
<div class="recommendation-item success">
|
||||
<Icon name="check-circle" size="sm" />
|
||||
<span>Serial number appears to use YYYYMMDDNN format (recommended)</span>
|
||||
<span>{$t('diagnostics/dns-ns-soa-check.results.analysis.serialYYYYMMDDNN')}</span>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="recommendation-item warning">
|
||||
<Icon name="alert-circle" size="sm" />
|
||||
<span>Consider using YYYYMMDDNN format for serial numbers for easier tracking</span>
|
||||
<span>{$t('diagnostics/dns-ns-soa-check.results.analysis.serialSuggestion')}</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -396,19 +428,29 @@
|
||||
{#if parsed.refresh >= 3600 && parsed.refresh <= 86400}
|
||||
<div class="recommendation-item success">
|
||||
<Icon name="check-circle" size="sm" />
|
||||
<span>Refresh interval ({formatTime(parsed.refresh)}) is within recommended range</span>
|
||||
<span
|
||||
>{$t('diagnostics/dns-ns-soa-check.results.analysis.refreshGood', {
|
||||
time: formatTime(parsed.refresh),
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{:else if parsed.refresh < 3600}
|
||||
<div class="recommendation-item warning">
|
||||
<Icon name="alert-circle" size="sm" />
|
||||
<span
|
||||
>Refresh interval ({formatTime(parsed.refresh)}) is quite frequent - consider increasing</span
|
||||
>{$t('diagnostics/dns-ns-soa-check.results.analysis.refreshTooFrequent', {
|
||||
time: formatTime(parsed.refresh),
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="recommendation-item warning">
|
||||
<Icon name="alert-circle" size="sm" />
|
||||
<span>Refresh interval ({formatTime(parsed.refresh)}) is quite long - consider reducing</span>
|
||||
<span
|
||||
>{$t('diagnostics/dns-ns-soa-check.results.analysis.refreshTooLong', {
|
||||
time: formatTime(parsed.refresh),
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -416,17 +458,21 @@
|
||||
{#if parsed.retry >= 600 && parsed.retry < parsed.refresh}
|
||||
<div class="recommendation-item success">
|
||||
<Icon name="check-circle" size="sm" />
|
||||
<span>Retry interval is properly configured</span>
|
||||
<span>{$t('diagnostics/dns-ns-soa-check.results.analysis.retryGood')}</span>
|
||||
</div>
|
||||
{:else if parsed.retry >= parsed.refresh}
|
||||
<div class="recommendation-item error">
|
||||
<Icon name="x-circle" size="sm" />
|
||||
<span>Retry interval should be less than refresh interval</span>
|
||||
<span>{$t('diagnostics/dns-ns-soa-check.results.analysis.retryTooLong')}</span>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="recommendation-item warning">
|
||||
<Icon name="alert-circle" size="sm" />
|
||||
<span>Retry interval ({formatTime(parsed.retry)}) might be too short</span>
|
||||
<span
|
||||
>{$t('diagnostics/dns-ns-soa-check.results.analysis.retryTooShort', {
|
||||
time: formatTime(parsed.retry),
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -434,12 +480,20 @@
|
||||
{#if parsed.expire >= 604800}
|
||||
<div class="recommendation-item success">
|
||||
<Icon name="check-circle" size="sm" />
|
||||
<span>Expire time ({formatTime(parsed.expire)}) provides good resilience</span>
|
||||
<span
|
||||
>{$t('diagnostics/dns-ns-soa-check.results.analysis.expireGood', {
|
||||
time: formatTime(parsed.expire),
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="recommendation-item warning">
|
||||
<Icon name="alert-circle" size="sm" />
|
||||
<span>Expire time ({formatTime(parsed.expire)}) is quite short - consider at least 1 week</span>
|
||||
<span
|
||||
>{$t('diagnostics/dns-ns-soa-check.results.analysis.expireShort', {
|
||||
time: formatTime(parsed.expire),
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -458,7 +512,7 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>NS/SOA Check Failed</strong>
|
||||
<strong>{$t('diagnostics/dns-ns-soa-check.error.title')}</strong>
|
||||
<p>{error || results.error}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -469,58 +523,50 @@
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>Understanding NS and SOA Records</h3>
|
||||
<h3>{$t('diagnostics/dns-ns-soa-check.education.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>NS (Name Server) Records</h4>
|
||||
<p>NS records specify which name servers are authoritative for a domain. All listed nameservers should:</p>
|
||||
<h4>{$t('diagnostics/dns-ns-soa-check.education.nsRecords.title')}</h4>
|
||||
<p>{$t('diagnostics/dns-ns-soa-check.education.nsRecords.description')}</p>
|
||||
<ul>
|
||||
<li>Resolve to valid IP addresses</li>
|
||||
<li>Be reachable and responsive</li>
|
||||
<li>Serve consistent zone data</li>
|
||||
<li>Be geographically distributed for redundancy</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.nsRecords.resolveToValidIP')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.nsRecords.beReachable')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.nsRecords.serveConsistent')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.nsRecords.beDistributed')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>SOA (Start of Authority)</h4>
|
||||
<p>The SOA record contains administrative information about the zone:</p>
|
||||
<h4>{$t('diagnostics/dns-ns-soa-check.education.soaRecord.title')}</h4>
|
||||
<p>{$t('diagnostics/dns-ns-soa-check.education.soaRecord.description')}</p>
|
||||
<ul>
|
||||
<li><strong>Serial:</strong> Version number for zone changes</li>
|
||||
<li><strong>Refresh:</strong> How often secondaries check for updates</li>
|
||||
<li><strong>Retry:</strong> Wait time before retrying failed transfers</li>
|
||||
<li><strong>Expire:</strong> When to stop serving stale data</li>
|
||||
<li><strong>Minimum:</strong> Default negative response TTL</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.soaRecord.serial')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.soaRecord.refresh')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.soaRecord.retry')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.soaRecord.expire')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.soaRecord.minimum')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Recommended Values</h4>
|
||||
<h4>{$t('diagnostics/dns-ns-soa-check.education.recommended.title')}</h4>
|
||||
<div class="recommendations-table">
|
||||
<div class="rec-item">
|
||||
<strong>Refresh:</strong> 1-24 hours (3600-86400s)
|
||||
</div>
|
||||
<div class="rec-item">
|
||||
<strong>Retry:</strong> 10-60 minutes (600-3600s)
|
||||
</div>
|
||||
<div class="rec-item">
|
||||
<strong>Expire:</strong> 1-4 weeks (604800-2419200s)
|
||||
</div>
|
||||
<div class="rec-item">
|
||||
<strong>Minimum:</strong> 5 minutes to 1 hour (300-3600s)
|
||||
</div>
|
||||
<div class="rec-item">{$t('diagnostics/dns-ns-soa-check.education.recommended.refresh')}</div>
|
||||
<div class="rec-item">{$t('diagnostics/dns-ns-soa-check.education.recommended.retry')}</div>
|
||||
<div class="rec-item">{$t('diagnostics/dns-ns-soa-check.education.recommended.expire')}</div>
|
||||
<div class="rec-item">{$t('diagnostics/dns-ns-soa-check.education.recommended.minimum')}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Common Issues</h4>
|
||||
<h4>{$t('diagnostics/dns-ns-soa-check.education.commonIssues.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>Unreachable nameservers:</strong> Can cause resolution failures</li>
|
||||
<li><strong>Inconsistent data:</strong> Different responses from different NS</li>
|
||||
<li><strong>Wrong SOA values:</strong> Too aggressive or too conservative timing</li>
|
||||
<li><strong>Serial number issues:</strong> Outdated or incorrect format</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.commonIssues.unreachable')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.commonIssues.inconsistent')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.commonIssues.wrongValues')}</li>
|
||||
<li>{$t('diagnostics/dns-ns-soa-check.education.commonIssues.serialIssues')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domain = $state('example.com');
|
||||
@@ -11,21 +12,39 @@
|
||||
let copiedState = $state(false);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const resolvers = [
|
||||
{ value: 'cloudflare', label: 'Cloudflare (1.1.1.1)' },
|
||||
{ value: 'google', label: 'Google (8.8.8.8)' },
|
||||
{ value: 'quad9', label: 'Quad9 (9.9.9.9)' },
|
||||
{ value: 'opendns', label: 'OpenDNS (208.67.222.222)' },
|
||||
];
|
||||
const resolvers = $derived([
|
||||
{ value: 'cloudflare', label: $t('diagnostics/dns-soa-serial.resolvers.cloudflare') },
|
||||
{ value: 'google', label: $t('diagnostics/dns-soa-serial.resolvers.google') },
|
||||
{ value: 'quad9', label: $t('diagnostics/dns-soa-serial.resolvers.quad9') },
|
||||
{ value: 'opendns', label: $t('diagnostics/dns-soa-serial.resolvers.opendns') },
|
||||
]);
|
||||
|
||||
const examples = [
|
||||
{ domain: 'google.com', description: 'High-traffic domain with frequent updates' },
|
||||
{ domain: 'github.com', description: 'Tech company with modern DNS management' },
|
||||
{ domain: 'cloudflare.com', description: 'DNS provider with optimal configurations' },
|
||||
{ domain: 'iana.org', description: 'Internet standards organization' },
|
||||
{ domain: 'rfc-editor.org', description: 'Official RFC publication site' },
|
||||
{ domain: 'example.com', description: 'Reserved example domain (RFC 2606)' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/dns-soa-serial.examples.items.google.domain'),
|
||||
description: $t('diagnostics/dns-soa-serial.examples.items.google.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-soa-serial.examples.items.github.domain'),
|
||||
description: $t('diagnostics/dns-soa-serial.examples.items.github.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-soa-serial.examples.items.cloudflare.domain'),
|
||||
description: $t('diagnostics/dns-soa-serial.examples.items.cloudflare.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-soa-serial.examples.items.iana.domain'),
|
||||
description: $t('diagnostics/dns-soa-serial.examples.items.iana.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-soa-serial.examples.items.rfcEditor.domain'),
|
||||
description: $t('diagnostics/dns-soa-serial.examples.items.rfcEditor.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-soa-serial.examples.items.example.domain'),
|
||||
description: $t('diagnostics/dns-soa-serial.examples.items.example.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function analyzeSOA() {
|
||||
loading = true;
|
||||
@@ -50,7 +69,7 @@
|
||||
|
||||
results = await response.json();
|
||||
} catch (err: unknown) {
|
||||
error = err instanceof Error ? err.message : 'Unknown error occurred';
|
||||
error = err instanceof Error ? err.message : $t('common.errors.unknownError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -97,19 +116,15 @@
|
||||
timeZoneName: 'short',
|
||||
});
|
||||
} catch {
|
||||
return 'Invalid date';
|
||||
return $t('diagnostics/dns-soa-serial.results.serialAnalysis.notAvailable');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>SOA Serial Analyzer</h1>
|
||||
<p>
|
||||
Analyze Start of Authority (SOA) records to interpret serial number formats and examine DNS zone timing
|
||||
parameters. SOA records contain critical zone metadata including serial numbers for change tracking and timing
|
||||
values for zone transfers.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/dns-soa-serial.title')}</h1>
|
||||
<p>{$t('diagnostics/dns-soa-serial.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -117,7 +132,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Domain Examples</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -125,7 +140,7 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Analyze SOA record for ${example.domain} (${example.description})`}
|
||||
use:tooltip={`${$t('diagnostics/dns-soa-serial.examples.title')} - ${example.domain} (${example.description})`}
|
||||
>
|
||||
<h5>{example.domain}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -138,18 +153,18 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>SOA Analysis Configuration</h3>
|
||||
<h3>{$t('diagnostics/dns-soa-serial.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="domain" use:tooltip={'Enter a domain name to analyze its SOA record'}>
|
||||
Domain Name
|
||||
<label for="domain" use:tooltip={$t('diagnostics/dns-soa-serial.form.domainTooltip')}>
|
||||
{$t('diagnostics/dns-soa-serial.form.domainLabel')}
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domain}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/dns-soa-serial.form.domainPlaceholder')}
|
||||
onchange={() => {
|
||||
clearExampleSelection();
|
||||
if (domain.trim()) analyzeSOA();
|
||||
@@ -159,8 +174,8 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="resolver" use:tooltip={'Choose a DNS-over-HTTPS resolver for the query'}>
|
||||
DoH Resolver
|
||||
<label for="resolver" use:tooltip={$t('diagnostics/dns-soa-serial.form.resolverTooltip')}>
|
||||
{$t('diagnostics/dns-soa-serial.form.resolverLabel')}
|
||||
<select
|
||||
id="resolver"
|
||||
bind:value={resolver}
|
||||
@@ -180,10 +195,10 @@
|
||||
<button class="lookup-btn" onclick={analyzeSOA} disabled={loading || !domain.trim()}>
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Analyzing SOA Record...
|
||||
{$t('diagnostics/dns-soa-serial.form.analyzing')}
|
||||
{:else}
|
||||
<Icon name="search" size="sm" />
|
||||
Analyze SOA
|
||||
{$t('diagnostics/dns-soa-serial.form.analyzeButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -209,22 +224,28 @@
|
||||
.soa}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>SOA Analysis for {results.name}</h3>
|
||||
<h3>{$t('diagnostics/dns-soa-serial.results.title', { name: results.name })}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={copiedState}>
|
||||
<span class={copiedState ? 'text-green-500' : ''}
|
||||
><Icon name={copiedState ? 'check' : 'copy'} size="xs" /></span
|
||||
>
|
||||
{copiedState ? 'Copied!' : 'Copy Raw JSON'}
|
||||
{copiedState
|
||||
? $t('diagnostics/dns-soa-serial.results.copied')
|
||||
: $t('diagnostics/dns-soa-serial.results.copyButton')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="lookup-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'The domain that was queried'}>Domain:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/dns-soa-serial.results.domainTooltip')}
|
||||
>{$t('diagnostics/dns-soa-serial.results.domainLabel')}</span
|
||||
>
|
||||
<span class="info-value mono">{results.name}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'DNS-over-HTTPS resolver used for the query'}>DoH Resolver:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/dns-soa-serial.results.resolverTooltip')}
|
||||
>{$t('diagnostics/dns-soa-serial.results.resolverLabel')}</span
|
||||
>
|
||||
<span class="info-value">{results.resolver}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -232,29 +253,54 @@
|
||||
<div class="results-grid">
|
||||
<!-- Serial Number Analysis -->
|
||||
<div class="result-section">
|
||||
<h4>Serial Number Analysis</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.title')}</h4>
|
||||
<div class="serial-analysis">
|
||||
<div class="serial-display">
|
||||
<span class="serial-number">{res.soa?.serial || 'Not available'}</span>
|
||||
<span class="serial-format {res.serialAnalysis?.format}">{res.serialAnalysis?.format || 'Unknown'}</span
|
||||
<span class="serial-number"
|
||||
>{res.soa?.serial || $t('diagnostics/dns-soa-serial.results.serialAnalysis.notAvailable')}</span
|
||||
>
|
||||
<span class="serial-format {res.serialAnalysis?.format}"
|
||||
>{res.serialAnalysis?.format || $t('diagnostics/dns-soa-serial.results.serialAnalysis.unknown')}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<dl class="definition-list">
|
||||
<dt>Format:</dt>
|
||||
<dt>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.formatLabel')}</dt>
|
||||
<dd>
|
||||
<strong>{serialInfo?.formatDescription || 'Unknown'}</strong>
|
||||
<p class="format-explanation">{serialInfo?.explanation || 'No analysis available'}</p>
|
||||
<strong
|
||||
>{serialInfo?.formatDescription ||
|
||||
$t('diagnostics/dns-soa-serial.results.serialAnalysis.formatUnknown')}</strong
|
||||
>
|
||||
<p class="format-explanation">
|
||||
{serialInfo?.explanation ||
|
||||
$t('diagnostics/dns-soa-serial.results.serialAnalysis.formatExplanation')}
|
||||
</p>
|
||||
</dd>
|
||||
{#if serialAnalysis?.parsed}
|
||||
<dt>Parsed Date:</dt>
|
||||
<dt>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.parsedDateLabel')}</dt>
|
||||
<dd>
|
||||
{#if serialAnalysis.format === 'YYYYMMDDNN'}
|
||||
<div class="parsed-date">
|
||||
<span class="date-part">Year: {serialAnalysis.parsed.year}</span>
|
||||
<span class="date-part">Month: {serialAnalysis.parsed.month}</span>
|
||||
<span class="date-part">Day: {serialAnalysis.parsed.day}</span>
|
||||
<span class="date-part">Revision: {serialAnalysis.parsed.revision}</span>
|
||||
<span class="date-part"
|
||||
>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.parsedYear', {
|
||||
year: serialAnalysis.parsed.year!,
|
||||
})}</span
|
||||
>
|
||||
<span class="date-part"
|
||||
>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.parsedMonth', {
|
||||
month: serialAnalysis.parsed.month!,
|
||||
})}</span
|
||||
>
|
||||
<span class="date-part"
|
||||
>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.parsedDay', {
|
||||
day: serialAnalysis.parsed.day!,
|
||||
})}</span
|
||||
>
|
||||
<span class="date-part"
|
||||
>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.parsedRevision', {
|
||||
revision: serialAnalysis.parsed.revision!,
|
||||
})}</span
|
||||
>
|
||||
</div>
|
||||
{:else if serialAnalysis.format === 'Unix Timestamp'}
|
||||
<span class="unix-date">{formatDate(serialAnalysis.parsed.timestamp!)}</span>
|
||||
@@ -262,10 +308,12 @@
|
||||
</dd>
|
||||
{/if}
|
||||
|
||||
<dt>Validity:</dt>
|
||||
<dt>{$t('diagnostics/dns-soa-serial.results.serialAnalysis.validityLabel')}</dt>
|
||||
<dd class="validity {serialAnalysis?.valid ? 'valid' : 'invalid'}">
|
||||
<Icon name={serialAnalysis?.valid ? 'check-circle' : 'x-circle'} size="sm" />
|
||||
{serialAnalysis?.valid ? 'Valid format' : 'Invalid or unusual format'}
|
||||
{serialAnalysis?.valid
|
||||
? $t('diagnostics/dns-soa-serial.results.serialAnalysis.valid')
|
||||
: $t('diagnostics/dns-soa-serial.results.serialAnalysis.invalid')}
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -273,21 +321,21 @@
|
||||
|
||||
<!-- SOA Record Details -->
|
||||
<div class="result-section">
|
||||
<h4>SOA Record Details</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.results.soaDetails.title')}</h4>
|
||||
<dl class="definition-list">
|
||||
<dt>Primary Server:</dt>
|
||||
<dd class="mono">{soaData?.mname || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/dns-soa-serial.results.soaDetails.primaryServer')}</dt>
|
||||
<dd class="mono">{soaData?.mname || $t('diagnostics/dns-soa-serial.results.soaDetails.notAvailable')}</dd>
|
||||
|
||||
<dt>Contact Email:</dt>
|
||||
<dd class="mono">{soaData?.rname || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/dns-soa-serial.results.soaDetails.contactEmail')}</dt>
|
||||
<dd class="mono">{soaData?.rname || $t('diagnostics/dns-soa-serial.results.soaDetails.notAvailable')}</dd>
|
||||
|
||||
<dt>TTL:</dt>
|
||||
<dt>{$t('diagnostics/dns-soa-serial.results.soaDetails.ttl')}</dt>
|
||||
<dd>
|
||||
{#if soaData?.ttl}
|
||||
<span class="ttl-value">{soaData.ttl}s</span>
|
||||
<small>({formatDuration(soaData.ttl)})</small>
|
||||
{:else}
|
||||
Not available
|
||||
{$t('diagnostics/dns-soa-serial.results.soaDetails.notAvailable')}
|
||||
{/if}
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -295,41 +343,41 @@
|
||||
|
||||
<!-- Timing Parameters -->
|
||||
<div class="result-section full-width">
|
||||
<h4>Zone Timing Parameters</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.results.timing.title')}</h4>
|
||||
<div class="timing-grid">
|
||||
<div class="timing-param">
|
||||
<h5>Refresh</h5>
|
||||
<h5>{$t('diagnostics/dns-soa-serial.results.timing.refresh.title')}</h5>
|
||||
<div class="param-value">{timingData?.refresh || 0}s</div>
|
||||
<div class="param-description">
|
||||
<small>{formatDuration(timingData?.refresh || 0)}</small>
|
||||
<p>How often secondary servers check for updates</p>
|
||||
<p>{$t('diagnostics/dns-soa-serial.results.timing.refresh.description')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="timing-param">
|
||||
<h5>Retry</h5>
|
||||
<h5>{$t('diagnostics/dns-soa-serial.results.timing.retry.title')}</h5>
|
||||
<div class="param-value">{timingData?.retry || 0}s</div>
|
||||
<div class="param-description">
|
||||
<small>{formatDuration(timingData?.retry || 0)}</small>
|
||||
<p>Retry interval after failed refresh attempts</p>
|
||||
<p>{$t('diagnostics/dns-soa-serial.results.timing.retry.description')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="timing-param">
|
||||
<h5>Expire</h5>
|
||||
<h5>{$t('diagnostics/dns-soa-serial.results.timing.expire.title')}</h5>
|
||||
<div class="param-value">{timingData?.expire || 0}s</div>
|
||||
<div class="param-description">
|
||||
<small>{formatDuration(timingData?.expire || 0)}</small>
|
||||
<p>When secondary servers stop serving the zone</p>
|
||||
<p>{$t('diagnostics/dns-soa-serial.results.timing.expire.description')}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="timing-param">
|
||||
<h5>Minimum</h5>
|
||||
<h5>{$t('diagnostics/dns-soa-serial.results.timing.minimum.title')}</h5>
|
||||
<div class="param-value">{timingData?.minimum || 0}s</div>
|
||||
<div class="param-description">
|
||||
<small>{formatDuration(timingData?.minimum || 0)}</small>
|
||||
<p>Minimum TTL for negative responses</p>
|
||||
<p>{$t('diagnostics/dns-soa-serial.results.timing.minimum.description')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -343,7 +391,7 @@
|
||||
}
|
||||
).assessment}
|
||||
<div class="result-section full-width">
|
||||
<h4>Configuration Assessment</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.results.assessment.title')}</h4>
|
||||
<div class="assessment-grid">
|
||||
{#each assessmentData || [] as item, itemIndex (itemIndex)}
|
||||
<div class="assessment-item {item.severity}">
|
||||
@@ -378,15 +426,15 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>SOA Analysis Failed</strong>
|
||||
<strong>{$t('diagnostics/dns-soa-serial.error.title')}</strong>
|
||||
<p>{error}</p>
|
||||
<div class="troubleshooting">
|
||||
<p><strong>Troubleshooting Tips:</strong></p>
|
||||
<p><strong>{$t('diagnostics/dns-soa-serial.error.troubleshooting')}</strong></p>
|
||||
<ul>
|
||||
<li>Ensure the domain name is valid and has a SOA record</li>
|
||||
<li>Try a different DoH resolver if the current one fails</li>
|
||||
<li>Some domains may not respond to certain resolvers</li>
|
||||
<li>Check if the domain exists and is properly configured</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.error.tips.validDomain')}</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.error.tips.tryDifferent')}</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.error.tips.someResolvers')}</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.error.tips.checkDomain')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -398,44 +446,62 @@
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>About SOA Records and Serial Numbers</h3>
|
||||
<h3>{$t('diagnostics/dns-soa-serial.education.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>What is a SOA Record?</h4>
|
||||
<p>
|
||||
Start of Authority records contain administrative information about a DNS zone, including the primary
|
||||
server, contact email, and timing parameters that control zone transfers and caching behavior.
|
||||
</p>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.education.whatIsSOA.title')}</h4>
|
||||
<p>{$t('diagnostics/dns-soa-serial.education.whatIsSOA.description')}</p>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Serial Number Formats</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.education.serialFormats.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>YYYYMMDDNN:</strong> Date-based format (e.g., 2024031501 = March 15, 2024, revision 01)</li>
|
||||
<li><strong>Unix Timestamp:</strong> Seconds since epoch (e.g., 1710518400)</li>
|
||||
<li><strong>Sequential:</strong> Simple incrementing numbers (e.g., 1, 2, 3...)</li>
|
||||
<li>
|
||||
<strong>YYYYMMDDNN:</strong>
|
||||
{$t('diagnostics/dns-soa-serial.education.serialFormats.yyyymmddnn').replace('YYYYMMDDNN: ', '')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Unix Timestamp:</strong>
|
||||
{$t('diagnostics/dns-soa-serial.education.serialFormats.unixTimestamp').replace('Unix Timestamp: ', '')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Sequential:</strong>
|
||||
{$t('diagnostics/dns-soa-serial.education.serialFormats.sequential').replace('Sequential: ', '')}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Timing Parameters</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.education.timingParams.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>Refresh:</strong> How often secondaries check for updates</li>
|
||||
<li><strong>Retry:</strong> Retry interval after failed transfers</li>
|
||||
<li><strong>Expire:</strong> When to stop serving if updates fail</li>
|
||||
<li><strong>Minimum:</strong> TTL for negative (NXDOMAIN) responses</li>
|
||||
<li>
|
||||
<strong>Refresh:</strong>
|
||||
{$t('diagnostics/dns-soa-serial.education.timingParams.refresh').replace('Refresh: ', '')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Retry:</strong>
|
||||
{$t('diagnostics/dns-soa-serial.education.timingParams.retry').replace('Retry: ', '')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Expire:</strong>
|
||||
{$t('diagnostics/dns-soa-serial.education.timingParams.expire').replace('Expire: ', '')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Minimum:</strong>
|
||||
{$t('diagnostics/dns-soa-serial.education.timingParams.minimum').replace('Minimum: ', '')}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Best Practices</h4>
|
||||
<h4>{$t('diagnostics/dns-soa-serial.education.bestPractices.title')}</h4>
|
||||
<ul>
|
||||
<li>Use YYYYMMDDNN format for predictable versioning</li>
|
||||
<li>Set refresh to 3600-7200s for most zones</li>
|
||||
<li>Retry should be shorter than refresh (1800-3600s)</li>
|
||||
<li>Expire should be much longer (604800-1209600s)</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.education.bestPractices.useYYYYMMDDNN')}</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.education.bestPractices.setRefresh')}</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.education.bestPractices.retryShorter')}</li>
|
||||
<li>{$t('diagnostics/dns-soa-serial.education.bestPractices.expireLonger')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domainName = $state('example.com');
|
||||
@@ -9,18 +10,36 @@
|
||||
let error = $state<string | null>(null);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ domain: 'www.cloudflare.com', description: 'Cloudflare edge network' },
|
||||
{ domain: 'www.google.com', description: 'Popular service with CDN' },
|
||||
{ domain: 'github.com', description: 'GitHub platform trace' },
|
||||
{ domain: 'bbc.co.uk', description: 'Multi-level TLD (.co.uk)' },
|
||||
{ domain: 'aws.amazon.com', description: 'AWS subdomain delegation' },
|
||||
{ domain: 'aliciasykes.com', description: 'Homepage hosted on Vercel' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/dns-trace.examples.items.cloudflare.domain'),
|
||||
description: $t('diagnostics/dns-trace.examples.items.cloudflare.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-trace.examples.items.google.domain'),
|
||||
description: $t('diagnostics/dns-trace.examples.items.google.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-trace.examples.items.github.domain'),
|
||||
description: $t('diagnostics/dns-trace.examples.items.github.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-trace.examples.items.bbc.domain'),
|
||||
description: $t('diagnostics/dns-trace.examples.items.bbc.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-trace.examples.items.aws.domain'),
|
||||
description: $t('diagnostics/dns-trace.examples.items.aws.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/dns-trace.examples.items.alicia.domain'),
|
||||
description: $t('diagnostics/dns-trace.examples.items.alicia.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function performTrace() {
|
||||
if (!domainName?.trim()) {
|
||||
error = 'Please enter a domain name';
|
||||
error = $t('diagnostics/dns-trace.error.emptyDomain');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,12 +60,12 @@
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(data.message || 'Failed to trace domain');
|
||||
throw new Error(data.message || $t('diagnostics/dns-trace.error.failed'));
|
||||
}
|
||||
|
||||
results = data;
|
||||
} catch (err) {
|
||||
error = err instanceof Error ? err.message : 'An error occurred';
|
||||
error = err instanceof Error ? err.message : $t('diagnostics/dns-trace.error.general');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -71,8 +90,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>DNS Trace Tool</h1>
|
||||
<p>Iterative trace from root to authoritative nameservers via DNS over HTTPS</p>
|
||||
<h1>{$t('diagnostics/dns-trace.title')}</h1>
|
||||
<p>{$t('diagnostics/dns-trace.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -80,7 +99,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Quick Examples</h4>
|
||||
<h4>{$t('diagnostics/dns-trace.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -88,7 +107,9 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Trace DNS resolution path for ${example.domain}`}
|
||||
use:tooltip={$t(
|
||||
`diagnostics/dns-trace.examples.items.${['cloudflare', 'google', 'github', 'bbc', 'aws', 'alicia'][i]}.tooltip`,
|
||||
)}
|
||||
>
|
||||
<h5>{example.domain}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -101,17 +122,17 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>Trace Configuration</h3>
|
||||
<h3>{$t('diagnostics/dns-trace.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-group">
|
||||
<label for="domain">Domain Name</label>
|
||||
<label for="domain">{$t('diagnostics/dns-trace.form.domainLabel')}</label>
|
||||
<div class="input-flex-container">
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domainName}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/dns-trace.form.domainPlaceholder')}
|
||||
disabled={loading}
|
||||
onchange={() => clearExampleSelection()}
|
||||
onkeydown={(e) => e.key === 'Enter' && performTrace()}
|
||||
@@ -119,10 +140,10 @@
|
||||
<button onclick={performTrace} disabled={loading} class="primary">
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Tracing...
|
||||
{$t('diagnostics/dns-trace.form.tracing')}
|
||||
{:else}
|
||||
<Icon name="search" size="sm" />
|
||||
Trace
|
||||
{$t('diagnostics/dns-trace.form.traceButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -136,7 +157,7 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>Trace Failed</strong>
|
||||
<strong>{$t('diagnostics/dns-trace.error.title')}</strong>
|
||||
<p>{error}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,8 +171,8 @@
|
||||
<div class="loading-state">
|
||||
<Icon name="loader" size="lg" animate="spin" />
|
||||
<div class="loading-text">
|
||||
<h3>Performing DNS Trace</h3>
|
||||
<p>Following the DNS resolution path from root servers to authoritative nameservers...</p>
|
||||
<h3>{$t('diagnostics/dns-trace.loading.title')}</h3>
|
||||
<p>{$t('diagnostics/dns-trace.loading.message')}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,7 +182,7 @@
|
||||
{#if results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header">
|
||||
<h3>Trace Path</h3>
|
||||
<h3>{$t('diagnostics/dns-trace.results.pathTitle')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="trace-timeline">
|
||||
@@ -173,20 +194,30 @@
|
||||
|
||||
<div class="step-content">
|
||||
<div class="step-header">
|
||||
<span class="step-type" use:tooltip={'Type of DNS query operation'}>{step.type}</span>
|
||||
<span class="step-timing" use:tooltip={'Time taken for this query'}>{formatTiming(step.timing)}</span>
|
||||
<span class="step-type" use:tooltip={$t('diagnostics/dns-trace.results.step.typeTooltip')}
|
||||
>{step.type}</span
|
||||
>
|
||||
<span class="step-timing" use:tooltip={$t('diagnostics/dns-trace.results.step.timingTooltip')}
|
||||
>{formatTiming(step.timing)}</span
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="step-query">
|
||||
<strong use:tooltip={'Domain name being queried'}>Query:</strong>
|
||||
<strong use:tooltip={$t('diagnostics/dns-trace.results.step.queryTooltip')}
|
||||
>{$t('diagnostics/dns-trace.results.step.query')}</strong
|
||||
>
|
||||
{step.query}
|
||||
{#if step.qtype}
|
||||
<span class="record-type" use:tooltip={'DNS record type requested'}>{step.qtype}</span>
|
||||
<span class="record-type" use:tooltip={$t('diagnostics/dns-trace.results.step.qtypeTooltip')}
|
||||
>{step.qtype}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="step-server">
|
||||
<strong use:tooltip={'DNS server that responded to this query'}>Server:</strong>
|
||||
<strong use:tooltip={$t('diagnostics/dns-trace.results.step.serverTooltip')}
|
||||
>{$t('diagnostics/dns-trace.results.step.server')}</strong
|
||||
>
|
||||
{step.server}
|
||||
{#if step.serverName}
|
||||
<span class="server-name">({step.serverName})</span>
|
||||
@@ -195,10 +226,14 @@
|
||||
|
||||
{#if step.response}
|
||||
<div class="step-response">
|
||||
<strong use:tooltip={'Response received from the DNS server'}>Response:</strong>
|
||||
<strong use:tooltip={$t('diagnostics/dns-trace.results.step.responseTooltip')}
|
||||
>{$t('diagnostics/dns-trace.results.step.response')}</strong
|
||||
>
|
||||
{#if step.response.type === 'referral'}
|
||||
<span class="referral">
|
||||
Referral to {step.response.nameservers.join(', ')}
|
||||
{$t('diagnostics/dns-trace.results.step.referral', {
|
||||
nameservers: step.response.nameservers.join(', '),
|
||||
})}
|
||||
</span>
|
||||
{:else if step.response.type === 'answer'}
|
||||
<span class="answer">
|
||||
@@ -209,9 +244,9 @@
|
||||
{/if}
|
||||
</span>
|
||||
{:else if step.response.type === 'nodata'}
|
||||
<span class="nodata">No data for this record type</span>
|
||||
<span class="nodata">{$t('diagnostics/dns-trace.results.step.nodata')}</span>
|
||||
{:else if step.response.type === 'nxdomain'}
|
||||
<span class="nxdomain">Domain does not exist</span>
|
||||
<span class="nxdomain">{$t('diagnostics/dns-trace.results.step.nxdomain')}</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -219,16 +254,18 @@
|
||||
{#if step.flags}
|
||||
<div class="step-flags">
|
||||
{#if step.flags.aa}
|
||||
<span class="flag authoritative" use:tooltip={'Authoritative Answer'}>AA</span>
|
||||
<span class="flag authoritative" use:tooltip={$t('diagnostics/dns-trace.results.flags.aa')}
|
||||
>AA</span
|
||||
>
|
||||
{/if}
|
||||
{#if step.flags.ad}
|
||||
<span class="flag dnssec" use:tooltip={'Authenticated Data (DNSSEC)'}>AD</span>
|
||||
<span class="flag dnssec" use:tooltip={$t('diagnostics/dns-trace.results.flags.ad')}>AD</span>
|
||||
{/if}
|
||||
{#if step.flags.rd}
|
||||
<span class="flag" use:tooltip={'Recursion Desired'}>RD</span>
|
||||
<span class="flag" use:tooltip={$t('diagnostics/dns-trace.results.flags.rd')}>RD</span>
|
||||
{/if}
|
||||
{#if step.flags.ra}
|
||||
<span class="flag" use:tooltip={'Recursion Available'}>RA</span>
|
||||
<span class="flag" use:tooltip={$t('diagnostics/dns-trace.results.flags.ra')}>RA</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -242,53 +279,61 @@
|
||||
{#if results.summary}
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>Trace Summary</h3>
|
||||
<h3>{$t('diagnostics/dns-trace.results.summary.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="stats-grid">
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'Total time for the complete DNS trace'}>Total Time</div>
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.totalTime.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.totalTime.label')}
|
||||
</div>
|
||||
<div class="stat-value">
|
||||
<Icon name="timer" size="sm" />
|
||||
{formatTiming(results.summary.totalTime)}
|
||||
</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'Number of DNS queries performed during trace'}>DNS Queries</div>
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.dnsQueries.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.dnsQueries.label')}
|
||||
</div>
|
||||
<div class="stat-value">{results.summary.queryCount}</div>
|
||||
</div>
|
||||
{#if results.summary.finalServer}
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'Final authoritative server that provided the answer'}>
|
||||
Final Server
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.finalServer.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.finalServer.label')}
|
||||
</div>
|
||||
<div class="stat-value mono">{results.summary.finalServer}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if results.summary.recordType}
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'Type of DNS record that was traced'}>Record Type</div>
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.recordType.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.recordType.label')}
|
||||
</div>
|
||||
<div class="stat-value">{results.summary.recordType}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if results.summary.totalHops}
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'Number of DNS resolution hops from root to authoritative'}>
|
||||
Total Hops
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.totalHops.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.totalHops.label')}
|
||||
</div>
|
||||
<div class="stat-value">{results.summary.totalHops}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if results.summary.averageLatency}
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'Average response time per DNS query'}>Avg Latency</div>
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.avgLatency.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.avgLatency.label')}
|
||||
</div>
|
||||
<div class="stat-value">{results.summary.averageLatency}ms</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if results.summary.dnssecValid !== undefined}
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'DNSSEC validation status for the final response'}>
|
||||
DNSSEC Status
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.dnssecStatus.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.dnssecStatus.label')}
|
||||
</div>
|
||||
<div
|
||||
class="stat-value"
|
||||
@@ -296,14 +341,16 @@
|
||||
class:invalid={!results.summary.dnssecValid}
|
||||
>
|
||||
<Icon name={results.summary.dnssecValid ? 'shield-check' : 'shield-x'} size="sm" />
|
||||
{results.summary.dnssecValid ? 'Valid' : 'Not Validated'}
|
||||
{results.summary.dnssecValid
|
||||
? $t('diagnostics/dns-trace.results.summary.dnssecStatus.valid')
|
||||
: $t('diagnostics/dns-trace.results.summary.dnssecStatus.notValidated')}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if results.summary.authoritativeAnswer !== undefined}
|
||||
<div class="stat-card">
|
||||
<div class="stat-label" use:tooltip={'Whether the final answer came from an authoritative server'}>
|
||||
Authoritative
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.authoritative.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.authoritative.label')}
|
||||
</div>
|
||||
<div
|
||||
class="stat-value"
|
||||
@@ -311,22 +358,27 @@
|
||||
class:invalid={!results.summary.authoritativeAnswer}
|
||||
>
|
||||
<Icon name={results.summary.authoritativeAnswer ? 'check-circle' : 'x-circle'} size="sm" />
|
||||
{results.summary.authoritativeAnswer ? 'Yes' : 'No'}
|
||||
{results.summary.authoritativeAnswer
|
||||
? $t('diagnostics/dns-trace.results.summary.authoritative.yes')
|
||||
: $t('diagnostics/dns-trace.results.summary.authoritative.no')}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if results.summary.resolverPath}
|
||||
<div class="stat-card double-width">
|
||||
<div class="stat-label" use:tooltip={'The path taken through different DNS servers'}>
|
||||
Resolution Path
|
||||
<div
|
||||
class="stat-label"
|
||||
use:tooltip={$t('diagnostics/dns-trace.results.summary.resolutionPath.tooltip')}
|
||||
>
|
||||
{$t('diagnostics/dns-trace.results.summary.resolutionPath.label')}
|
||||
</div>
|
||||
<div class="stat-value mono resolver-path">{results.summary.resolverPath}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{#if results.summary.finalAnswer}
|
||||
<div class="stat-card double-width">
|
||||
<div class="stat-label" use:tooltip={'The final answer received from the authoritative server'}>
|
||||
Final Answer
|
||||
<div class="stat-label" use:tooltip={$t('diagnostics/dns-trace.results.summary.finalAnswer.tooltip')}>
|
||||
{$t('diagnostics/dns-trace.results.summary.finalAnswer.label')}
|
||||
</div>
|
||||
<div class="stat-value mono">
|
||||
{Array.isArray(results.summary.finalAnswer)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { useDiagnosticState, useClipboard, useExamples } from '$lib/composables';
|
||||
import ExamplesCard from '$lib/components/common/ExamplesCard.svelte';
|
||||
import ErrorCard from '$lib/components/common/ErrorCard.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domain = $state('gmail.com');
|
||||
@@ -10,14 +11,32 @@
|
||||
const diagnosticState = useDiagnosticState<any>();
|
||||
const clipboard = useClipboard();
|
||||
|
||||
const examplesList = [
|
||||
{ domain: 'gmail.com', description: 'Google Gmail DMARC policy' },
|
||||
{ domain: 'outlook.com', description: 'Microsoft Outlook DMARC setup' },
|
||||
{ domain: 'github.com', description: 'GitHub enterprise DMARC' },
|
||||
{ domain: 'paypal.com', description: 'PayPal strict DMARC policy' },
|
||||
{ domain: 'amazon.com', description: 'Amazon DMARC implementation' },
|
||||
{ domain: 'salesforce.com', description: 'Salesforce DMARC configuration' },
|
||||
];
|
||||
const examplesList = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/email-dmarc-check.examples.items.gmail.domain'),
|
||||
description: $t('diagnostics/email-dmarc-check.examples.items.gmail.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/email-dmarc-check.examples.items.outlook.domain'),
|
||||
description: $t('diagnostics/email-dmarc-check.examples.items.outlook.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/email-dmarc-check.examples.items.github.domain'),
|
||||
description: $t('diagnostics/email-dmarc-check.examples.items.github.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/email-dmarc-check.examples.items.paypal.domain'),
|
||||
description: $t('diagnostics/email-dmarc-check.examples.items.paypal.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/email-dmarc-check.examples.items.amazon.domain'),
|
||||
description: $t('diagnostics/email-dmarc-check.examples.items.amazon.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/email-dmarc-check.examples.items.salesforce.domain'),
|
||||
description: $t('diagnostics/email-dmarc-check.examples.items.salesforce.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
const examples = useExamples(examplesList);
|
||||
|
||||
@@ -41,7 +60,7 @@
|
||||
const data = await response.json();
|
||||
diagnosticState.setResults(data);
|
||||
} catch (err: unknown) {
|
||||
diagnosticState.setError(err instanceof Error ? err.message : 'Unknown error occurred');
|
||||
diagnosticState.setError(err instanceof Error ? err.message : $t('common.errors.unknownError'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,11 +148,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>Email DMARC Policy Checker</h1>
|
||||
<p>
|
||||
Check DMARC (Domain-based Message Authentication, Reporting & Conformance) policies with focus on email
|
||||
deliverability impact. Understand how DMARC affects your email delivery and reputation.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/email-dmarc-check.title')}</h1>
|
||||
<p>{$t('diagnostics/email-dmarc-check.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -141,26 +157,27 @@
|
||||
examples={examplesList}
|
||||
selectedIndex={examples.selectedIndex}
|
||||
onSelect={loadExample}
|
||||
title="DMARC Examples"
|
||||
title={$t('diagnostics/email-dmarc-check.examples.title')}
|
||||
getLabel={(ex) => ex.domain}
|
||||
getDescription={(ex) => ex.description}
|
||||
getTooltip={(ex) => `Check DMARC policy for ${ex.domain}`}
|
||||
getTooltip={(ex) =>
|
||||
$t('diagnostics/email-dmarc-check.examples.items.gmail.tooltip').replace('gmail.com', ex.domain)}
|
||||
/>
|
||||
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>DMARC Policy Check</h3>
|
||||
<h3>{$t('diagnostics/email-dmarc-check.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-group">
|
||||
<label for="domain">
|
||||
Domain Name
|
||||
{$t('diagnostics/email-dmarc-check.form.domainLabel')}
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domain}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/email-dmarc-check.form.domainPlaceholder')}
|
||||
onchange={() => {
|
||||
examples.clear();
|
||||
if (domain) checkDMARC();
|
||||
@@ -173,10 +190,10 @@
|
||||
<button class="check-btn lookup-btn" onclick={checkDMARC} disabled={diagnosticState.loading || !domain.trim()}>
|
||||
{#if diagnosticState.loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Checking DMARC...
|
||||
{$t('diagnostics/email-dmarc-check.form.checking')}
|
||||
{:else}
|
||||
<Icon name="shield-check" size="sm" />
|
||||
Check DMARC Policy
|
||||
{$t('diagnostics/email-dmarc-check.form.checkButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -187,10 +204,12 @@
|
||||
{#if diagnosticState.results && diagnosticState.results.hasRecord}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>DMARC Policy Analysis</h3>
|
||||
<h3>{$t('diagnostics/email-dmarc-check.results.title')}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={clipboard.isCopied()}>
|
||||
<Icon name={clipboard.isCopied() ? 'check' : 'copy'} size="xs" />
|
||||
{clipboard.isCopied() ? 'Copied!' : 'Copy Results'}
|
||||
{clipboard.isCopied()
|
||||
? $t('diagnostics/email-dmarc-check.results.copied')
|
||||
: $t('diagnostics/email-dmarc-check.results.copyButton')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
@@ -200,7 +219,7 @@
|
||||
<div class="deliverability-overview {getPolicyColor(diagnosticState.results.parsed.policy)}">
|
||||
<Icon name={getPolicyIcon(diagnosticState.results.parsed.policy)} size="md" />
|
||||
<div>
|
||||
<h4>Email Deliverability Impact</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.results.deliverability.title')}</h4>
|
||||
<p class="policy-impact">{diagnosticState.results.deliverabilityHints.policyImpact}</p>
|
||||
{#if diagnosticState.results.deliverabilityHints.alignmentComplexity?.strict}
|
||||
<p class="alignment-warning">
|
||||
@@ -215,7 +234,7 @@
|
||||
{@const hintsData = (diagnosticState.results as { deliverabilityHints: { recommendations: string[] } })
|
||||
.deliverabilityHints}
|
||||
<div class="recommendations-section">
|
||||
<h5>Deliverability Recommendations</h5>
|
||||
<h5>{$t('diagnostics/email-dmarc-check.results.deliverability.recommendations')}</h5>
|
||||
<div class="recommendation-list">
|
||||
{#each hintsData.recommendations as recommendation, recIndex (recIndex)}
|
||||
<div class="recommendation-item">
|
||||
@@ -230,7 +249,7 @@
|
||||
|
||||
<!-- DMARC Record -->
|
||||
<div class="record-section">
|
||||
<h4>DMARC Record</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.results.record.title')}</h4>
|
||||
<div class="record-display">
|
||||
<div class="record-location">_dmarc.{domain}</div>
|
||||
<code>{diagnosticState.results.record}</code>
|
||||
@@ -239,25 +258,25 @@
|
||||
|
||||
<!-- Policy Configuration -->
|
||||
<div class="policy-section">
|
||||
<h4>Policy Configuration</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.results.policy.title')}</h4>
|
||||
<div class="policy-grid">
|
||||
<!-- Main Policy -->
|
||||
<div class="policy-item {getPolicyColor(diagnosticState.results.parsed.policy)}">
|
||||
<div class="policy-header">
|
||||
<Icon name="shield" size="sm" />
|
||||
<span>Main Policy</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.policy.mainPolicy')}</span>
|
||||
</div>
|
||||
<div class="policy-value">
|
||||
<span class="policy-text">{diagnosticState.results.parsed.policy}</span>
|
||||
<span class="policy-description">
|
||||
{#if diagnosticState.results.parsed.policy === 'reject'}
|
||||
Reject non-compliant messages
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.values.reject')}
|
||||
{:else if diagnosticState.results.parsed.policy === 'quarantine'}
|
||||
Quarantine suspicious messages
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.values.quarantine')}
|
||||
{:else if diagnosticState.results.parsed.policy === 'none'}
|
||||
Monitor only, no action
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.values.none')}
|
||||
{:else}
|
||||
Unknown policy
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.values.unknown')}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
@@ -268,7 +287,7 @@
|
||||
<div class="policy-item {getPolicyColor(diagnosticState.results.parsed.subdomainPolicy)}">
|
||||
<div class="policy-header">
|
||||
<Icon name="git-branch" size="sm" />
|
||||
<span>Subdomain Policy</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.policy.subdomainPolicy')}</span>
|
||||
</div>
|
||||
<div class="policy-value">
|
||||
<span class="policy-text">{diagnosticState.results.parsed.subdomainPolicy}</span>
|
||||
@@ -284,11 +303,13 @@
|
||||
>
|
||||
<div class="policy-header">
|
||||
<Icon name="percent" size="sm" />
|
||||
<span>Coverage</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.policy.coverage')}</span>
|
||||
</div>
|
||||
<div class="policy-value">
|
||||
<span class="policy-text">{diagnosticState.results.parsed.percentage}%</span>
|
||||
<span class="policy-description">of messages affected</span>
|
||||
<span class="policy-description"
|
||||
>{$t('diagnostics/email-dmarc-check.results.policy.coverageDescription')}</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -296,16 +317,18 @@
|
||||
<div class="policy-item {getAlignmentColor(diagnosticState.results.parsed.alignment.dkim)}">
|
||||
<div class="policy-header">
|
||||
<Icon name="key" size="sm" />
|
||||
<span>DKIM Alignment</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.policy.dkimAlignment')}</span>
|
||||
</div>
|
||||
<div class="policy-value">
|
||||
<span class="policy-text"
|
||||
>{diagnosticState.results.parsed.alignment.dkim === 's' ? 'Strict' : 'Relaxed'}</span
|
||||
>{diagnosticState.results.parsed.alignment.dkim === 's'
|
||||
? $t('diagnostics/email-dmarc-check.results.policy.values.strict')
|
||||
: $t('diagnostics/email-dmarc-check.results.policy.values.relaxed')}</span
|
||||
>
|
||||
<span class="policy-description">
|
||||
{diagnosticState.results.parsed.alignment.dkim === 's'
|
||||
? 'Exact domain match required'
|
||||
: 'Organizational domain match allowed'}
|
||||
? $t('diagnostics/email-dmarc-check.results.policy.values.strictDescription')
|
||||
: $t('diagnostics/email-dmarc-check.results.policy.values.relaxedDescription')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -314,16 +337,18 @@
|
||||
<div class="policy-item {getAlignmentColor(diagnosticState.results.parsed.alignment.spf)}">
|
||||
<div class="policy-header">
|
||||
<Icon name="mail" size="sm" />
|
||||
<span>SPF Alignment</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.policy.spfAlignment')}</span>
|
||||
</div>
|
||||
<div class="policy-value">
|
||||
<span class="policy-text"
|
||||
>{diagnosticState.results.parsed.alignment.spf === 's' ? 'Strict' : 'Relaxed'}</span
|
||||
>{diagnosticState.results.parsed.alignment.spf === 's'
|
||||
? $t('diagnostics/email-dmarc-check.results.policy.values.strict')
|
||||
: $t('diagnostics/email-dmarc-check.results.policy.values.relaxed')}</span
|
||||
>
|
||||
<span class="policy-description">
|
||||
{diagnosticState.results.parsed.alignment.spf === 's'
|
||||
? 'Exact domain match required'
|
||||
: 'Organizational domain match allowed'}
|
||||
? $t('diagnostics/email-dmarc-check.results.policy.values.strictDescription')
|
||||
: $t('diagnostics/email-dmarc-check.results.policy.values.relaxedDescription')}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -332,21 +357,21 @@
|
||||
<div class="policy-item secondary">
|
||||
<div class="policy-header">
|
||||
<Icon name="settings" size="sm" />
|
||||
<span>Failure Options</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.policy.failureOptions')}</span>
|
||||
</div>
|
||||
<div class="policy-value">
|
||||
<span class="policy-text">{diagnosticState.results.parsed.reporting.failureOptions}</span>
|
||||
<span class="policy-description">
|
||||
{#if diagnosticState.results.parsed.reporting.failureOptions === '0'}
|
||||
DKIM and SPF failure
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.failureOptionsValues.0')}
|
||||
{:else if diagnosticState.results.parsed.reporting.failureOptions === '1'}
|
||||
Any alignment failure
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.failureOptionsValues.1')}
|
||||
{:else if diagnosticState.results.parsed.reporting.failureOptions === 'd'}
|
||||
DKIM failure only
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.failureOptionsValues.d')}
|
||||
{:else if diagnosticState.results.parsed.reporting.failureOptions === 's'}
|
||||
SPF failure only
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.failureOptionsValues.s')}
|
||||
{:else}
|
||||
Custom configuration
|
||||
{$t('diagnostics/email-dmarc-check.results.policy.failureOptionsValues.custom')}
|
||||
{/if}
|
||||
</span>
|
||||
</div>
|
||||
@@ -356,20 +381,26 @@
|
||||
|
||||
<!-- Reporting Configuration -->
|
||||
<div class="reporting-section">
|
||||
<h4>Email Reporting Configuration</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.results.reporting.title')}</h4>
|
||||
<div class="reporting-grid">
|
||||
<div class="reporting-item">
|
||||
<div class="reporting-header">
|
||||
<Icon name="bar-chart" size="sm" />
|
||||
<span>Aggregate Reports (RUA)</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.reporting.aggregateTitle')}</span>
|
||||
</div>
|
||||
<div class="reporting-value">
|
||||
{#if diagnosticState.results.parsed.reporting.aggregate}
|
||||
<span class="email-address">{diagnosticState.results.parsed.reporting.aggregate}</span>
|
||||
<span class="reporting-description">Daily summaries of DMARC activity</span>
|
||||
<span class="reporting-description"
|
||||
>{$t('diagnostics/email-dmarc-check.results.reporting.aggregateDescription')}</span
|
||||
>
|
||||
{:else}
|
||||
<span class="not-configured">Not configured</span>
|
||||
<span class="reporting-description">Missing aggregate reporting - consider adding rua=</span>
|
||||
<span class="not-configured"
|
||||
>{$t('diagnostics/email-dmarc-check.results.reporting.aggregateNotConfigured')}</span
|
||||
>
|
||||
<span class="reporting-description"
|
||||
>{$t('diagnostics/email-dmarc-check.results.reporting.aggregateNotConfiguredHint')}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -377,15 +408,21 @@
|
||||
<div class="reporting-item">
|
||||
<div class="reporting-header">
|
||||
<Icon name="search" size="sm" />
|
||||
<span>Forensic Reports (RUF)</span>
|
||||
<span>{$t('diagnostics/email-dmarc-check.results.reporting.forensicTitle')}</span>
|
||||
</div>
|
||||
<div class="reporting-value">
|
||||
{#if diagnosticState.results.parsed.reporting.forensic}
|
||||
<span class="email-address">{diagnosticState.results.parsed.reporting.forensic}</span>
|
||||
<span class="reporting-description">Real-time failure reports with message samples</span>
|
||||
<span class="reporting-description"
|
||||
>{$t('diagnostics/email-dmarc-check.results.reporting.forensicDescription')}</span
|
||||
>
|
||||
{:else}
|
||||
<span class="not-configured">Not configured</span>
|
||||
<span class="reporting-description">Optional - provides detailed failure analysis</span>
|
||||
<span class="not-configured"
|
||||
>{$t('diagnostics/email-dmarc-check.results.reporting.forensicNotConfigured')}</span
|
||||
>
|
||||
<span class="reporting-description"
|
||||
>{$t('diagnostics/email-dmarc-check.results.reporting.forensicNotConfiguredHint')}</span
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -403,15 +440,15 @@
|
||||
<div class="warning-content">
|
||||
<Icon name="shield-x" size="md" />
|
||||
<div>
|
||||
<strong>No DMARC Record Found</strong>
|
||||
<p>Domain <code>{domain}</code> does not have a DMARC policy configured at <code>_dmarc.{domain}</code>.</p>
|
||||
<strong>{$t('diagnostics/email-dmarc-check.noRecord.title')}</strong>
|
||||
<p>{$t('diagnostics/email-dmarc-check.noRecord.message', { domain })}</p>
|
||||
<div class="deliverability-impact">
|
||||
<h5>Email Deliverability Impact:</h5>
|
||||
<h5>{$t('diagnostics/email-dmarc-check.noRecord.impactTitle')}</h5>
|
||||
<ul>
|
||||
<li>No protection against email spoofing</li>
|
||||
<li>May affect email reputation with major providers</li>
|
||||
<li>Missing visibility into email authentication failures</li>
|
||||
<li>Consider implementing DMARC starting with p=none for monitoring</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.noRecord.impacts.noProtection')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.noRecord.impacts.reputation')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.noRecord.impacts.visibility')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.noRecord.impacts.recommendation')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -420,60 +457,65 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<ErrorCard title="DMARC Check Failed" error={diagnosticState.error} />
|
||||
<ErrorCard title={$t('diagnostics/email-dmarc-check.error.title')} error={diagnosticState.error} />
|
||||
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>Understanding DMARC for Email Delivery</h3>
|
||||
<h3>{$t('diagnostics/email-dmarc-check.education.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>DMARC Policies & Email Impact</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.education.policiesTitle')}</h4>
|
||||
<div class="policy-explanations">
|
||||
<div class="explanation-item">
|
||||
<strong>none:</strong> Monitor mode - no delivery impact, collect data only
|
||||
<strong>none:</strong>
|
||||
{$t('diagnostics/email-dmarc-check.education.policies.none').replace('none: ', '')}
|
||||
</div>
|
||||
<div class="explanation-item">
|
||||
<strong>quarantine:</strong> Failed messages may go to spam/junk folder
|
||||
<strong>quarantine:</strong>
|
||||
{$t('diagnostics/email-dmarc-check.education.policies.quarantine').replace('quarantine: ', '')}
|
||||
</div>
|
||||
<div class="explanation-item">
|
||||
<strong>reject:</strong> Failed messages rejected outright - strongest protection
|
||||
<strong>reject:</strong>
|
||||
{$t('diagnostics/email-dmarc-check.education.policies.reject').replace('reject: ', '')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Email Delivery Best Practices</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.education.bestPracticesTitle')}</h4>
|
||||
<ul>
|
||||
<li>Start with p=none to monitor before enforcement</li>
|
||||
<li>Gradually increase to p=quarantine then p=reject</li>
|
||||
<li>Set up aggregate reporting to monitor delivery</li>
|
||||
<li>Test alignment requirements carefully</li>
|
||||
<li>Consider subdomain policy for comprehensive coverage</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.bestPractices.startNone')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.bestPractices.gradual')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.bestPractices.reporting')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.bestPractices.testAlignment')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.bestPractices.subdomain')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Alignment Modes & Delivery</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.education.alignmentTitle')}</h4>
|
||||
<div class="alignment-explanations">
|
||||
<div class="explanation-item">
|
||||
<strong>Relaxed (r):</strong> Allows organizational domain matching (safer for delivery)
|
||||
<strong>Relaxed (r):</strong>
|
||||
{$t('diagnostics/email-dmarc-check.education.alignment.relaxed').replace('Relaxed (r): ', '')}
|
||||
</div>
|
||||
<div class="explanation-item">
|
||||
<strong>Strict (s):</strong> Requires exact domain matching (higher security, delivery risk)
|
||||
<strong>Strict (s):</strong>
|
||||
{$t('diagnostics/email-dmarc-check.education.alignment.strict').replace('Strict (s): ', '')}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Common Delivery Issues</h4>
|
||||
<h4>{$t('diagnostics/email-dmarc-check.education.issuesTitle')}</h4>
|
||||
<ul>
|
||||
<li>Strict alignment with third-party senders</li>
|
||||
<li>Forwarded emails failing DMARC checks</li>
|
||||
<li>Mailing lists modifying message headers</li>
|
||||
<li>Percentage rollout causing inconsistent delivery</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.issues.thirdParty')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.issues.forwarding')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.issues.mailingLists')}</li>
|
||||
<li>{$t('diagnostics/email-dmarc-check.education.issues.percentage')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import ActionButton from '$lib/components/common/ActionButton.svelte';
|
||||
import ResultsCard from '$lib/components/common/ResultsCard.svelte';
|
||||
import ErrorCard from '$lib/components/common/ErrorCard.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let url = $state('https://api.github.com');
|
||||
@@ -18,20 +19,32 @@
|
||||
|
||||
const methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'];
|
||||
|
||||
const examplesList = [
|
||||
{ url: 'https://api.github.com', origin: 'https://example.com', description: 'GitHub API CORS policy' },
|
||||
{ url: 'https://httpbin.org/get', origin: 'https://test.com', description: 'HTTPBin CORS test' },
|
||||
const examplesList = $derived([
|
||||
{
|
||||
url: 'https://api.github.com',
|
||||
origin: 'https://example.com',
|
||||
description: $t('diagnostics/http-cors-check.examples.github'),
|
||||
tooltip: `Test CORS policy for https://api.github.com`,
|
||||
},
|
||||
{
|
||||
url: 'https://httpbin.org/get',
|
||||
origin: 'https://test.com',
|
||||
description: $t('diagnostics/http-cors-check.examples.httpbin'),
|
||||
tooltip: `Test CORS policy for https://httpbin.org/get`,
|
||||
},
|
||||
{
|
||||
url: 'https://api.open-meteo.com/v1/forecast?latitude=52.52&longitude=13.41¤t=temperature_2m',
|
||||
origin: 'https://weather-app.com',
|
||||
description: 'Open weather API',
|
||||
description: $t('diagnostics/http-cors-check.examples.weather'),
|
||||
tooltip: `Test CORS policy for Open weather API`,
|
||||
},
|
||||
{
|
||||
url: 'https://jsonplaceholder.typicode.com/posts/1',
|
||||
origin: 'https://example.org',
|
||||
description: 'JSON Placeholder API',
|
||||
description: $t('diagnostics/http-cors-check.examples.placeholder'),
|
||||
tooltip: `Test CORS policy for JSON Placeholder API`,
|
||||
},
|
||||
];
|
||||
]);
|
||||
|
||||
const examples = useExamples(examplesList);
|
||||
|
||||
@@ -59,12 +72,12 @@
|
||||
const trimmedOrigin = origin.trim();
|
||||
|
||||
if (!trimmedUrl) {
|
||||
diagnosticState.setError('URL is required');
|
||||
diagnosticState.setError($t('diagnostics/http-cors-check.form.url.required'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!trimmedOrigin) {
|
||||
diagnosticState.setError('Origin is required');
|
||||
diagnosticState.setError($t('diagnostics/http-cors-check.form.origin.required'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,7 +85,7 @@
|
||||
new URL(trimmedUrl);
|
||||
new URL(trimmedOrigin);
|
||||
} catch {
|
||||
diagnosticState.setError('Invalid URL or Origin format');
|
||||
diagnosticState.setError($t('diagnostics/http-cors-check.form.origin.invalid'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -178,11 +191,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>CORS Policy Checker</h1>
|
||||
<p>
|
||||
Test Cross-Origin Resource Sharing (CORS) policies by sending preflight requests and analyzing the server's CORS
|
||||
configuration. Check if your origin is allowed to access the target resource.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/http-cors-check.title')}</h1>
|
||||
<p>{$t('diagnostics/http-cors-check.description')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -190,27 +200,27 @@
|
||||
examples={examplesList}
|
||||
selectedIndex={examples.selectedIndex}
|
||||
onSelect={loadExample}
|
||||
title="CORS Examples"
|
||||
getLabel={(ex) => ex.url}
|
||||
getDescription={(ex) => ex.description}
|
||||
getTooltip={(ex) => `Test CORS policy for ${ex.url}`}
|
||||
title={$t('diagnostics/http-cors-check.examples.title')}
|
||||
getLabel={(ex: { url: string }) => ex.url}
|
||||
getDescription={(ex: { description: string }) => ex.description}
|
||||
getTooltip={(ex: { tooltip: string }) => ex.tooltip}
|
||||
/>
|
||||
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>CORS Test Configuration</h3>
|
||||
<h3>{$t('diagnostics/http-cors-check.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="url" use:tooltip={'Target API/resource URL to test CORS against'}>
|
||||
Target URL
|
||||
<label for="url" use:tooltip={$t('diagnostics/http-cors-check.form.url.tooltip')}>
|
||||
{$t('diagnostics/http-cors-check.form.url.label')}
|
||||
<input
|
||||
id="url"
|
||||
type="url"
|
||||
bind:value={url}
|
||||
placeholder="https://api.example.com"
|
||||
placeholder={$t('diagnostics/http-cors-check.form.url.placeholder')}
|
||||
class:invalid={url && !isInputValid()}
|
||||
onchange={() => {
|
||||
examples.clear();
|
||||
@@ -218,19 +228,19 @@
|
||||
}}
|
||||
/>
|
||||
{#if url && !isInputValid()}
|
||||
<span class="error-text">Invalid URL format</span>
|
||||
<span class="error-text">{$t('diagnostics/http-cors-check.form.url.error')}</span>
|
||||
{/if}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="origin" use:tooltip={"Your website's origin (where the request would come from)"}>
|
||||
Origin
|
||||
<label for="origin" use:tooltip={$t('diagnostics/http-cors-check.form.origin.tooltip')}>
|
||||
{$t('diagnostics/http-cors-check.form.origin.label')}
|
||||
<input
|
||||
id="origin"
|
||||
type="url"
|
||||
bind:value={origin}
|
||||
placeholder="https://yoursite.com"
|
||||
placeholder={$t('diagnostics/http-cors-check.form.origin.placeholder')}
|
||||
class:invalid={origin && !isInputValid}
|
||||
onchange={() => {
|
||||
examples.clear();
|
||||
@@ -238,14 +248,14 @@
|
||||
}}
|
||||
/>
|
||||
{#if origin && !isInputValid}
|
||||
<span class="error-text">Invalid origin format</span>
|
||||
<span class="error-text">{$t('diagnostics/http-cors-check.form.origin.error')}</span>
|
||||
{/if}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="method" use:tooltip={'HTTP method to test in preflight request'}>
|
||||
Method
|
||||
<label for="method" use:tooltip={$t('diagnostics/http-cors-check.form.method.tooltip')}>
|
||||
{$t('diagnostics/http-cors-check.form.method.label')}
|
||||
<select
|
||||
id="method"
|
||||
bind:value={method}
|
||||
@@ -415,7 +425,7 @@
|
||||
</ResultsCard>
|
||||
{/if}
|
||||
|
||||
<ErrorCard title="CORS Check Failed" error={diagnosticState.error} />
|
||||
<ErrorCard title={$t('diagnostics/http-cors-check.error.title')} error={diagnosticState.error} />
|
||||
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import { asnGeoContent } from '$lib/content/asn-geo';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
@@ -32,14 +33,32 @@
|
||||
let copiedState = $state(false);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ ip: '8.8.8.8', description: 'Google Public DNS' },
|
||||
{ ip: '2.58.47.0', description: 'M247 Proton' },
|
||||
{ ip: '1.1.1.1', description: 'Cloudflare DNS' },
|
||||
{ ip: '140.82.121.4', description: 'GitHub' },
|
||||
{ ip: '151.101.1.140', description: 'Fastly CDN' },
|
||||
{ ip: '2606:4700:4700::1111', description: 'Cloudflare IPv6' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
ip: $t('diagnostics/network-asn-geo-lookup.examples.items.googleDNS.ip'),
|
||||
description: $t('diagnostics/network-asn-geo-lookup.examples.items.googleDNS.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/network-asn-geo-lookup.examples.items.m247.ip'),
|
||||
description: $t('diagnostics/network-asn-geo-lookup.examples.items.m247.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/network-asn-geo-lookup.examples.items.cloudflareDNS.ip'),
|
||||
description: $t('diagnostics/network-asn-geo-lookup.examples.items.cloudflareDNS.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/network-asn-geo-lookup.examples.items.github.ip'),
|
||||
description: $t('diagnostics/network-asn-geo-lookup.examples.items.github.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/network-asn-geo-lookup.examples.items.fastly.ip'),
|
||||
description: $t('diagnostics/network-asn-geo-lookup.examples.items.fastly.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/network-asn-geo-lookup.examples.items.cloudflareIPv6.ip'),
|
||||
description: $t('diagnostics/network-asn-geo-lookup.examples.items.cloudflareIPv6.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function lookupIP() {
|
||||
loading = true;
|
||||
@@ -113,8 +132,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>{asnGeoContent.title}</h1>
|
||||
<p>{asnGeoContent.description}</p>
|
||||
<h1>{$t('diagnostics/network-asn-geo-lookup.title')}</h1>
|
||||
<p>{$t('diagnostics/network-asn-geo-lookup.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -122,7 +141,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Example Lookups</h4>
|
||||
<h4>{$t('diagnostics/network-asn-geo-lookup.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -130,7 +149,9 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Look up ${example.ip}`}
|
||||
use:tooltip={$t(
|
||||
`diagnostics/network-asn-geo-lookup.examples.items.${['googleDNS', 'm247', 'cloudflareDNS', 'github', 'fastly', 'cloudflareIPv6'][i]}.tooltip`,
|
||||
)}
|
||||
>
|
||||
<h5>{example.ip}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -143,17 +164,19 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>IP Lookup</h3>
|
||||
<h3>{$t('diagnostics/network-asn-geo-lookup.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="lookup-form">
|
||||
<div class="input-row">
|
||||
<label for="ip" use:tooltip={'Enter an IPv4 or IPv6 address'}> IP Address </label>
|
||||
<label for="ip" use:tooltip={$t('diagnostics/network-asn-geo-lookup.form.ipTooltip')}>
|
||||
{$t('diagnostics/network-asn-geo-lookup.form.ipLabel')}
|
||||
</label>
|
||||
<input
|
||||
id="ip"
|
||||
type="text"
|
||||
bind:value={ip}
|
||||
placeholder="8.8.8.8 or 2001:4860:4860::8888"
|
||||
placeholder={$t('diagnostics/network-asn-geo-lookup.form.ipPlaceholder')}
|
||||
onchange={() => {
|
||||
clearExampleSelection();
|
||||
if (ip.trim()) lookupIP();
|
||||
@@ -163,10 +186,10 @@
|
||||
<button class="lookup-btn" onclick={lookupIP} disabled={loading || !ip.trim()}>
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Looking up...
|
||||
{$t('diagnostics/network-asn-geo-lookup.form.lookingUp')}
|
||||
{:else}
|
||||
<Icon name="search" size="sm" />
|
||||
Lookup
|
||||
{$t('diagnostics/network-asn-geo-lookup.form.lookupButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -177,23 +200,25 @@
|
||||
{#if results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>Results for {results.ip}</h3>
|
||||
<h3>{$t('diagnostics/network-asn-geo-lookup.results.title', { ip: results.ip })}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={copiedState}>
|
||||
<Icon name={copiedState ? 'check' : 'copy'} size="xs" />
|
||||
{copiedState ? 'Copied!' : 'Copy Results'}
|
||||
{copiedState
|
||||
? $t('diagnostics/network-asn-geo-lookup.results.copied')
|
||||
: $t('diagnostics/network-asn-geo-lookup.results.copyButton')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="results-grid">
|
||||
<!-- Network Information -->
|
||||
<div class="result-card">
|
||||
<h4>Network Information</h4>
|
||||
<h4>{$t('diagnostics/network-asn-geo-lookup.results.networkInfo.title')}</h4>
|
||||
<div class="info-list">
|
||||
{#if results.asn}
|
||||
<div class="info-item">
|
||||
<Icon name="hash" size="sm" />
|
||||
<div class="info-content">
|
||||
<span class="info-label">ASN</span>
|
||||
<span class="info-label">{$t('diagnostics/network-asn-geo-lookup.results.networkInfo.asn')}</span>
|
||||
<span class="info-value asn-badge">AS{results.asn}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -202,7 +227,9 @@
|
||||
<div class="info-item">
|
||||
<Icon name="building" size="sm" />
|
||||
<div class="info-content">
|
||||
<span class="info-label">Organization</span>
|
||||
<span class="info-label"
|
||||
>{$t('diagnostics/network-asn-geo-lookup.results.networkInfo.organization')}</span
|
||||
>
|
||||
<span class="info-value">{results.asnOrg}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -211,7 +238,7 @@
|
||||
<div class="info-item">
|
||||
<Icon name="wifi" size="sm" />
|
||||
<div class="info-content">
|
||||
<span class="info-label">ISP</span>
|
||||
<span class="info-label">{$t('diagnostics/network-asn-geo-lookup.results.networkInfo.isp')}</span>
|
||||
<span class="info-value">{results.isp}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -221,13 +248,15 @@
|
||||
|
||||
<!-- Geographic Location -->
|
||||
<div class="result-card">
|
||||
<h4>Geographic Location</h4>
|
||||
<h4>{$t('diagnostics/network-asn-geo-lookup.results.geoLocation.title')}</h4>
|
||||
<div class="info-list">
|
||||
{#if results.country}
|
||||
<div class="info-item">
|
||||
<Icon name="flag" size="sm" />
|
||||
<div class="info-content">
|
||||
<span class="info-label">Country</span>
|
||||
<span class="info-label"
|
||||
>{$t('diagnostics/network-asn-geo-lookup.results.geoLocation.country')}</span
|
||||
>
|
||||
<span class="info-value">{results.country} ({results.countryCode})</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -236,7 +265,8 @@
|
||||
<div class="info-item">
|
||||
<Icon name="map-pin" size="sm" />
|
||||
<div class="info-content">
|
||||
<span class="info-label">Region</span>
|
||||
<span class="info-label">{$t('diagnostics/network-asn-geo-lookup.results.geoLocation.region')}</span
|
||||
>
|
||||
<span class="info-value">{results.regionName}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -245,7 +275,7 @@
|
||||
<div class="info-item">
|
||||
<Icon name="building" size="sm" />
|
||||
<div class="info-content">
|
||||
<span class="info-label">City</span>
|
||||
<span class="info-label">{$t('diagnostics/network-asn-geo-lookup.results.geoLocation.city')}</span>
|
||||
<span class="info-value">{results.city}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -254,7 +284,9 @@
|
||||
<div class="info-item">
|
||||
<Icon name="clock" size="sm" />
|
||||
<div class="info-content">
|
||||
<span class="info-label">Timezone</span>
|
||||
<span class="info-label"
|
||||
>{$t('diagnostics/network-asn-geo-lookup.results.geoLocation.timezone')}</span
|
||||
>
|
||||
<span class="info-value">{results.timezone}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -265,18 +297,22 @@
|
||||
<!-- Coordinates -->
|
||||
{#if results.latitude !== undefined && results.longitude !== undefined}
|
||||
<div class="result-card">
|
||||
<h4>Coordinates</h4>
|
||||
<h4>{$t('diagnostics/network-asn-geo-lookup.results.coordinates.title')}</h4>
|
||||
<div class="coordinates-display">
|
||||
<div class="coordinate-info">
|
||||
<div class="coordinate-item">
|
||||
<Icon name="navigation" size="md" />
|
||||
<div class="coordinate-values">
|
||||
<div class="coordinate-row">
|
||||
<span class="coordinate-label">Latitude:</span>
|
||||
<span class="coordinate-label"
|
||||
>{$t('diagnostics/network-asn-geo-lookup.results.coordinates.latitude')}</span
|
||||
>
|
||||
<span class="coordinate-value">{results.latitude.toFixed(4)}°</span>
|
||||
</div>
|
||||
<div class="coordinate-row">
|
||||
<span class="coordinate-label">Longitude:</span>
|
||||
<span class="coordinate-label"
|
||||
>{$t('diagnostics/network-asn-geo-lookup.results.coordinates.longitude')}</span
|
||||
>
|
||||
<span class="coordinate-value">{results.longitude.toFixed(4)}°</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -288,7 +324,7 @@
|
||||
class="map-link"
|
||||
>
|
||||
<Icon name="external-link" size="xs" />
|
||||
View full map
|
||||
{$t('diagnostics/network-asn-geo-lookup.results.coordinates.viewMap')}
|
||||
</a>
|
||||
</div>
|
||||
<div class="map-container">
|
||||
@@ -304,19 +340,19 @@
|
||||
|
||||
<!-- Connection Type -->
|
||||
<div class="result-card">
|
||||
<h4>Connection Type</h4>
|
||||
<h4>{$t('diagnostics/network-asn-geo-lookup.results.connectionType.title')}</h4>
|
||||
<div class="connection-flags">
|
||||
<div class="flag-item" class:active={results.mobile}>
|
||||
<Icon name={results.mobile ? 'check-circle' : 'circle'} size="sm" />
|
||||
<span>Mobile Network</span>
|
||||
<span>{$t('diagnostics/network-asn-geo-lookup.results.connectionType.mobile')}</span>
|
||||
</div>
|
||||
<div class="flag-item" class:active={results.proxy}>
|
||||
<Icon name={results.proxy ? 'check-circle' : 'circle'} size="sm" />
|
||||
<span>Proxy/VPN</span>
|
||||
<span>{$t('diagnostics/network-asn-geo-lookup.results.connectionType.proxy')}</span>
|
||||
</div>
|
||||
<div class="flag-item" class:active={results.hosting}>
|
||||
<Icon name={results.hosting ? 'check-circle' : 'circle'} size="sm" />
|
||||
<span>Hosting/Datacenter</span>
|
||||
<span>{$t('diagnostics/network-asn-geo-lookup.results.connectionType.hosting')}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -331,7 +367,7 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>Lookup Failed</strong>
|
||||
<strong>{$t('diagnostics/network-asn-geo-lookup.error.title')}</strong>
|
||||
<p>{error}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -342,7 +378,7 @@
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>About ASN & Geolocation</h3>
|
||||
<h3>{$t('diagnostics/network-asn-geo-lookup.info.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
@@ -375,7 +411,7 @@
|
||||
</div>
|
||||
|
||||
<div class="quick-tips">
|
||||
<h4>Quick Tips</h4>
|
||||
<h4>{$t('diagnostics/network-asn-geo-lookup.info.quickTips.title')}</h4>
|
||||
<ul>
|
||||
{#each asnGeoContent.quickTips as tip, idx (idx)}
|
||||
<li>{tip}</li>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import { useDiagnosticState, useClipboard, useExamples } from '$lib/composables';
|
||||
import ExamplesCard from '$lib/components/common/ExamplesCard.svelte';
|
||||
import ErrorCard from '$lib/components/common/ErrorCard.svelte';
|
||||
@@ -12,45 +13,77 @@
|
||||
const diagnosticState = useDiagnosticState<any>();
|
||||
const clipboard = useClipboard();
|
||||
|
||||
const examplesList = [
|
||||
const examplesList = $derived([
|
||||
{
|
||||
targets: 'google.com:443\ngithub.com:443\nstackoverflow.com:443',
|
||||
description: 'Common HTTPS ports',
|
||||
targets: $t('diagnostics/network-tcp-port-check.examples.items.https.targets'),
|
||||
description: $t('diagnostics/network-tcp-port-check.examples.items.https.description'),
|
||||
},
|
||||
{
|
||||
targets: 'smtp.gmail.com:587\nsmtp.gmail.com:465\nsmtp.gmail.com:25',
|
||||
description: 'Gmail SMTP ports',
|
||||
targets: $t('diagnostics/network-tcp-port-check.examples.items.smtp.targets'),
|
||||
description: $t('diagnostics/network-tcp-port-check.examples.items.smtp.description'),
|
||||
},
|
||||
{
|
||||
targets: 'dns.google:53\n1.1.1.1:53\n8.8.8.8:53',
|
||||
description: 'DNS server ports',
|
||||
targets: $t('diagnostics/network-tcp-port-check.examples.items.dns.targets'),
|
||||
description: $t('diagnostics/network-tcp-port-check.examples.items.dns.description'),
|
||||
},
|
||||
{
|
||||
targets: 'reddit.com:80\nreddit.com:443\napi.reddit.com:443',
|
||||
description: 'HTTP vs HTTPS ports',
|
||||
targets: $t('diagnostics/network-tcp-port-check.examples.items.httpVsHttps.targets'),
|
||||
description: $t('diagnostics/network-tcp-port-check.examples.items.httpVsHttps.description'),
|
||||
},
|
||||
{
|
||||
targets: 'localhost:22\nlocalhost:80\nlocalhost:443\nlocalhost:3306\nlocalhost:5432',
|
||||
description: 'Local development ports',
|
||||
targets: $t('diagnostics/network-tcp-port-check.examples.items.localDev.targets'),
|
||||
description: $t('diagnostics/network-tcp-port-check.examples.items.localDev.description'),
|
||||
},
|
||||
{
|
||||
targets: 'microsoft.com:443\noffice.com:443\noutlook.com:443',
|
||||
description: 'Microsoft services',
|
||||
targets: $t('diagnostics/network-tcp-port-check.examples.items.microsoft.targets'),
|
||||
description: $t('diagnostics/network-tcp-port-check.examples.items.microsoft.description'),
|
||||
},
|
||||
];
|
||||
]);
|
||||
|
||||
const examples = useExamples(examplesList);
|
||||
|
||||
const commonPorts = [
|
||||
{ port: '22', service: 'SSH', description: 'Secure Shell' },
|
||||
{ port: '80', service: 'HTTP', description: 'Web traffic' },
|
||||
{ port: '443', service: 'HTTPS', description: 'Secure web traffic' },
|
||||
{ port: '25', service: 'SMTP', description: 'Email sending' },
|
||||
{ port: '587', service: 'SMTP', description: 'Email submission' },
|
||||
{ port: '993', service: 'IMAPS', description: 'Secure IMAP' },
|
||||
{ port: '995', service: 'POP3S', description: 'Secure POP3' },
|
||||
{ port: '53', service: 'DNS', description: 'Domain resolution' },
|
||||
];
|
||||
const commonPorts = $derived([
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.ssh.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.ssh.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.ssh.description'),
|
||||
},
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.http.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.http.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.http.description'),
|
||||
},
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.https.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.https.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.https.description'),
|
||||
},
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.smtp.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.smtp.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.smtp.description'),
|
||||
},
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.smtpSubmission.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.smtpSubmission.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.smtpSubmission.description'),
|
||||
},
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.imaps.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.imaps.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.imaps.description'),
|
||||
},
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.pop3s.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.pop3s.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.pop3s.description'),
|
||||
},
|
||||
{
|
||||
port: $t('diagnostics/network-tcp-port-check.commonPorts.dns.port'),
|
||||
service: $t('diagnostics/network-tcp-port-check.commonPorts.dns.service'),
|
||||
description: $t('diagnostics/network-tcp-port-check.commonPorts.dns.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
// Reactive validation
|
||||
const targetsList = $derived(() => {
|
||||
@@ -127,13 +160,13 @@
|
||||
return {
|
||||
icon: 'check-circle',
|
||||
class: 'success',
|
||||
text: `Open (${result.latency}ms)`,
|
||||
text: $t('diagnostics/network-tcp-port-check.results.statusOpen', { latency: result.latency || 0 }),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
icon: 'x-circle',
|
||||
class: 'error',
|
||||
text: result.error || 'Closed',
|
||||
text: result.error || $t('diagnostics/network-tcp-port-check.results.statusClosed'),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -167,11 +200,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>TCP Port Checker</h1>
|
||||
<p>
|
||||
Test TCP connectivity to one or more host:port combinations. Attempts direct TCP connections to check if ports are
|
||||
open and measures connection latency.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/network-tcp-port-check.title')}</h1>
|
||||
<p>{$t('diagnostics/network-tcp-port-check.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -179,7 +209,7 @@
|
||||
examples={examplesList}
|
||||
selectedIndex={examples.selectedIndex}
|
||||
onSelect={loadExample}
|
||||
title="Port Check Examples"
|
||||
title={$t('diagnostics/network-tcp-port-check.examples.title')}
|
||||
getLabel={(ex) => ex.description}
|
||||
getDescription={(ex) => {
|
||||
const targets = ex.targets.split('\n');
|
||||
@@ -192,17 +222,17 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>Port Check Configuration</h3>
|
||||
<h3>{$t('diagnostics/network-tcp-port-check.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="targets" use:tooltip={'Enter host:port combinations, one per line (max 50)'}>
|
||||
Target Hosts & Ports
|
||||
<label for="targets" use:tooltip={$t('diagnostics/network-tcp-port-check.form.targetsTooltip')}>
|
||||
{$t('diagnostics/network-tcp-port-check.form.targetsLabel')}
|
||||
<textarea
|
||||
id="targets"
|
||||
bind:value={targets}
|
||||
placeholder="google.com:443 github.com:22 example.com:80"
|
||||
placeholder={$t('diagnostics/network-tcp-port-check.form.targetsPlaceholder')}
|
||||
rows="6"
|
||||
class:invalid={targets && !isInputValid()}
|
||||
onchange={() => {
|
||||
@@ -211,9 +241,11 @@
|
||||
}}
|
||||
></textarea>
|
||||
<div class="input-help">
|
||||
<span class="target-count">{targetsList.length}/50 targets</span>
|
||||
<span class="target-count"
|
||||
>{$t('diagnostics/network-tcp-port-check.form.targetCount', { count: targetsList().length })}</span
|
||||
>
|
||||
{#if targets && !isInputValid}
|
||||
<span class="error-text">Use format: hostname:port (one per line)</span>
|
||||
<span class="error-text">{$t('diagnostics/network-tcp-port-check.form.invalidFormat')}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</label>
|
||||
@@ -223,7 +255,7 @@
|
||||
<!-- Common Ports -->
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<h3>Common Ports</h3>
|
||||
<h3>{$t('diagnostics/network-tcp-port-check.form.commonPortsTitle')}</h3>
|
||||
<div class="port-shortcuts">
|
||||
{#each commonPorts as port, index (index)}
|
||||
<button
|
||||
@@ -241,8 +273,8 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="timeout" use:tooltip={'Connection timeout in milliseconds'}>
|
||||
Timeout (ms)
|
||||
<label for="timeout" use:tooltip={$t('diagnostics/network-tcp-port-check.form.timeoutTooltip')}>
|
||||
{$t('diagnostics/network-tcp-port-check.form.timeoutLabel')}
|
||||
<input
|
||||
id="timeout"
|
||||
type="number"
|
||||
@@ -263,10 +295,10 @@
|
||||
<button class="lookup-btn" onclick={checkPorts} disabled={diagnosticState.loading || !isInputValid()}>
|
||||
{#if diagnosticState.loading}
|
||||
<Icon name="loader-2" size="sm" animate="spin" />
|
||||
Checking Ports...
|
||||
{$t('diagnostics/network-tcp-port-check.form.checking')}
|
||||
{:else}
|
||||
<Icon name="activity" size="sm" />
|
||||
Check Ports
|
||||
{$t('diagnostics/network-tcp-port-check.form.checkButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -277,10 +309,12 @@
|
||||
{#if diagnosticState.results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>Port Check Results</h3>
|
||||
<h3>{$t('diagnostics/network-tcp-port-check.results.title')}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={clipboard.isCopied()}>
|
||||
<Icon name={clipboard.isCopied() ? 'check' : 'copy'} size="xs" />
|
||||
{clipboard.isCopied() ? 'Copied!' : 'Copy Results'}
|
||||
{clipboard.isCopied()
|
||||
? $t('diagnostics/network-tcp-port-check.results.copied')
|
||||
: $t('diagnostics/network-tcp-port-check.results.copyButton')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
@@ -289,23 +323,35 @@
|
||||
<div class="status-item success">
|
||||
<Icon name="check-circle" size="sm" />
|
||||
<div>
|
||||
<span class="status-title">{diagnosticState.results.summary.open} Open</span>
|
||||
<p class="status-desc">Ports accepting connections</p>
|
||||
<span class="status-title"
|
||||
>{$t('diagnostics/network-tcp-port-check.results.summaryOpenPorts', {
|
||||
count: diagnosticState.results.summary.open,
|
||||
})}</span
|
||||
>
|
||||
<p class="status-desc">{$t('diagnostics/network-tcp-port-check.results.openPortsDescription')}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="status-item error">
|
||||
<Icon name="x-circle" size="sm" />
|
||||
<div>
|
||||
<span class="status-title">{diagnosticState.results.summary.closed} Closed</span>
|
||||
<p class="status-desc">Ports not responding</p>
|
||||
<span class="status-title"
|
||||
>{$t('diagnostics/network-tcp-port-check.results.summaryClosedPorts', {
|
||||
count: diagnosticState.results.summary.closed,
|
||||
})}</span
|
||||
>
|
||||
<p class="status-desc">{$t('diagnostics/network-tcp-port-check.results.closedPortsDescription')}</p>
|
||||
</div>
|
||||
</div>
|
||||
{#if diagnosticState.results.summary.avgLatency}
|
||||
<div class="status-item">
|
||||
<Icon name="zap" size="sm" />
|
||||
<div>
|
||||
<span class="status-title">{diagnosticState.results.summary.avgLatency}ms</span>
|
||||
<p class="status-desc">Average latency</p>
|
||||
<span class="status-title"
|
||||
>{$t('diagnostics/network-tcp-port-check.results.summaryAvgLatency', {
|
||||
latency: diagnosticState.results.summary.avgLatency,
|
||||
})}</span
|
||||
>
|
||||
<p class="status-desc">{$t('diagnostics/network-tcp-port-check.results.avgLatencyDescription')}</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -313,7 +359,11 @@
|
||||
|
||||
<!-- Detailed Results -->
|
||||
<div class="ports-section">
|
||||
<h4>Port Status ({diagnosticState.results.results.length} targets)</h4>
|
||||
<h4>
|
||||
{$t('diagnostics/network-tcp-port-check.results.portStatusTitle', {
|
||||
count: diagnosticState.results.results.length,
|
||||
})}
|
||||
</h4>
|
||||
<div class="ports-list">
|
||||
{#each diagnosticState.results.results as result, index (index)}
|
||||
{@const status = getPortStatus(result)}
|
||||
@@ -338,42 +388,66 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<ErrorCard title="Port Check Failed" error={diagnosticState.error} />
|
||||
<ErrorCard title={$t('diagnostics/network-tcp-port-check.error.title')} error={diagnosticState.error} />
|
||||
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>Understanding TCP Port Connectivity</h3>
|
||||
<h3>{$t('diagnostics/network-tcp-port-check.info.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>Port States</h4>
|
||||
<h4>{$t('diagnostics/network-tcp-port-check.info.portStates.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>Open:</strong> Port accepts connections and responds</li>
|
||||
<li><strong>Closed:</strong> Port actively refuses connections</li>
|
||||
<li><strong>Filtered:</strong> Port blocked by firewall (appears as timeout)</li>
|
||||
<li><strong>Timeout:</strong> No response within timeout period</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.portStates.open')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.portStates.openDesc')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.portStates.closed')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.portStates.closedDesc')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.portStates.filtered')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.portStates.filteredDesc')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.portStates.timeout')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.portStates.timeoutDesc')}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Common Ports</h4>
|
||||
<h4>{$t('diagnostics/network-tcp-port-check.info.commonPorts.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>SSH (22):</strong> Secure remote access</li>
|
||||
<li><strong>HTTP (80):</strong> Web traffic</li>
|
||||
<li><strong>HTTPS (443):</strong> Secure web traffic</li>
|
||||
<li><strong>SMTP (25/587):</strong> Email sending</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.commonPorts.ssh')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.commonPorts.sshDesc')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.commonPorts.http')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.commonPorts.httpDesc')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.commonPorts.https')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.commonPorts.httpsDesc')}
|
||||
</li>
|
||||
<li>
|
||||
<strong>{$t('diagnostics/network-tcp-port-check.info.commonPorts.smtp')}</strong>
|
||||
{$t('diagnostics/network-tcp-port-check.info.commonPorts.smtpDesc')}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Troubleshooting Tips</h4>
|
||||
<h4>{$t('diagnostics/network-tcp-port-check.info.troubleshooting.title')}</h4>
|
||||
<ul>
|
||||
<li>Timeouts often indicate firewall blocking</li>
|
||||
<li>Connection refused means service is not running</li>
|
||||
<li>Check both client and server firewalls</li>
|
||||
<li>Verify service is listening on expected port</li>
|
||||
<li>{$t('diagnostics/network-tcp-port-check.info.troubleshooting.tip1')}</li>
|
||||
<li>{$t('diagnostics/network-tcp-port-check.info.troubleshooting.tip2')}</li>
|
||||
<li>{$t('diagnostics/network-tcp-port-check.info.troubleshooting.tip3')}</li>
|
||||
<li>{$t('diagnostics/network-tcp-port-check.info.troubleshooting.tip4')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let asn = $state('AS15169');
|
||||
@@ -10,14 +11,32 @@
|
||||
let copiedState = $state(false);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ asn: 'AS15169', description: 'Google LLC - Major cloud provider' },
|
||||
{ asn: 'AS13335', description: 'Cloudflare - CDN and security services' },
|
||||
{ asn: 'AS16509', description: 'Amazon.com - AWS cloud infrastructure' },
|
||||
{ asn: 'AS8075', description: 'Microsoft Corporation - Azure cloud' },
|
||||
{ asn: 'AS32934', description: 'Meta Platforms - Facebook services' },
|
||||
{ asn: 'AS396982', description: 'Google Cloud Platform - Additional ranges' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
asn: $t('diagnostics/rdap-asn.examples.items.google.asn'),
|
||||
description: $t('diagnostics/rdap-asn.examples.items.google.description'),
|
||||
},
|
||||
{
|
||||
asn: $t('diagnostics/rdap-asn.examples.items.cloudflare.asn'),
|
||||
description: $t('diagnostics/rdap-asn.examples.items.cloudflare.description'),
|
||||
},
|
||||
{
|
||||
asn: $t('diagnostics/rdap-asn.examples.items.amazon.asn'),
|
||||
description: $t('diagnostics/rdap-asn.examples.items.amazon.description'),
|
||||
},
|
||||
{
|
||||
asn: $t('diagnostics/rdap-asn.examples.items.microsoft.asn'),
|
||||
description: $t('diagnostics/rdap-asn.examples.items.microsoft.description'),
|
||||
},
|
||||
{
|
||||
asn: $t('diagnostics/rdap-asn.examples.items.meta.asn'),
|
||||
description: $t('diagnostics/rdap-asn.examples.items.meta.description'),
|
||||
},
|
||||
{
|
||||
asn: $t('diagnostics/rdap-asn.examples.items.googleCloud.asn'),
|
||||
description: $t('diagnostics/rdap-asn.examples.items.googleCloud.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function lookupASN() {
|
||||
loading = true;
|
||||
@@ -36,12 +55,14 @@
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({ message: `HTTP ${response.status}` }));
|
||||
throw new Error(errorData.message || `ASN RDAP lookup failed: ${response.status}`);
|
||||
throw new Error(
|
||||
errorData.message || $t('diagnostics/rdap-asn.error.lookupFailed', { status: response.status }),
|
||||
);
|
||||
}
|
||||
|
||||
results = await response.json();
|
||||
} catch (err: unknown) {
|
||||
error = (err as Error).message;
|
||||
error = err instanceof Error ? err.message : $t('diagnostics/rdap-asn.error.unknownError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -70,7 +91,7 @@
|
||||
}
|
||||
|
||||
function formatDate(dateString: string | undefined): string {
|
||||
if (!dateString) return 'Not available';
|
||||
if (!dateString) return $t('diagnostics/rdap-asn.results.notAvailable');
|
||||
try {
|
||||
return new Date(dateString).toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
@@ -103,11 +124,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>ASN RDAP Lookup</h1>
|
||||
<p>
|
||||
Query Autonomous System Number allocation and registration data using RDAP through Regional Internet Registries.
|
||||
ASNs identify networks on the global Internet routing table and are essential for BGP routing operations.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/rdap-asn.title')}</h1>
|
||||
<p>{$t('diagnostics/rdap-asn.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -115,7 +133,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Common ASN Examples</h4>
|
||||
<h4>{$t('diagnostics/rdap-asn.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -123,7 +141,9 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Perform RDAP lookup for ${example.asn} (${example.description})`}
|
||||
use:tooltip={$t(
|
||||
`diagnostics/rdap-asn.examples.items.${['google', 'cloudflare', 'amazon', 'microsoft', 'meta', 'googleCloud'][i]}.tooltip`,
|
||||
)}
|
||||
>
|
||||
<h5>{example.asn}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -137,24 +157,24 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>RDAP Lookup Configuration</h3>
|
||||
<h3>{$t('diagnostics/rdap-asn.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="asn" use:tooltip={'Enter an Autonomous System Number to query allocation data via RDAP'}>
|
||||
Autonomous System Number
|
||||
<label for="asn" use:tooltip={$t('diagnostics/rdap-asn.form.asnTooltip')}>
|
||||
{$t('diagnostics/rdap-asn.form.asnLabel')}
|
||||
<input
|
||||
id="asn"
|
||||
type="text"
|
||||
bind:value={asn}
|
||||
placeholder="AS15169 or 15169"
|
||||
placeholder={$t('diagnostics/rdap-asn.form.asnPlaceholder')}
|
||||
onchange={() => {
|
||||
clearExampleSelection();
|
||||
if (asn.trim()) lookupASN();
|
||||
}}
|
||||
/>
|
||||
<small>Supports both formats: AS15169 or 15169 (AS prefix is optional)</small>
|
||||
<small>{$t('diagnostics/rdap-asn.form.asnHint')}</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -163,10 +183,10 @@
|
||||
<button class="lookup-btn" onclick={lookupASN} disabled={loading || !asn.trim()}>
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Performing RDAP Lookup...
|
||||
{$t('diagnostics/rdap-asn.form.performing')}
|
||||
{:else}
|
||||
<Icon name="search" size="sm" />
|
||||
Lookup ASN
|
||||
{$t('diagnostics/rdap-asn.form.lookupButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -177,24 +197,28 @@
|
||||
{#if results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>RDAP Data for {formatASN(results.asn)}</h3>
|
||||
<h3>{$t('diagnostics/rdap-asn.results.title', { asn: formatASN(results.asn) })}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={copiedState}>
|
||||
<span class={copiedState ? 'text-green-500' : ''}
|
||||
><Icon name={copiedState ? 'check' : 'copy'} size="xs" /></span
|
||||
>
|
||||
{copiedState ? 'Copied!' : 'Copy Raw JSON'}
|
||||
{copiedState ? $t('diagnostics/rdap-asn.results.copied') : $t('diagnostics/rdap-asn.results.copy')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="lookup-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'The ASN that was queried'}>ASN:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/rdap-asn.results.asnTooltip')}
|
||||
>{$t('diagnostics/rdap-asn.results.asn')}:</span
|
||||
>
|
||||
<span class="info-value">
|
||||
<span class="asn-number">{formatASN(results.asn)}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'RDAP service used for the query'}>RDAP Service:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/rdap-asn.results.rdapServiceTooltip')}
|
||||
>{$t('diagnostics/rdap-asn.results.rdapService')}:</span
|
||||
>
|
||||
<span class="info-value mono">{results.serviceUrl}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -202,33 +226,33 @@
|
||||
<div class="results-grid">
|
||||
<!-- ASN Information -->
|
||||
<div class="result-section">
|
||||
<h4>ASN Information</h4>
|
||||
<h4>{$t('diagnostics/rdap-asn.results.asnInfo.title')}</h4>
|
||||
<dl class="definition-list">
|
||||
<dt>Organization Name:</dt>
|
||||
<dd>{results.data.name || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/rdap-asn.results.asnInfo.organizationName')}</dt>
|
||||
<dd>{results.data.name || $t('diagnostics/rdap-asn.results.notAvailable')}</dd>
|
||||
|
||||
<dt>Type:</dt>
|
||||
<dd>{results.data.type || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/rdap-asn.results.asnInfo.type')}</dt>
|
||||
<dd>{results.data.type || $t('diagnostics/rdap-asn.results.notAvailable')}</dd>
|
||||
|
||||
<dt>Country:</dt>
|
||||
<dt>{$t('diagnostics/rdap-asn.results.asnInfo.country')}</dt>
|
||||
<dd>
|
||||
{#if results.data.country}
|
||||
<span class="country-code">{results.data.country}</span>
|
||||
{:else}
|
||||
Not available
|
||||
{$t('diagnostics/rdap-asn.results.notAvailable')}
|
||||
{/if}
|
||||
</dd>
|
||||
|
||||
<dt>Registry:</dt>
|
||||
<dd>{results.data.registry || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/rdap-asn.results.asnInfo.registry')}</dt>
|
||||
<dd>{results.data.registry || $t('diagnostics/rdap-asn.results.notAvailable')}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- Status and Dates -->
|
||||
<div class="result-section">
|
||||
<h4>Allocation Details</h4>
|
||||
<h4>{$t('diagnostics/rdap-asn.results.allocation.title')}</h4>
|
||||
<dl class="definition-list">
|
||||
<dt>Status:</dt>
|
||||
<dt>{$t('diagnostics/rdap-asn.results.allocation.status')}</dt>
|
||||
<dd>
|
||||
{#if results.data.status?.length}
|
||||
<div class="status-list">
|
||||
@@ -237,14 +261,14 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
Not available
|
||||
{$t('diagnostics/rdap-asn.results.notAvailable')}
|
||||
{/if}
|
||||
</dd>
|
||||
|
||||
<dt>Allocation Date:</dt>
|
||||
<dt>{$t('diagnostics/rdap-asn.results.allocation.allocationDate')}</dt>
|
||||
<dd>{formatDate(results.data.allocation)}</dd>
|
||||
|
||||
<dt>Last Changed:</dt>
|
||||
<dt>{$t('diagnostics/rdap-asn.results.allocation.lastChanged')}</dt>
|
||||
<dd>{formatDate(results.data.lastChanged)}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -252,26 +276,28 @@
|
||||
<!-- Contact Information -->
|
||||
{#if results.data.contacts?.length}
|
||||
<div class="result-section full-width">
|
||||
<h4>Contact Information</h4>
|
||||
<h4>{$t('diagnostics/rdap-asn.results.contacts.title')}</h4>
|
||||
<div class="contacts-grid">
|
||||
{#each results.data.contacts as contact, index (index)}
|
||||
<div class="contact-card">
|
||||
<h5>
|
||||
{#if contact.roles?.includes('registrant')}
|
||||
Registrant
|
||||
{$t('diagnostics/rdap-asn.results.contacts.registrant')}
|
||||
{:else if contact.roles?.includes('administrative')}
|
||||
Administrative
|
||||
{$t('diagnostics/rdap-asn.results.contacts.administrative')}
|
||||
{:else if contact.roles?.includes('technical')}
|
||||
Technical
|
||||
{$t('diagnostics/rdap-asn.results.contacts.technical')}
|
||||
{:else if contact.roles?.includes('abuse')}
|
||||
Abuse
|
||||
{$t('diagnostics/rdap-asn.results.contacts.abuse')}
|
||||
{:else}
|
||||
Contact
|
||||
{$t('diagnostics/rdap-asn.results.contacts.contact')}
|
||||
{/if}
|
||||
</h5>
|
||||
<p><strong>{formatContact(contact)}</strong></p>
|
||||
{#if contact.handle}
|
||||
<p><small>Handle: {contact.handle}</small></p>
|
||||
<p>
|
||||
<small>{$t('diagnostics/rdap-asn.results.contacts.handle', { handle: contact.handle })}</small>
|
||||
</p>
|
||||
{/if}
|
||||
{#if contact.roles}
|
||||
<div class="roles-list">
|
||||
@@ -296,16 +322,16 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>RDAP Lookup Failed</strong>
|
||||
<strong>{$t('diagnostics/rdap-asn.error.title')}</strong>
|
||||
<p>{error}</p>
|
||||
<div class="troubleshooting">
|
||||
<p><strong>Troubleshooting Tips:</strong></p>
|
||||
<p><strong>{$t('diagnostics/rdap-asn.error.troubleshooting.title')}</strong></p>
|
||||
<ul>
|
||||
<li>Ensure the ASN format is valid (e.g., AS15169 or just 15169)</li>
|
||||
<li>Check if the ASN exists and is currently allocated</li>
|
||||
<li>Private ASNs (64512-65534, 4200000000-4294967294) may not have public RDAP data</li>
|
||||
<li>Some RIRs may have rate limiting or access restrictions</li>
|
||||
<li>Try again in a few moments if the service is temporarily unavailable</li>
|
||||
<li>{$t('diagnostics/rdap-asn.error.troubleshooting.validFormat')}</li>
|
||||
<li>{$t('diagnostics/rdap-asn.error.troubleshooting.asnExists')}</li>
|
||||
<li>{$t('diagnostics/rdap-asn.error.troubleshooting.privateASN')}</li>
|
||||
<li>{$t('diagnostics/rdap-asn.error.troubleshooting.rateLimiting')}</li>
|
||||
<li>{$t('diagnostics/rdap-asn.error.troubleshooting.tryAgain')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -317,37 +343,33 @@
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>About ASN RDAP Lookups</h3>
|
||||
<h3>{$t('diagnostics/rdap-asn.educational.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>What is an ASN?</h4>
|
||||
<p>
|
||||
Autonomous System Numbers identify networks on the global Internet routing table and are essential for BGP
|
||||
routing operations. Each ASN represents a collection of IP address blocks under unified administrative
|
||||
control.
|
||||
</p>
|
||||
<h4>{$t('diagnostics/rdap-asn.educational.whatIsASN.title')}</h4>
|
||||
<p>{$t('diagnostics/rdap-asn.educational.whatIsASN.description')}</p>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>ASN Ranges by Registry</h4>
|
||||
<h4>{$t('diagnostics/rdap-asn.educational.asnRanges.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>ARIN:</strong> AS1 - AS23551, AS393216 - AS394239</li>
|
||||
<li><strong>RIPE NCC:</strong> AS24576 - AS25599, AS34816 - AS35839</li>
|
||||
<li><strong>APNIC:</strong> AS23552 - AS24575, AS37888 - AS38911</li>
|
||||
<li><strong>LACNIC:</strong> AS26592 - AS27647, AS61440 - AS61951</li>
|
||||
<li><strong>AFRINIC:</strong> AS36864 - AS37887, AS327680 - AS328703</li>
|
||||
<li><strong>{$t('diagnostics/rdap-asn.educational.asnRanges.arin')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-asn.educational.asnRanges.ripe')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-asn.educational.asnRanges.apnic')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-asn.educational.asnRanges.lacnic')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-asn.educational.asnRanges.afrinic')}</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>What You'll Get</h4>
|
||||
<h4>{$t('diagnostics/rdap-asn.educational.whatYouGet.title')}</h4>
|
||||
<ul>
|
||||
<li>Organization name and type</li>
|
||||
<li>Country of registration</li>
|
||||
<li>Allocation date and status</li>
|
||||
<li>Contact information (admin, technical, abuse)</li>
|
||||
<li>{$t('diagnostics/rdap-asn.educational.whatYouGet.organization')}</li>
|
||||
<li>{$t('diagnostics/rdap-asn.educational.whatYouGet.country')}</li>
|
||||
<li>{$t('diagnostics/rdap-asn.educational.whatYouGet.allocation')}</li>
|
||||
<li>{$t('diagnostics/rdap-asn.educational.whatYouGet.contacts')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let domain = $state('example.com');
|
||||
@@ -10,14 +11,32 @@
|
||||
let copiedState = $state(false);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ domain: 'example.com', description: 'Example domain for testing' },
|
||||
{ domain: 'google.com', description: 'Popular domain with comprehensive records' },
|
||||
{ domain: 'github.com', description: 'Tech company domain' },
|
||||
{ domain: 'stackoverflow.com', description: 'Community platform domain' },
|
||||
{ domain: 'cloudflare.com', description: 'CDN provider domain' },
|
||||
{ domain: 'iana.org', description: 'Internet registry domain' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
domain: $t('diagnostics/rdap-domain.examples.items.example.domain'),
|
||||
description: $t('diagnostics/rdap-domain.examples.items.example.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/rdap-domain.examples.items.google.domain'),
|
||||
description: $t('diagnostics/rdap-domain.examples.items.google.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/rdap-domain.examples.items.github.domain'),
|
||||
description: $t('diagnostics/rdap-domain.examples.items.github.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/rdap-domain.examples.items.stackoverflow.domain'),
|
||||
description: $t('diagnostics/rdap-domain.examples.items.stackoverflow.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/rdap-domain.examples.items.cloudflare.domain'),
|
||||
description: $t('diagnostics/rdap-domain.examples.items.cloudflare.description'),
|
||||
},
|
||||
{
|
||||
domain: $t('diagnostics/rdap-domain.examples.items.iana.domain'),
|
||||
description: $t('diagnostics/rdap-domain.examples.items.iana.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function lookupDomain() {
|
||||
loading = true;
|
||||
@@ -36,12 +55,14 @@
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({ message: `HTTP ${response.status}` }));
|
||||
throw new Error(errorData.message || `Domain RDAP lookup failed: ${response.status}`);
|
||||
throw new Error(
|
||||
errorData.message || $t('diagnostics/rdap-domain.error.lookupFailed', { status: response.status }),
|
||||
);
|
||||
}
|
||||
|
||||
results = await response.json();
|
||||
} catch (err: unknown) {
|
||||
error = err instanceof Error ? err.message : 'Unknown error occurred';
|
||||
error = err instanceof Error ? err.message : $t('diagnostics/rdap-domain.error.unknownError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -70,7 +91,7 @@
|
||||
}
|
||||
|
||||
function formatDate(dateString: string | undefined): string {
|
||||
if (!dateString) return 'Not available';
|
||||
if (!dateString) return $t('diagnostics/rdap-domain.results.notAvailable');
|
||||
try {
|
||||
return new Date(dateString).toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
@@ -96,11 +117,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>Domain RDAP Lookup</h1>
|
||||
<p>
|
||||
Query domain registration data using RDAP (Registration Data Access Protocol). RDAP is the modern successor to
|
||||
WHOIS, providing structured JSON responses through IANA bootstrap registry routing.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/rdap-domain.title')}</h1>
|
||||
<p>{$t('diagnostics/rdap-domain.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -108,7 +126,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Common Domain Examples</h4>
|
||||
<h4>{$t('diagnostics/rdap-domain.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -116,7 +134,9 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Perform RDAP lookup for ${example.domain} (${example.description})`}
|
||||
use:tooltip={$t(
|
||||
`diagnostics/rdap-domain.examples.items.${['example', 'google', 'github', 'stackoverflow', 'cloudflare', 'iana'][i]}.tooltip`,
|
||||
)}
|
||||
>
|
||||
<h5>{example.domain}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -129,18 +149,18 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>RDAP Lookup Configuration</h3>
|
||||
<h3>{$t('diagnostics/rdap-domain.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="domain" use:tooltip={'Enter a domain name to query registration data via RDAP'}>
|
||||
Domain Name
|
||||
<label for="domain" use:tooltip={$t('diagnostics/rdap-domain.form.domainTooltip')}>
|
||||
{$t('diagnostics/rdap-domain.form.domainLabel')}
|
||||
<input
|
||||
id="domain"
|
||||
type="text"
|
||||
bind:value={domain}
|
||||
placeholder="example.com"
|
||||
placeholder={$t('diagnostics/rdap-domain.form.domainPlaceholder')}
|
||||
onchange={() => {
|
||||
clearExampleSelection();
|
||||
if (domain.trim()) lookupDomain();
|
||||
@@ -154,10 +174,10 @@
|
||||
<button class="lookup-btn" onclick={lookupDomain} disabled={loading || !domain.trim()}>
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Performing RDAP Lookup...
|
||||
{$t('diagnostics/rdap-domain.form.performing')}
|
||||
{:else}
|
||||
<Icon name="search" size="sm" />
|
||||
Lookup Domain
|
||||
{$t('diagnostics/rdap-domain.form.lookupButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -168,22 +188,26 @@
|
||||
{#if results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>RDAP Data for {results.domain}</h3>
|
||||
<h3>{$t('diagnostics/rdap-domain.results.title', { domain: results.domain })}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={copiedState}>
|
||||
<span class={copiedState ? 'text-green-500' : ''}
|
||||
><Icon name={copiedState ? 'check' : 'copy'} size="xs" /></span
|
||||
>
|
||||
{copiedState ? 'Copied!' : 'Copy Raw JSON'}
|
||||
{copiedState ? $t('diagnostics/rdap-domain.results.copied') : $t('diagnostics/rdap-domain.results.copy')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="lookup-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'The domain name that was queried'}>Domain:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/rdap-domain.results.domainTooltip')}
|
||||
>{$t('diagnostics/rdap-domain.results.domain')}:</span
|
||||
>
|
||||
<span class="info-value mono">{results.data.domain || results.domain}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'RDAP service used for the query'}>RDAP Service:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/rdap-domain.results.rdapServiceTooltip')}
|
||||
>{$t('diagnostics/rdap-domain.results.rdapService')}:</span
|
||||
>
|
||||
<span class="info-value mono">{results.serviceUrl}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -191,12 +215,12 @@
|
||||
<div class="results-grid">
|
||||
<!-- Domain Information -->
|
||||
<div class="result-section">
|
||||
<h4>Domain Information</h4>
|
||||
<h4>{$t('diagnostics/rdap-domain.results.domainInfo.title')}</h4>
|
||||
<dl class="definition-list">
|
||||
<dt>Domain Name:</dt>
|
||||
<dt>{$t('diagnostics/rdap-domain.results.domainInfo.domainName')}</dt>
|
||||
<dd><code>{results.data.domain || results.domain}</code></dd>
|
||||
|
||||
<dt>Status:</dt>
|
||||
<dt>{$t('diagnostics/rdap-domain.results.domainInfo.status')}</dt>
|
||||
<dd>
|
||||
{#if results.data.status?.length}
|
||||
<div class="status-list">
|
||||
@@ -205,33 +229,33 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
Not available
|
||||
{$t('diagnostics/rdap-domain.results.notAvailable')}
|
||||
{/if}
|
||||
</dd>
|
||||
|
||||
<dt>Registrar:</dt>
|
||||
<dd>{results.data.registrar || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/rdap-domain.results.domainInfo.registrar')}</dt>
|
||||
<dd>{results.data.registrar || $t('diagnostics/rdap-domain.results.notAvailable')}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- Important Dates -->
|
||||
<div class="result-section">
|
||||
<h4>Important Dates</h4>
|
||||
<h4>{$t('diagnostics/rdap-domain.results.dates.title')}</h4>
|
||||
<dl class="definition-list">
|
||||
<dt>Registration Date:</dt>
|
||||
<dt>{$t('diagnostics/rdap-domain.results.dates.registration')}</dt>
|
||||
<dd>{formatDate(results.data.created)}</dd>
|
||||
|
||||
<dt>Last Updated:</dt>
|
||||
<dt>{$t('diagnostics/rdap-domain.results.dates.lastUpdated')}</dt>
|
||||
<dd>{formatDate(results.data.updated)}</dd>
|
||||
|
||||
<dt>Expiration Date:</dt>
|
||||
<dt>{$t('diagnostics/rdap-domain.results.dates.expiration')}</dt>
|
||||
<dd
|
||||
class:expires-soon={results.data.expires &&
|
||||
new Date(results.data.expires) < new Date(Date.now() + 30 * 24 * 60 * 60 * 1000)}
|
||||
>
|
||||
{formatDate(results.data.expires)}
|
||||
{#if results.data.expires && new Date(results.data.expires) < new Date(Date.now() + 30 * 24 * 60 * 60 * 1000)}
|
||||
<span class="warning-badge">Expires Soon!</span>
|
||||
<span class="warning-badge">{$t('diagnostics/rdap-domain.results.dates.expiresSoon')}</span>
|
||||
{/if}
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -240,7 +264,9 @@
|
||||
<!-- Nameservers -->
|
||||
{#if results.data.nameservers?.length}
|
||||
<div class="result-section">
|
||||
<h4>Nameservers ({results.data.nameservers.length})</h4>
|
||||
<h4>
|
||||
{$t('diagnostics/rdap-domain.results.nameservers.title', { count: results.data.nameservers.length })}
|
||||
</h4>
|
||||
<ul class="nameserver-list">
|
||||
{#each results.data.nameservers as ns, index (index)}
|
||||
<li><code>{ns}</code></li>
|
||||
@@ -252,24 +278,28 @@
|
||||
<!-- Contact Information -->
|
||||
{#if results.data.contacts?.length}
|
||||
<div class="result-section full-width">
|
||||
<h4>Contact Information</h4>
|
||||
<h4>{$t('diagnostics/rdap-domain.results.contacts.title')}</h4>
|
||||
<div class="contacts-grid">
|
||||
{#each results.data.contacts as contact, index (index)}
|
||||
<div class="contact-card">
|
||||
<h5>
|
||||
{#if contact.roles?.includes('registrant')}
|
||||
Registrant
|
||||
{$t('diagnostics/rdap-domain.results.contacts.registrant')}
|
||||
{:else if contact.roles?.includes('administrative')}
|
||||
Administrative
|
||||
{$t('diagnostics/rdap-domain.results.contacts.administrative')}
|
||||
{:else if contact.roles?.includes('technical')}
|
||||
Technical
|
||||
{$t('diagnostics/rdap-domain.results.contacts.technical')}
|
||||
{:else}
|
||||
Contact
|
||||
{$t('diagnostics/rdap-domain.results.contacts.contact')}
|
||||
{/if}
|
||||
</h5>
|
||||
<p><strong>{formatContact(contact)}</strong></p>
|
||||
{#if contact.handle}
|
||||
<p><small>Handle: {contact.handle}</small></p>
|
||||
<p>
|
||||
<small
|
||||
>{$t('diagnostics/rdap-domain.results.contacts.handle', { handle: contact.handle })}</small
|
||||
>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/each}
|
||||
@@ -287,15 +317,15 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>RDAP Lookup Failed</strong>
|
||||
<strong>{$t('diagnostics/rdap-domain.error.title')}</strong>
|
||||
<p>{error}</p>
|
||||
<div class="troubleshooting">
|
||||
<p><strong>Troubleshooting Tips:</strong></p>
|
||||
<p><strong>{$t('diagnostics/rdap-domain.error.troubleshooting.title')}</strong></p>
|
||||
<ul>
|
||||
<li>Ensure the domain name is valid and properly formatted</li>
|
||||
<li>Check if the domain actually exists and is registered</li>
|
||||
<li>Some registries may have rate limiting or access restrictions</li>
|
||||
<li>Try again in a few moments if the service is temporarily unavailable</li>
|
||||
<li>{$t('diagnostics/rdap-domain.error.troubleshooting.validDomain')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.error.troubleshooting.domainExists')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.error.troubleshooting.rateLimiting')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.error.troubleshooting.tryAgain')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -307,35 +337,32 @@
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>About RDAP Domain Lookups</h3>
|
||||
<h3>{$t('diagnostics/rdap-domain.educational.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>What is RDAP?</h4>
|
||||
<p>
|
||||
RDAP (Registration Data Access Protocol) is the modern successor to WHOIS, providing structured JSON
|
||||
responses for domain registration information through IANA bootstrap registry routing.
|
||||
</p>
|
||||
<h4>{$t('diagnostics/rdap-domain.educational.whatIsRDAP.title')}</h4>
|
||||
<p>{$t('diagnostics/rdap-domain.educational.whatIsRDAP.description')}</p>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>What You'll Get</h4>
|
||||
<h4>{$t('diagnostics/rdap-domain.educational.whatYouGet.title')}</h4>
|
||||
<ul>
|
||||
<li>Registration status and dates</li>
|
||||
<li>Nameserver information</li>
|
||||
<li>Registrar details</li>
|
||||
<li>Contact information (if available)</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.whatYouGet.statusDates')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.whatYouGet.nameservers')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.whatYouGet.registrar')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.whatYouGet.contacts')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>RDAP vs WHOIS</h4>
|
||||
<h4>{$t('diagnostics/rdap-domain.educational.rdapVsWhois.title')}</h4>
|
||||
<ul>
|
||||
<li>Structured JSON instead of free text</li>
|
||||
<li>Unicode support for internationalized domains</li>
|
||||
<li>Built-in rate limiting and privacy controls</li>
|
||||
<li>RESTful API with standard HTTP methods</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.rdapVsWhois.structuredJSON')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.rdapVsWhois.unicodeSupport')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.rdapVsWhois.rateLimiting')}</li>
|
||||
<li>{$t('diagnostics/rdap-domain.educational.rdapVsWhois.restfulAPI')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { tooltip } from '$lib/actions/tooltip.js';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let ip = $state('8.8.8.8');
|
||||
@@ -10,14 +11,32 @@
|
||||
let copiedState = $state(false);
|
||||
let selectedExampleIndex = $state<number | null>(null);
|
||||
|
||||
const examples = [
|
||||
{ ip: '8.8.8.8', description: 'Google DNS - Public DNS service' },
|
||||
{ ip: '1.1.1.1', description: 'Cloudflare DNS - Fast public resolver' },
|
||||
{ ip: '208.67.222.222', description: 'OpenDNS - Cisco public DNS' },
|
||||
{ ip: '192.0.2.1', description: 'RFC 5737 - Documentation IP range' },
|
||||
{ ip: '2001:4860:4860::8888', description: 'Google IPv6 DNS' },
|
||||
{ ip: '2606:4700:4700::1111', description: 'Cloudflare IPv6 DNS' },
|
||||
];
|
||||
const examples = $derived([
|
||||
{
|
||||
ip: $t('diagnostics/rdap-ip.examples.items.googleDNS.ip'),
|
||||
description: $t('diagnostics/rdap-ip.examples.items.googleDNS.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/rdap-ip.examples.items.cloudflareDNS.ip'),
|
||||
description: $t('diagnostics/rdap-ip.examples.items.cloudflareDNS.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/rdap-ip.examples.items.openDNS.ip'),
|
||||
description: $t('diagnostics/rdap-ip.examples.items.openDNS.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/rdap-ip.examples.items.rfc5737.ip'),
|
||||
description: $t('diagnostics/rdap-ip.examples.items.rfc5737.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/rdap-ip.examples.items.googleIPv6.ip'),
|
||||
description: $t('diagnostics/rdap-ip.examples.items.googleIPv6.description'),
|
||||
},
|
||||
{
|
||||
ip: $t('diagnostics/rdap-ip.examples.items.cloudflareIPv6.ip'),
|
||||
description: $t('diagnostics/rdap-ip.examples.items.cloudflareIPv6.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
async function lookupIP() {
|
||||
loading = true;
|
||||
@@ -36,12 +55,12 @@
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json().catch(() => ({ message: `HTTP ${response.status}` }));
|
||||
throw new Error(errorData.message || `IP RDAP lookup failed: ${response.status}`);
|
||||
throw new Error(errorData.message || $t('diagnostics/rdap-ip.error.lookupFailed', { status: response.status }));
|
||||
}
|
||||
|
||||
results = await response.json();
|
||||
} catch (err: unknown) {
|
||||
error = err instanceof Error ? err.message : 'Unknown error occurred';
|
||||
error = err instanceof Error ? err.message : $t('diagnostics/rdap-ip.error.unknownError');
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -70,7 +89,7 @@
|
||||
}
|
||||
|
||||
function formatDate(dateString: string | undefined): string {
|
||||
if (!dateString) return 'Not available';
|
||||
if (!dateString) return $t('diagnostics/rdap-ip.results.notAvailable');
|
||||
try {
|
||||
return new Date(dateString).toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
@@ -100,11 +119,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>IP Address RDAP Lookup</h1>
|
||||
<p>
|
||||
Look up IP address allocation and registration data using RDAP through Regional Internet Registry (RIR) services.
|
||||
Automatically routes queries to the appropriate RIR based on IP address prefix.
|
||||
</p>
|
||||
<h1>{$t('diagnostics/rdap-ip.title')}</h1>
|
||||
<p>{$t('diagnostics/rdap-ip.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -112,7 +128,7 @@
|
||||
<details class="examples-details">
|
||||
<summary class="examples-summary">
|
||||
<Icon name="chevron-right" size="xs" />
|
||||
<h4>Common IP Examples</h4>
|
||||
<h4>{$t('diagnostics/rdap-ip.examples.title')}</h4>
|
||||
</summary>
|
||||
<div class="examples-grid">
|
||||
{#each examples as example, i (i)}
|
||||
@@ -120,7 +136,9 @@
|
||||
class="example-card"
|
||||
class:selected={selectedExampleIndex === i}
|
||||
onclick={() => loadExample(example, i)}
|
||||
use:tooltip={`Perform RDAP lookup for ${example.ip} (${example.description})`}
|
||||
use:tooltip={$t(
|
||||
`diagnostics/rdap-ip.examples.items.${['googleDNS', 'cloudflareDNS', 'openDNS', 'rfc5737', 'googleIPv6', 'cloudflareIPv6'][i]}.tooltip`,
|
||||
)}
|
||||
>
|
||||
<h5>{example.ip}</h5>
|
||||
<p>{example.description}</p>
|
||||
@@ -134,24 +152,24 @@
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>RDAP Lookup Configuration</h3>
|
||||
<h3>{$t('diagnostics/rdap-ip.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-grid">
|
||||
<div class="form-group">
|
||||
<label for="ip" use:tooltip={'Enter an IPv4 or IPv6 address to query allocation data via RDAP'}>
|
||||
IP Address
|
||||
<label for="ip" use:tooltip={$t('diagnostics/rdap-ip.form.ipTooltip')}>
|
||||
{$t('diagnostics/rdap-ip.form.ipLabel')}
|
||||
<input
|
||||
id="ip"
|
||||
type="text"
|
||||
bind:value={ip}
|
||||
placeholder="8.8.8.8 or 2001:4860:4860::8888"
|
||||
placeholder={$t('diagnostics/rdap-ip.form.ipPlaceholder')}
|
||||
onchange={() => {
|
||||
clearExampleSelection();
|
||||
if (ip.trim()) lookupIP();
|
||||
}}
|
||||
/>
|
||||
<small>Supports both IPv4 (e.g., 8.8.8.8) and IPv6 (e.g., 2001:4860:4860::8888) addresses</small>
|
||||
<small>{$t('diagnostics/rdap-ip.form.ipHint')}</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -160,10 +178,10 @@
|
||||
<button class="lookup-btn" onclick={lookupIP} disabled={loading || !ip.trim()}>
|
||||
{#if loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Performing RDAP Lookup...
|
||||
{$t('diagnostics/rdap-ip.form.performing')}
|
||||
{:else}
|
||||
<Icon name="search" size="sm" />
|
||||
Lookup IP Address
|
||||
{$t('diagnostics/rdap-ip.form.lookupButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
@@ -174,25 +192,29 @@
|
||||
{#if results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header row">
|
||||
<h3>RDAP Data for {results.ip}</h3>
|
||||
<h3>{$t('diagnostics/rdap-ip.results.title', { ip: results.ip })}</h3>
|
||||
<button class="copy-btn" onclick={copyResults} disabled={copiedState}>
|
||||
<span class={copiedState ? 'text-green-500' : ''}
|
||||
><Icon name={copiedState ? 'check' : 'copy'} size="xs" /></span
|
||||
>
|
||||
{copiedState ? 'Copied!' : 'Copy Raw JSON'}
|
||||
{copiedState ? $t('diagnostics/rdap-ip.results.copied') : $t('diagnostics/rdap-ip.results.copy')}
|
||||
</button>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="lookup-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'The IP address that was queried'}>IP Address:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/rdap-ip.results.ipAddressTooltip')}
|
||||
>{$t('diagnostics/rdap-ip.results.ipAddress')}:</span
|
||||
>
|
||||
<span class="info-value">
|
||||
<span class="mono">{results.ip}</span>
|
||||
<span class="ip-version">{getIPVersion(results.ip)}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label" use:tooltip={'RDAP service used for the query'}>RDAP Service:</span>
|
||||
<span class="info-label" use:tooltip={$t('diagnostics/rdap-ip.results.rdapServiceTooltip')}
|
||||
>{$t('diagnostics/rdap-ip.results.rdapService')}:</span
|
||||
>
|
||||
<span class="info-value mono">{results.serviceUrl}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -200,36 +222,36 @@
|
||||
<div class="results-grid">
|
||||
<!-- Network Information -->
|
||||
<div class="result-section">
|
||||
<h4>Network Information</h4>
|
||||
<h4>{$t('diagnostics/rdap-ip.results.networkInfo.title')}</h4>
|
||||
<dl class="definition-list">
|
||||
<dt>Network Block:</dt>
|
||||
<dd><code>{results.data.network || 'Not available'}</code></dd>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.networkInfo.networkBlock')}</dt>
|
||||
<dd><code>{results.data.network || $t('diagnostics/rdap-ip.results.notAvailable')}</code></dd>
|
||||
|
||||
<dt>Network Name:</dt>
|
||||
<dd>{results.data.name || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.networkInfo.networkName')}</dt>
|
||||
<dd>{results.data.name || $t('diagnostics/rdap-ip.results.notAvailable')}</dd>
|
||||
|
||||
<dt>Type:</dt>
|
||||
<dd>{results.data.type || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.networkInfo.type')}</dt>
|
||||
<dd>{results.data.type || $t('diagnostics/rdap-ip.results.notAvailable')}</dd>
|
||||
|
||||
<dt>Country:</dt>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.networkInfo.country')}</dt>
|
||||
<dd>
|
||||
{#if results.data.country}
|
||||
<span class="country-code">{results.data.country}</span>
|
||||
{:else}
|
||||
Not available
|
||||
{$t('diagnostics/rdap-ip.results.notAvailable')}
|
||||
{/if}
|
||||
</dd>
|
||||
|
||||
<dt>Registry:</dt>
|
||||
<dd>{results.data.registry || 'Not available'}</dd>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.networkInfo.registry')}</dt>
|
||||
<dd>{results.data.registry || $t('diagnostics/rdap-ip.results.notAvailable')}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- Status and Dates -->
|
||||
<div class="result-section">
|
||||
<h4>Allocation Details</h4>
|
||||
<h4>{$t('diagnostics/rdap-ip.results.allocation.title')}</h4>
|
||||
<dl class="definition-list">
|
||||
<dt>Status:</dt>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.allocation.status')}</dt>
|
||||
<dd>
|
||||
{#if results.data.status?.length}
|
||||
<div class="status-list">
|
||||
@@ -238,14 +260,14 @@
|
||||
{/each}
|
||||
</div>
|
||||
{:else}
|
||||
Not available
|
||||
{$t('diagnostics/rdap-ip.results.notAvailable')}
|
||||
{/if}
|
||||
</dd>
|
||||
|
||||
<dt>Allocation Date:</dt>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.allocation.allocationDate')}</dt>
|
||||
<dd>{formatDate(results.data.allocation)}</dd>
|
||||
|
||||
<dt>Last Changed:</dt>
|
||||
<dt>{$t('diagnostics/rdap-ip.results.allocation.lastChanged')}</dt>
|
||||
<dd>{formatDate(results.data.lastChanged)}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -253,26 +275,28 @@
|
||||
<!-- Contact Information -->
|
||||
{#if results.data.contacts?.length}
|
||||
<div class="result-section full-width">
|
||||
<h4>Contact Information</h4>
|
||||
<h4>{$t('diagnostics/rdap-ip.results.contacts.title')}</h4>
|
||||
<div class="contacts-grid">
|
||||
{#each results.data.contacts as contact, index (index)}
|
||||
<div class="contact-card">
|
||||
<h5>
|
||||
{#if contact.roles?.includes('registrant')}
|
||||
Registrant
|
||||
{$t('diagnostics/rdap-ip.results.contacts.registrant')}
|
||||
{:else if contact.roles?.includes('administrative')}
|
||||
Administrative
|
||||
{$t('diagnostics/rdap-ip.results.contacts.administrative')}
|
||||
{:else if contact.roles?.includes('technical')}
|
||||
Technical
|
||||
{$t('diagnostics/rdap-ip.results.contacts.technical')}
|
||||
{:else if contact.roles?.includes('abuse')}
|
||||
Abuse
|
||||
{$t('diagnostics/rdap-ip.results.contacts.abuse')}
|
||||
{:else}
|
||||
Contact
|
||||
{$t('diagnostics/rdap-ip.results.contacts.contact')}
|
||||
{/if}
|
||||
</h5>
|
||||
<p><strong>{formatContact(contact)}</strong></p>
|
||||
{#if contact.handle}
|
||||
<p><small>Handle: {contact.handle}</small></p>
|
||||
<p>
|
||||
<small>{$t('diagnostics/rdap-ip.results.contacts.handle', { handle: contact.handle })}</small>
|
||||
</p>
|
||||
{/if}
|
||||
{#if contact.roles}
|
||||
<div class="roles-list">
|
||||
@@ -297,16 +321,16 @@
|
||||
<div class="error-content">
|
||||
<Icon name="alert-triangle" size="md" />
|
||||
<div>
|
||||
<strong>RDAP Lookup Failed</strong>
|
||||
<strong>{$t('diagnostics/rdap-ip.error.title')}</strong>
|
||||
<p>{error}</p>
|
||||
<div class="troubleshooting">
|
||||
<p><strong>Troubleshooting Tips:</strong></p>
|
||||
<p><strong>{$t('diagnostics/rdap-ip.error.troubleshooting.title')}</strong></p>
|
||||
<ul>
|
||||
<li>Ensure the IP address is valid and properly formatted</li>
|
||||
<li>Private IP addresses (RFC 1918) may not have RDAP data</li>
|
||||
<li>Some RIRs may have rate limiting or access restrictions</li>
|
||||
<li>Reserved or special-use addresses may not be publicly queryable</li>
|
||||
<li>Try again in a few moments if the service is temporarily unavailable</li>
|
||||
<li>{$t('diagnostics/rdap-ip.error.troubleshooting.validIP')}</li>
|
||||
<li>{$t('diagnostics/rdap-ip.error.troubleshooting.privateIP')}</li>
|
||||
<li>{$t('diagnostics/rdap-ip.error.troubleshooting.rateLimiting')}</li>
|
||||
<li>{$t('diagnostics/rdap-ip.error.troubleshooting.specialUse')}</li>
|
||||
<li>{$t('diagnostics/rdap-ip.error.troubleshooting.tryAgain')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -318,36 +342,33 @@
|
||||
<!-- Educational Content -->
|
||||
<div class="card info-card">
|
||||
<div class="card-header">
|
||||
<h3>About IP Address RDAP Lookups</h3>
|
||||
<h3>{$t('diagnostics/rdap-ip.educational.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-section">
|
||||
<h4>How it Works</h4>
|
||||
<p>
|
||||
IP RDAP provides detailed allocation information from Regional Internet Registries (RIRs). The tool
|
||||
automatically routes queries to the appropriate RIR using IANA bootstrap registries.
|
||||
</p>
|
||||
<h4>{$t('diagnostics/rdap-ip.educational.howItWorks.title')}</h4>
|
||||
<p>{$t('diagnostics/rdap-ip.educational.howItWorks.description')}</p>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>Regional Internet Registries</h4>
|
||||
<h4>{$t('diagnostics/rdap-ip.educational.rirs.title')}</h4>
|
||||
<ul>
|
||||
<li><strong>ARIN:</strong> North America, parts of Caribbean</li>
|
||||
<li><strong>RIPE NCC:</strong> Europe, Central Asia, Middle East</li>
|
||||
<li><strong>APNIC:</strong> Asia Pacific region</li>
|
||||
<li><strong>LACNIC:</strong> Latin America, parts of Caribbean</li>
|
||||
<li><strong>AFRINIC:</strong> Africa</li>
|
||||
<li><strong>{$t('diagnostics/rdap-ip.educational.rirs.arin')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-ip.educational.rirs.ripe')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-ip.educational.rirs.apnic')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-ip.educational.rirs.lacnic')}</strong></li>
|
||||
<li><strong>{$t('diagnostics/rdap-ip.educational.rirs.afrinic')}</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="info-section">
|
||||
<h4>What You'll Get</h4>
|
||||
<h4>{$t('diagnostics/rdap-ip.educational.whatYouGet.title')}</h4>
|
||||
<ul>
|
||||
<li>Network block and CIDR prefix</li>
|
||||
<li>Allocation type and country</li>
|
||||
<li>Organization responsible for the block</li>
|
||||
<li>Contact information (registrant, admin, technical, abuse)</li>
|
||||
<li>{$t('diagnostics/rdap-ip.educational.whatYouGet.networkBlock')}</li>
|
||||
<li>{$t('diagnostics/rdap-ip.educational.whatYouGet.allocationType')}</li>
|
||||
<li>{$t('diagnostics/rdap-ip.educational.whatYouGet.organization')}</li>
|
||||
<li>{$t('diagnostics/rdap-ip.educational.whatYouGet.contacts')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import { useDiagnosticState, useExamples } from '$lib/composables';
|
||||
import ExamplesCard from '$lib/components/common/ExamplesCard.svelte';
|
||||
import ErrorCard from '$lib/components/common/ErrorCard.svelte';
|
||||
import { t } from '$lib/stores/language';
|
||||
import '../../../../../styles/diagnostics-pages.scss';
|
||||
|
||||
let host = $state('');
|
||||
@@ -11,40 +12,85 @@
|
||||
|
||||
const diagnosticState = useDiagnosticState<any>();
|
||||
|
||||
const services = {
|
||||
custom: { port: null, description: 'Custom port' },
|
||||
ssh: { port: 22, description: 'SSH Server' },
|
||||
smtp: { port: 25, description: 'SMTP Mail Server' },
|
||||
whois: { port: 43, description: 'WHOIS Service' },
|
||||
http: { port: 80, description: 'HTTP Web Server' },
|
||||
https: { port: 443, description: 'HTTPS Web Server' },
|
||||
ftp: { port: 21, description: 'FTP Server' },
|
||||
telnet: { port: 23, description: 'Telnet Server' },
|
||||
pop3: { port: 110, description: 'POP3 Mail Server' },
|
||||
imap: { port: 143, description: 'IMAP Mail Server' },
|
||||
smtps: { port: 465, description: 'SMTP over TLS' },
|
||||
submission: { port: 587, description: 'Mail Submission' },
|
||||
imaps: { port: 993, description: 'IMAP over TLS' },
|
||||
pop3s: { port: 995, description: 'POP3 over TLS' },
|
||||
mysql: { port: 3306, description: 'MySQL Database' },
|
||||
postgresql: { port: 5432, description: 'PostgreSQL Database' },
|
||||
redis: { port: 6379, description: 'Redis Database' },
|
||||
mongodb: { port: 27017, description: 'MongoDB Database' },
|
||||
rdp: { port: 3389, description: 'Remote Desktop' },
|
||||
vnc: { port: 5900, description: 'VNC Remote Desktop' },
|
||||
};
|
||||
const services = $derived({
|
||||
custom: { port: null, description: $t('diagnostics/tls-banner.services.custom') },
|
||||
ssh: { port: 22, description: $t('diagnostics/tls-banner.services.ssh') },
|
||||
smtp: { port: 25, description: $t('diagnostics/tls-banner.services.smtp') },
|
||||
whois: { port: 43, description: $t('diagnostics/tls-banner.services.whois') },
|
||||
http: { port: 80, description: $t('diagnostics/tls-banner.services.http') },
|
||||
https: { port: 443, description: $t('diagnostics/tls-banner.services.https') },
|
||||
ftp: { port: 21, description: $t('diagnostics/tls-banner.services.ftp') },
|
||||
telnet: { port: 23, description: $t('diagnostics/tls-banner.services.telnet') },
|
||||
pop3: { port: 110, description: $t('diagnostics/tls-banner.services.pop3') },
|
||||
imap: { port: 143, description: $t('diagnostics/tls-banner.services.imap') },
|
||||
smtps: { port: 465, description: $t('diagnostics/tls-banner.services.smtps') },
|
||||
submission: { port: 587, description: $t('diagnostics/tls-banner.services.submission') },
|
||||
imaps: { port: 993, description: $t('diagnostics/tls-banner.services.imaps') },
|
||||
pop3s: { port: 995, description: $t('diagnostics/tls-banner.services.pop3s') },
|
||||
mysql: { port: 3306, description: $t('diagnostics/tls-banner.services.mysql') },
|
||||
postgresql: { port: 5432, description: $t('diagnostics/tls-banner.services.postgresql') },
|
||||
redis: { port: 6379, description: $t('diagnostics/tls-banner.services.redis') },
|
||||
mongodb: { port: 27017, description: $t('diagnostics/tls-banner.services.mongodb') },
|
||||
rdp: { port: 3389, description: $t('diagnostics/tls-banner.services.rdp') },
|
||||
vnc: { port: 5900, description: $t('diagnostics/tls-banner.services.vnc') },
|
||||
});
|
||||
|
||||
const examplesList = [
|
||||
{ host: 'scanme.nmap.org', port: 22, service: 'ssh', description: 'Nmap SSH Test' },
|
||||
{ host: 'test.rebex.net', port: 21, service: 'ftp', description: 'Rebex FTP Test' },
|
||||
{ host: 'example.com', port: 80, service: 'http', description: 'Example.com HTTP' },
|
||||
{ host: 'www.google.com', port: 80, service: 'http', description: 'Google HTTP' },
|
||||
{ host: 'aspmx.l.google.com', port: 25, service: 'smtp', description: 'Google MX Server' },
|
||||
{ host: 'whois.iana.org', port: 43, service: 'whois', description: 'IANA WHOIS' },
|
||||
{ host: 'ftp.freebsd.org', port: 21, service: 'ftp', description: 'FreeBSD FTP' },
|
||||
{ host: 'httpbin.org', port: 80, service: 'http', description: 'HTTPBin API' },
|
||||
{ host: 'whois.verisign-grs.com', port: 43, service: 'whois', description: 'Verisign WHOIS' },
|
||||
];
|
||||
const examplesList = $derived([
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.nmapSSH.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.nmapSSH.port'),
|
||||
service: 'ssh',
|
||||
description: $t('diagnostics/tls-banner.examples.items.nmapSSH.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.rebexFTP.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.rebexFTP.port'),
|
||||
service: 'ftp',
|
||||
description: $t('diagnostics/tls-banner.examples.items.rebexFTP.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.exampleHTTP.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.exampleHTTP.port'),
|
||||
service: 'http',
|
||||
description: $t('diagnostics/tls-banner.examples.items.exampleHTTP.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.googleHTTP.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.googleHTTP.port'),
|
||||
service: 'http',
|
||||
description: $t('diagnostics/tls-banner.examples.items.googleHTTP.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.googleMX.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.googleMX.port'),
|
||||
service: 'smtp',
|
||||
description: $t('diagnostics/tls-banner.examples.items.googleMX.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.ianaWHOIS.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.ianaWHOIS.port'),
|
||||
service: 'whois',
|
||||
description: $t('diagnostics/tls-banner.examples.items.ianaWHOIS.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.freebsdFTP.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.freebsdFTP.port'),
|
||||
service: 'ftp',
|
||||
description: $t('diagnostics/tls-banner.examples.items.freebsdFTP.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.httpbinAPI.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.httpbinAPI.port'),
|
||||
service: 'http',
|
||||
description: $t('diagnostics/tls-banner.examples.items.httpbinAPI.description'),
|
||||
},
|
||||
{
|
||||
host: $t('diagnostics/tls-banner.examples.items.verisignWHOIS.host'),
|
||||
port: $t('diagnostics/tls-banner.examples.items.verisignWHOIS.port'),
|
||||
service: 'whois',
|
||||
description: $t('diagnostics/tls-banner.examples.items.verisignWHOIS.description'),
|
||||
},
|
||||
]);
|
||||
|
||||
const examples = useExamples(examplesList);
|
||||
|
||||
@@ -66,7 +112,7 @@
|
||||
|
||||
async function grabBanner() {
|
||||
if (!isInputValid) {
|
||||
diagnosticState.setError('Please enter a valid host and port (1-65535)');
|
||||
diagnosticState.setError($t('diagnostics/tls-banner.error.invalidInput'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -86,26 +132,26 @@
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok) {
|
||||
const errorMessage = data.message || 'Failed to grab banner';
|
||||
const errorMessage = data.message || $t('diagnostics/tls-banner.error.failed');
|
||||
if (errorMessage.includes('ENOTFOUND')) {
|
||||
throw new Error('Host not found. Please check the hostname and try again.');
|
||||
throw new Error($t('diagnostics/tls-banner.error.hostNotFound'));
|
||||
} else if (errorMessage.includes('ECONNREFUSED')) {
|
||||
throw new Error(`Connection refused on port ${port}. The service may be down or port closed.`);
|
||||
throw new Error($t('diagnostics/tls-banner.error.connectionRefused', { port: port || 0 }));
|
||||
} else if (errorMessage.includes('timeout') || errorMessage.includes('ETIMEDOUT')) {
|
||||
throw new Error('Connection timed out. The host may be unreachable or port filtered.');
|
||||
throw new Error($t('diagnostics/tls-banner.error.timeout'));
|
||||
}
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
|
||||
diagnosticState.setResults(data);
|
||||
} catch (err) {
|
||||
diagnosticState.setError(err instanceof Error ? err.message : 'An unexpected error occurred');
|
||||
diagnosticState.setError(err instanceof Error ? err.message : $t('common.errors.unknownError'));
|
||||
}
|
||||
}
|
||||
|
||||
function loadExample(example: (typeof examplesList)[0], index: number) {
|
||||
host = example.host;
|
||||
port = example.port;
|
||||
port = parseInt(example.port, 10);
|
||||
service = example.service;
|
||||
examples.select(index);
|
||||
grabBanner();
|
||||
@@ -144,8 +190,8 @@
|
||||
|
||||
<div class="card">
|
||||
<header class="card-header">
|
||||
<h1>Service Banner Grabber</h1>
|
||||
<p>Retrieve service banners from SSH, SMTP, HTTP, FTP, and other network services</p>
|
||||
<h1>{$t('diagnostics/tls-banner.title')}</h1>
|
||||
<p>{$t('diagnostics/tls-banner.subtitle')}</p>
|
||||
</header>
|
||||
|
||||
<!-- Examples -->
|
||||
@@ -153,21 +199,21 @@
|
||||
examples={examplesList}
|
||||
selectedIndex={examples.selectedIndex}
|
||||
onSelect={loadExample}
|
||||
title="Quick Examples"
|
||||
title={$t('diagnostics/tls-banner.examples.title')}
|
||||
getLabel={(ex) => ex.description}
|
||||
getDescription={(ex) => `${ex.host}:${ex.port}`}
|
||||
getTooltip={(ex) => `Grab banner from ${ex.host}:${ex.port}`}
|
||||
getTooltip={(ex) => $t('diagnostics/tls-banner.examples.tooltip', { host: ex.host, port: ex.port })}
|
||||
/>
|
||||
|
||||
<!-- Input Form -->
|
||||
<div class="card input-card">
|
||||
<div class="card-header">
|
||||
<h3>Target Service</h3>
|
||||
<h3>{$t('diagnostics/tls-banner.form.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="service">Service Type</label>
|
||||
<label for="service">{$t('diagnostics/tls-banner.form.service')}</label>
|
||||
<select
|
||||
id="service"
|
||||
bind:value={service}
|
||||
@@ -183,26 +229,26 @@
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group flex-2">
|
||||
<label for="host">Host / IP Address</label>
|
||||
<label for="host">{$t('diagnostics/tls-banner.form.host')}</label>
|
||||
<input
|
||||
id="host"
|
||||
type="text"
|
||||
bind:value={host}
|
||||
placeholder="example.com or 192.168.1.1"
|
||||
placeholder={$t('diagnostics/tls-banner.form.hostPlaceholder')}
|
||||
disabled={diagnosticState.loading}
|
||||
onchange={() => examples.clear()}
|
||||
onkeydown={(e) => e.key === 'Enter' && grabBanner()}
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group flex-1">
|
||||
<label for="port">Port</label>
|
||||
<label for="port">{$t('diagnostics/tls-banner.form.port')}</label>
|
||||
<input
|
||||
id="port"
|
||||
type="number"
|
||||
bind:value={port}
|
||||
min="1"
|
||||
max="65535"
|
||||
placeholder="1-65535"
|
||||
placeholder={$t('diagnostics/tls-banner.form.portPlaceholder')}
|
||||
disabled={diagnosticState.loading}
|
||||
onchange={() => examples.clear()}
|
||||
onkeydown={(e) => e.key === 'Enter' && grabBanner()}
|
||||
@@ -213,16 +259,16 @@
|
||||
<button onclick={grabBanner} disabled={diagnosticState.loading || !isInputValid} class="primary">
|
||||
{#if diagnosticState.loading}
|
||||
<Icon name="loader" size="sm" animate="spin" />
|
||||
Connecting...
|
||||
{$t('diagnostics/tls-banner.loading.connecting')}
|
||||
{:else}
|
||||
<Icon name="terminal" size="sm" />
|
||||
Grab Banner
|
||||
{$t('diagnostics/tls-banner.form.grabButton')}
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ErrorCard title="Connection Failed" error={diagnosticState.error} />
|
||||
<ErrorCard title={$t('diagnostics/tls-banner.error.title')} error={diagnosticState.error} />
|
||||
|
||||
{#if diagnosticState.loading}
|
||||
<div class="card">
|
||||
@@ -230,8 +276,8 @@
|
||||
<div class="loading-state">
|
||||
<Icon name="loader" size="lg" animate="spin" />
|
||||
<div class="loading-text">
|
||||
<h3>Grabbing Banner</h3>
|
||||
<p>Connecting to {host}:{port}...</p>
|
||||
<h3>{$t('diagnostics/tls-banner.loading.title')}</h3>
|
||||
<p>{$t('diagnostics/tls-banner.loading.message', { host, port: port || 0 })}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -241,33 +287,33 @@
|
||||
{#if diagnosticState.results}
|
||||
<div class="card results-card">
|
||||
<div class="card-header">
|
||||
<h3>Banner Information</h3>
|
||||
<h3>{$t('diagnostics/tls-banner.results.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<!-- Connection Info -->
|
||||
<div class="card info-section">
|
||||
<div class="card-header">
|
||||
<h3>Connection Details</h3>
|
||||
<h3>{$t('diagnostics/tls-banner.results.connectionDetails.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="info-grid">
|
||||
<div class="info-item">
|
||||
<span class="info-label">Host:</span>
|
||||
<span class="info-label">{$t('diagnostics/tls-banner.results.connectionDetails.host')}</span>
|
||||
<span class="info-value">{diagnosticState.results.host}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">Port:</span>
|
||||
<span class="info-label">{$t('diagnostics/tls-banner.results.connectionDetails.port')}</span>
|
||||
<span class="info-value">{diagnosticState.results.port}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">Protocol:</span>
|
||||
<span class="info-label">{$t('diagnostics/tls-banner.results.connectionDetails.protocol')}</span>
|
||||
<span class="info-value">
|
||||
<Icon name={getProtocolIcon(diagnosticState.results.protocol)} size="xs" />
|
||||
{diagnosticState.results.protocol || 'Unknown'}
|
||||
{diagnosticState.results.protocol || $t('diagnostics/tls-banner.results.connectionDetails.unknown')}
|
||||
</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">Response Time:</span>
|
||||
<span class="info-label">{$t('diagnostics/tls-banner.results.connectionDetails.responseTime')}</span>
|
||||
<span class="info-value">{diagnosticState.results.responseTime}ms</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -277,7 +323,7 @@
|
||||
<!-- Banner Content -->
|
||||
<div class="card banner-section">
|
||||
<div class="card-header">
|
||||
<h3>Service Banner</h3>
|
||||
<h3>{$t('diagnostics/tls-banner.results.banner.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
{#if diagnosticState.results.banner}
|
||||
@@ -286,8 +332,8 @@
|
||||
{:else}
|
||||
<div class="no-banner">
|
||||
<Icon name="file-x" size="lg" />
|
||||
<p>No banner received from service</p>
|
||||
<small>The service may not send a banner or requires specific protocol handshake</small>
|
||||
<p>{$t('diagnostics/tls-banner.results.banner.noBanner')}</p>
|
||||
<small>{$t('diagnostics/tls-banner.results.banner.noBannerHint')}</small>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
@@ -297,7 +343,7 @@
|
||||
{#if diagnosticState.results.analysis && (diagnosticState.results.analysis.software || diagnosticState.results.analysis.version || diagnosticState.results.analysis.os || (diagnosticState.results.analysis.security && diagnosticState.results.analysis.security.length > 0))}
|
||||
<div class="card analysis-section">
|
||||
<div class="card-header">
|
||||
<h3>Service Analysis</h3>
|
||||
<h3>{$t('diagnostics/tls-banner.results.analysis.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="analysis-grid">
|
||||
@@ -305,7 +351,7 @@
|
||||
<div class="analysis-item">
|
||||
<Icon name="package" size="sm" />
|
||||
<div>
|
||||
<h4>Software</h4>
|
||||
<h4>{$t('diagnostics/tls-banner.results.analysis.software')}</h4>
|
||||
<p>{diagnosticState.results.analysis.software}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -314,7 +360,7 @@
|
||||
<div class="analysis-item">
|
||||
<Icon name="tag" size="sm" />
|
||||
<div>
|
||||
<h4>Version</h4>
|
||||
<h4>{$t('diagnostics/tls-banner.results.analysis.version')}</h4>
|
||||
<p>{diagnosticState.results.analysis.version}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -323,7 +369,7 @@
|
||||
<div class="analysis-item">
|
||||
<Icon name="monitor" size="sm" />
|
||||
<div>
|
||||
<h4>Operating System</h4>
|
||||
<h4>{$t('diagnostics/tls-banner.results.analysis.os')}</h4>
|
||||
<p>{diagnosticState.results.analysis.os}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -332,7 +378,7 @@
|
||||
<div class="analysis-item full-width">
|
||||
<Icon name="shield" size="sm" />
|
||||
<div>
|
||||
<h4>Security Notes</h4>
|
||||
<h4>{$t('diagnostics/tls-banner.results.analysis.security')}</h4>
|
||||
<ul>
|
||||
{#each diagnosticState.results.analysis.security as note, i (i)}
|
||||
<li>{note}</li>
|
||||
@@ -350,21 +396,21 @@
|
||||
{#if diagnosticState.results.tls}
|
||||
<div class="card tls-section">
|
||||
<div class="card-header">
|
||||
<h3>TLS Information</h3>
|
||||
<h3>{$t('diagnostics/tls-banner.results.tls.title')}</h3>
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<div class="tls-info">
|
||||
<div class="tls-item">
|
||||
<span class="tls-label">Protocol:</span>
|
||||
<span class="tls-label">{$t('diagnostics/tls-banner.results.tls.protocol')}</span>
|
||||
<span class="tls-value">{diagnosticState.results.tls.protocol}</span>
|
||||
</div>
|
||||
<div class="tls-item">
|
||||
<span class="tls-label">Cipher:</span>
|
||||
<span class="tls-label">{$t('diagnostics/tls-banner.results.tls.cipher')}</span>
|
||||
<span class="tls-value">{diagnosticState.results.tls.cipher}</span>
|
||||
</div>
|
||||
{#if diagnosticState.results.tls.certificate}
|
||||
<div class="tls-item">
|
||||
<span class="tls-label">Certificate CN:</span>
|
||||
<span class="tls-label">{$t('diagnostics/tls-banner.results.tls.certificateCN')}</span>
|
||||
<span class="tls-value">{diagnosticState.results.tls.certificate.cn}</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user