feat: Add temporary frontend and started on dnssec
All checks were successful
Build Docker / BuildImage (push) Successful in 31s

This commit is contained in:
2025-02-25 18:30:29 +11:00
parent af89fca45d
commit 12263dc7b5
4 changed files with 344 additions and 27 deletions

View File

@@ -1,20 +1,7 @@
body {
background-color: #000000;
color: #ffffff;
}
h1 {
font-size: 50px;
margin: 0;
padding: 0;
.spacer {
margin-top: 20px;
}
.centre {
margin-top: 10%;
margin-top: 50px;
text-align: center;
}
a {
color: #ffffff;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}

View File

@@ -0,0 +1,59 @@
// Add event listener to button
document.getElementById("ssl").addEventListener("click", function () {
getSSL();
});
// Add enter key listener to input
document.getElementById("domain").addEventListener("keyup", function (event) {
if (event.key === "Enter") {
getSSL();
}
});
function getSSL() {
// Get the input value
const domain = document.getElementById("domain").value;
// Send a GET request to the API
fetch(`/api/v1/ssl/${domain}`)
.then(response => response.json())
.then(data => {
// Check if the request was successful
if (data.success) {
// Display the results
// document.getElementById("results").innerHTML = `<h2>SSL Certificate Details</h2>
// <p>IP Address: ${data.ip}</p>
// <p>Webserver TLSA: <code>${data.tlsa.server}</code></p>
// <p>Nameserver TLSA: <code>${data.tlsa.nameserver}</code> ${data.tlsa.match ? "(Match)" : "(No Match)"}</p>
// <p>Certificate Names: ${data.cert.domains.join(", ")}</p>
// <p>Expiry Date: ${data.cert.expiry_date} UTC</p>
// <p>Valid: ${data.cert.valid ? "Yes" : "No"}</p>`;
document.getElementById("results").innerHTML = `
<div class="card shadow-sm p-4" style="max-width: 950px;margin: auto;">
<h2 class="mb-3">SSL Certificate Details</h2>
<ul class="list-group">
<li class="list-group-item"><strong>IP Address:</strong> ${data.ip}</li>
<li class="list-group-item"><strong>Webserver TLSA:</strong> <code>${data.tlsa.server}</code></li>
<li class="list-group-item"><strong>Nameserver TLSA:</strong> <code>${data.tlsa.nameserver}</code>
${data.tlsa.match ? '<span class="badge bg-success">Match</span>' : '<span class="badge bg-danger">No Match</span>'}
</li>
<li class="list-group-item"><strong>Certificate Names:</strong> ${data.cert.domains.join(", ")}</li>
<li class="list-group-item"><strong>Expiry Date:</strong> ${data.cert.expiry_date} UTC</li>
<li class="list-group-item"><strong>Valid:</strong>
${data.valid ? '<span class="badge bg-success">Yes</span>' : '<span class="badge bg-danger">No</span>'}
</li>
</ul>
</div>`;
} else {
// Display an error message
document.getElementById("results").innerHTML = `<h2>Error</h2>
<p>${data.message}</p>`;
}
})
.catch(error => {
// Display an error message
document.getElementById("results").innerHTML = `<h2>Error</h2>
<p>${error.message}</p>`;
});
}

View File

@@ -1,18 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" data-bs-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nathan.Woodburn/</title>
<title>HNS Tools | Nathan.Woodburn/</title>
<link rel="icon" href="/assets/img/favicon.png" type="image/png">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="/assets/css/index.css">
<script src="/assets/js/index.js" defer></script>
</head>
<body>
<div class="spacer"></div>
<div class="centre" style="margin-top: 20px;">
<h1>HNS Tools</h1>
<h2>Nathan.Woodburn/</h2>
</div>
<div class="centre">
<h1>Nathan.Woodburn/</h1>
<h2>SSL/DANE Checker</h2>
<input type="text" id="domain" placeholder="Domain to check">
<button id="ssl">Validate SSL</button>
<div id="results" style="margin-top: 20px;"></div>
</div>
</body>