mirror of
https://github.com/tiennm99/open-domains.git
synced 2026-10-11 03:13:41 +00:00
Merge branch 'main' into main
This commit is contained in:
9 files changed
+123
-19
No files matched your search
+19
-19
@@ -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]);
|
||||
});
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user