diff --git a/dnsconfig.js b/dnsconfig.js index 91edf7fe..73c11366 100644 --- a/dnsconfig.js +++ b/dnsconfig.js @@ -12,21 +12,21 @@ function getDomainsList(filesPath) { var result = []; var files = glob.apply(null, [filesPath, true, '.json']); - files.forEach(file => { + files.forEach(function(file) { try { - const basename = file.split('/').pop(); - const name = basename.split('.')[0]; - const data = require(file); + var basename = file.split('/').pop(); + var name = basename.split('.')[0]; + var data = require(file); // Validate required fields if (!data.domain || !data.record) { - console.error(`Missing required fields in ${file}`); + console.error("Missing required fields in " + file); return; } - result.push({ name, data }); + result.push({ name: name, data: data }); } catch (error) { - console.error(`Error loading ${file}:`, error); + console.error("Error loading " + file + ":", error); } }); @@ -45,9 +45,9 @@ function addRecord(domain, record) { } // Process each domain -domains.forEach(domainEntry => { - const domainData = domainEntry.data; - let proxyState = proxy.on; // Default to enabled +domains.forEach(function(domainEntry) { + var domainData = domainEntry.data; + var proxyState = proxy.on; // Default to enabled if (domainData.proxied === false) { proxyState = proxy.off; @@ -58,14 +58,14 @@ domains.forEach(domainEntry => { // Handle A records if (domainData.record.A) { - domainData.record.A.forEach(ipAddress => { + domainData.record.A.forEach(function(ipAddress) { addRecord(domainData.domain, A(domainData.subdomain, IP(ipAddress), proxyState)); }); } // Handle AAAA records if (domainData.record.AAAA) { - domainData.record.AAAA.forEach(ipv6 => { + domainData.record.AAAA.forEach(function(ipv6) { addRecord(domainData.domain, AAAA(domainData.subdomain, ipv6, proxyState)); }); } @@ -77,48 +77,48 @@ domains.forEach(domainEntry => { // Handle MX records if (domainData.record.MX) { - domainData.record.MX.forEach(mx => { + domainData.record.MX.forEach(function(mx) { addRecord(domainData.domain, MX(domainData.subdomain, 10, mx + ".")); }); } // Handle NS records if (domainData.record.NS) { - domainData.record.NS.forEach(ns => { + domainData.record.NS.forEach(function(ns) { addRecord(domainData.domain, NS(domainData.subdomain, ns + ".")); }); } // Handle TXT records if (domainData.record.TXT) { - domainData.record.TXT.forEach(txt => { + domainData.record.TXT.forEach(function(txt) { addRecord(domainData.domain, TXT(domainData.subdomain, txt)); }); } // Handle CAA records if (domainData.record.CAA) { - domainData.record.CAA.forEach(caaRecord => { + domainData.record.CAA.forEach(function(caaRecord) { addRecord(domainData.domain, CAA(domainData.subdomain, caaRecord.flags, caaRecord.tag, caaRecord.value)); }); } // Handle SRV records if (domainData.record.SRV) { - domainData.record.SRV.forEach(srvRecord => { + domainData.record.SRV.forEach(function(srvRecord) { addRecord(domainData.domain, SRV(domainData.subdomain, srvRecord.priority, srvRecord.weight, srvRecord.port, srvRecord.target + ".")); }); } // Handle PTR records if (domainData.record.PTR) { - domainData.record.PTR.forEach(ptr => { + domainData.record.PTR.forEach(function(ptr) { addRecord(domainData.domain, PTR(domainData.subdomain, ptr + ".")); }); } }); // Commit all DNS records for each domain -Object.keys(recordsByDomain).forEach(domainName => { +Object.keys(recordsByDomain).forEach(function(domainName) { D(domainName, regNone, providerCf, recordsByDomain[domainName]); }); diff --git a/domains/app.is-cool.dev.json b/domains/app.is-cool.dev.json new file mode 100644 index 00000000..5859125f --- /dev/null +++ b/domains/app.is-cool.dev.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple apps", + "domain": "is-cool.dev", + "subdomain": "app", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file diff --git a/domains/app.is-local.org.json b/domains/app.is-local.org.json new file mode 100644 index 00000000..321dfa3e --- /dev/null +++ b/domains/app.is-local.org.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple apps", + "domain": "is-local.org", + "subdomain": "app", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file diff --git a/domains/jonathan.is-a-fullstack.dev.json b/domains/jonathan.is-a-fullstack.dev.json new file mode 100644 index 00000000..9ac4e748 --- /dev/null +++ b/domains/jonathan.is-a-fullstack.dev.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple projects, apps or sites related to JonathanXDR", + "domain": "is-a-fullstack.dev", + "subdomain": "jonathan", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file diff --git a/domains/jonathan.is-cool.dev.json b/domains/jonathan.is-cool.dev.json new file mode 100644 index 00000000..d3b59fbf --- /dev/null +++ b/domains/jonathan.is-cool.dev.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple projects, apps or sites related to JonathanXDR", + "domain": "is-cool.dev", + "subdomain": "jonathan", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file diff --git a/domains/project.is-cool.dev.json b/domains/project.is-cool.dev.json new file mode 100644 index 00000000..5ea14427 --- /dev/null +++ b/domains/project.is-cool.dev.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple projects", + "domain": "is-cool.dev", + "subdomain": "project", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file diff --git a/domains/project.is-local.org.json b/domains/project.is-local.org.json new file mode 100644 index 00000000..776ba140 --- /dev/null +++ b/domains/project.is-local.org.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple projects", + "domain": "is-local.org", + "subdomain": "project", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file diff --git a/domains/site.is-cool.dev.json b/domains/site.is-cool.dev.json new file mode 100644 index 00000000..395abd9b --- /dev/null +++ b/domains/site.is-cool.dev.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple sites", + "domain": "is-cool.dev", + "subdomain": "site", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file diff --git a/domains/site.is-local.org.json b/domains/site.is-local.org.json new file mode 100644 index 00000000..cf306295 --- /dev/null +++ b/domains/site.is-local.org.json @@ -0,0 +1,13 @@ +{ + "description": "Subdomain for hosting multiple sites", + "domain": "is-local.org", + "subdomain": "site", + "owner": { + "username": "JonathanXDR", + "email": "jonathan.russ@bluewin.ch" + }, + "record": { + "NS": ["ns1.vercel-dns.com", "ns2.vercel-dns.com"] + }, + "proxied": false +} \ No newline at end of file