replace ipaddr.js
This commit is contained in:
@@ -16,7 +16,6 @@ const assert = require('assert'),
|
||||
debug = require('debug')('box:dns/cloudflare'),
|
||||
dig = require('../dig.js'),
|
||||
dns = require('../dns.js'),
|
||||
ipaddr = require('ipaddr.js'),
|
||||
safe = require('safetydance'),
|
||||
superagent = require('../superagent.js'),
|
||||
waitForDns = require('./waitfordns.js'),
|
||||
@@ -144,10 +143,8 @@ async function upsert(domainObject, location, type, values) {
|
||||
};
|
||||
|
||||
if (i >= records.length) { // create a new record
|
||||
// cloudflare will error if proxied is set for wrong record type or IP
|
||||
if (type === 'A' || type === 'AAAA' || type === 'CNAME') {
|
||||
const isUnicast = ipaddr.parse(value).range() === 'unicast';
|
||||
data.proxied = isUnicast ? !!domainConfig.defaultProxyStatus : false; // only set at install time
|
||||
data.proxied = !!domainConfig.defaultProxyStatus; // note that cloudflare will error if proxied is set for wrong record type or IP. only set at install time
|
||||
}
|
||||
|
||||
debug(`upsert: Adding new record fqdn: ${fqdn}, zoneName: ${zoneName} proxied: ${data.proxied}`);
|
||||
|
||||
Reference in New Issue
Block a user