start DNS configuration

This commit is contained in:
2026-05-14 14:45:14 -04:00
parent 21b87a3eb8
commit a257298436
4 changed files with 21 additions and 4 deletions
-1
View File
@@ -13,7 +13,6 @@ function DomainToCoreDNS(domain) {
async function GetAllRecords(domain) {
const prefix = DomainToCoreDNS(domain) + "/";
console.log(prefix);
if (!prefix) throw new Error("Invalid domain");
const kvs = await client.getAll().prefix(prefix).strings();
+11
View File
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Default Page</title>
</head>
<body>
<p>This is the default web page. Please configure your DNS.</p>
</body>
</html>
+5 -2
View File
@@ -6,7 +6,7 @@ const database = require('../database.js');
const dbConnection = database.db;
const Sequelize = require('sequelize');
const pageTitle = 'Domain Manager | Edit DNS';
const { GetAllRecords } = require('../coredns_bridge.js');
// Manage domains
router.get('/dns/edit/:domainId', authMw.AllowIfAuthenticated, async (req, res, next) => {
@@ -24,7 +24,10 @@ router.get('/dns/edit/:domainId', authMw.AllowIfAuthenticated, async (req, res,
if(!result)
return next();
res.render('dns', {title: pageTitle, domain: result});
const fullDomain = result.domain + "." + result.tld;
let records = GetAllRecords(fullDomain);
res.render('dns', {title: pageTitle, domain: result, dnsRecords: records});
});
module.exports = router;
+5 -1
View File
@@ -1 +1,5 @@
<p>Configuring DNS records for {{domain.domain}}.{{domain.tld}}</p>
<p>Configuring DNS records for {{domain.domain}}.{{domain.tld}}</p>
{{#each dnsRecords}}
{{this}}
{{/each}}