ansible-infra/resources/chaosknoten/acmedns/docker_compose/index.html.j2
Stefan Bethke c8edde4d11
Some checks failed
/ Ansible Lint (push) Failing after 56s
Pretty up
2026-01-26 00:20:27 +01:00

74 lines
2.1 KiB
Django/Jinja

<html>
<head>
<title>ACME DNS Register</title>
<style>
table, tr, th, td {
border-collapse: collapse;
}
caption {
caption-side: bottom;
padding: 2px 4px;
}
th, td {
border: 1px solid black;
padding: 2px 4px;
}
th {
text-align: left;
}
td {
font-family: "Courier", monospace;
}
</style>
</head>
<body>
<h1>Register an Entry in ACME DNS</h1>
<p>This is the page where you can create an entry in ACME DNS. Please only do so when you need a new entry; there is currently no way to remove entries once they have been created.</p>
<p>See <a href="https://wiki.hamburg.ccc.de/infrastructure:services:acme_dns">the ACME DNS service</a> entry in the wiki for further details.</p>
<p><button id="register">Register a new entry</button></p>
<table id="results" style="display: none">
<tr>
<th>Full Domain</th><td id="fulldomain">undefined</td>
</tr>
<tr>
<th>Subdomain</th><td id="subdomain">undefined</td>
</tr>
<tr>
<th>X-Api-User</th><td id="username">undefined</td>
</tr>
<tr>
<th>X-Api-Key</th><td id="password">undefined</td>
</tr>
<caption><b>Important!</b> This information will only be shown once. Please
copy or otherwise save it immediately.</caption>
</table>
<p><b>Note: there is no way to delete registrations.</b> Each registration is small, so it's not an immediate problem, but please do not click register unless you are planning to really create a new entry.</p>
<script>
document.getElementById("register").addEventListener("click", (event) => {
const register = async () => {
const response = await fetch("/register", {
method: "POST"
});
if (!response.ok) {
console.log(response);
alert("Unable to register a new entry.");
return;
}
const registration = await response.json()
for (const key in registration) {
const e = document.getElementById(key);
if (e !== null) {
e.innerText = registration[key];
}
}
document.getElementById("results").style.display = "block";
}
register();
});
</script>
</body>