fold sysinfo into network
the backends are network backends
This commit is contained in:
+7
-7
@@ -29,10 +29,10 @@ const apps = require('./apps.js'),
|
||||
domains = require('./domains.js'),
|
||||
ipaddr = require('ipaddr.js'),
|
||||
mail = require('./mail.js'),
|
||||
network = require('./network.js'),
|
||||
promiseRetry = require('./promise-retry.js'),
|
||||
safe = require('safetydance'),
|
||||
settings = require('./settings.js'),
|
||||
sysinfo = require('./sysinfo.js'),
|
||||
tld = require('tldjs');
|
||||
|
||||
// choose which subdomain backend we use for test purpose we use route53
|
||||
@@ -121,12 +121,12 @@ async function checkDnsRecords(subdomain, domain) {
|
||||
if (cnameRecords.length !== 0) return { needsOverwrite: true };
|
||||
|
||||
const ipv4Records = await getDnsRecords(subdomain, domain, 'A');
|
||||
const ipv4 = await sysinfo.getServerIPv4();
|
||||
const ipv4 = await network.getIPv4();
|
||||
|
||||
// if empty OR exactly one record with the ip, we don't need to overwrite
|
||||
if (ipv4Records.length !== 0 && (ipv4Records.length !== 1 || ipv4Records[0] !== ipv4)) return { needsOverwrite: true };
|
||||
|
||||
const ipv6 = await sysinfo.getServerIPv6();
|
||||
const ipv6 = await network.getIPv6();
|
||||
if (ipv6) {
|
||||
const ipv6Records = await getDnsRecords(subdomain, domain, 'AAAA');
|
||||
|
||||
@@ -218,8 +218,8 @@ async function registerLocations(locations, options, progressCallback) {
|
||||
|
||||
debug(`registerLocations: Will register ${JSON.stringify(locations)} with options ${JSON.stringify(options)}`);
|
||||
|
||||
const ipv4 = await sysinfo.getServerIPv4();
|
||||
const ipv6 = await sysinfo.getServerIPv6();
|
||||
const ipv4 = await network.getIPv4();
|
||||
const ipv6 = await network.getIPv6();
|
||||
|
||||
for (const location of locations) {
|
||||
const fqdn = `${location.subdomain ? (location.subdomain + '.') : ''}${location.domain}`;
|
||||
@@ -254,8 +254,8 @@ async function unregisterLocations(locations, progressCallback) {
|
||||
assert(Array.isArray(locations));
|
||||
assert.strictEqual(typeof progressCallback, 'function');
|
||||
|
||||
const ipv4 = await sysinfo.getServerIPv4();
|
||||
const ipv6 = await sysinfo.getServerIPv6();
|
||||
const ipv4 = await network.getIPv4();
|
||||
const ipv6 = await network.getIPv6();
|
||||
|
||||
for (const location of locations) {
|
||||
progressCallback({ message: `Unregistering location: ${location.subdomain ? (location.subdomain + '.') : ''}${location.domain}` });
|
||||
|
||||
Reference in New Issue
Block a user