godaddy: add missing customNameservers check
This commit is contained in:
+4
-2
@@ -163,12 +163,14 @@ async function verifyDomainConfig(domainObject) {
|
|||||||
|
|
||||||
if (!domainConfig.apiKey || typeof domainConfig.apiKey !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'apiKey must be a non-empty string');
|
if (!domainConfig.apiKey || typeof domainConfig.apiKey !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'apiKey must be a non-empty string');
|
||||||
if (!domainConfig.apiSecret || typeof domainConfig.apiSecret !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'apiSecret must be a non-empty string');
|
if (!domainConfig.apiSecret || typeof domainConfig.apiSecret !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'apiSecret must be a non-empty string');
|
||||||
|
if ('customNameservers' in domainConfig && typeof domainConfig.customNameservers !== 'boolean') throw new BoxError(BoxError.BAD_FIELD, 'customNameservers must be a boolean');
|
||||||
|
|
||||||
const ip = '127.0.0.1';
|
const ip = '127.0.0.1';
|
||||||
|
|
||||||
const credentials = {
|
const credentials = {
|
||||||
apiKey: domainConfig.apiKey,
|
apiKey: domainConfig.apiKey,
|
||||||
apiSecret: domainConfig.apiSecret
|
apiSecret: domainConfig.apiSecret,
|
||||||
|
customNameservers: !!domainConfig.customNameservers
|
||||||
};
|
};
|
||||||
|
|
||||||
if (constants.TEST) return credentials; // this shouldn't be here
|
if (constants.TEST) return credentials; // this shouldn't be here
|
||||||
@@ -179,7 +181,7 @@ async function verifyDomainConfig(domainObject) {
|
|||||||
|
|
||||||
if (!nameservers.every(function (n) { return n.toLowerCase().indexOf('.domaincontrol.com') !== -1 || n.toLowerCase().indexOf('.secureserver.net') !== -1; })) {
|
if (!nameservers.every(function (n) { return n.toLowerCase().indexOf('.domaincontrol.com') !== -1 || n.toLowerCase().indexOf('.secureserver.net') !== -1; })) {
|
||||||
debug('verifyDomainConfig: %j does not contain GoDaddy NS', nameservers);
|
debug('verifyDomainConfig: %j does not contain GoDaddy NS', nameservers);
|
||||||
throw new BoxError(BoxError.BAD_FIELD, 'Domain nameservers are not set to GoDaddy');
|
if (!domainConfig.customNameservers) throw new BoxError(BoxError.BAD_FIELD, 'Domain nameservers are not set to GoDaddy');
|
||||||
}
|
}
|
||||||
|
|
||||||
const location = 'cloudrontestdns';
|
const location = 'cloudrontestdns';
|
||||||
|
|||||||
Reference in New Issue
Block a user