Make DNS servers fully dynamic from config.json
DNS server IDs (dns1, dns2, dns3) were hardcoded throughout the frontend and backend. Now config.json's dnsServers object is the single source of truth — adding or removing a DNS server in config automatically updates the dashboard cards, credential modal, health checks, and probes. - credentials.js: rebuild modal sections dynamically from SITE.dnsServers - globals.js: add getPrimaryDnsId() helper for primary DNS lookups - service-create.js, service-infrastructure.js: use dynamic DNS ID - startup-validator.js: dynamic topCardServices from config - middleware.js: add license endpoints to public routes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -85,6 +85,14 @@ function getDnsServerAddr(dnsId) {
|
||||
const s = SITE.dnsServers[dnsId];
|
||||
return s ? `${s.ip}:${s.port}` : buildDomain(dnsId);
|
||||
}
|
||||
/** Get the DNS ID whose IP matches the primary DNS config (dns.ip) */
|
||||
function getPrimaryDnsId() {
|
||||
if (!SITE.dnsIp) return null;
|
||||
for (const [id, info] of Object.entries(SITE.dnsServers)) {
|
||||
if (info.ip === SITE.dnsIp) return id;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// ===== DYNAMIC DNS CARD RENDERER =====
|
||||
function renderDnsCards() {
|
||||
|
||||
Reference in New Issue
Block a user