start DNS configuration
This commit is contained in:
@@ -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
@@ -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
@@ -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;
|
||||
@@ -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}}
|
||||
Reference in New Issue
Block a user