Also support noop dns provider in settings backend

This commit is contained in:
Johannes
2016-10-25 14:55:20 +02:00
parent e7c82b3bf7
commit 0c6a2008ff
+6 -1
View File
@@ -325,6 +325,11 @@ function setDnsConfig(dnsConfig, callback) {
provider: dnsConfig.provider
};
validator = function (caasConfig, next) { return next(); };
} else if (dnsConfig.provider === 'noop') {
credentials = {
provider: dnsConfig.provider
};
validator = function (noopConfig, next) { return next(); };
} else if (dnsConfig.provider === 'digitalocean') {
if (typeof dnsConfig.token !== 'string') return callback(new SettingsError(SettingsError.BAD_FIELD, 'token must be a string'));
@@ -334,7 +339,7 @@ function setDnsConfig(dnsConfig, callback) {
};
validator = function (digitaloceanConfig, next) { return next(); };
} else {
return callback(new SettingsError(SettingsError.BAD_FIELD, 'provider must be route53, digitalocean or caas'));
return callback(new SettingsError(SettingsError.BAD_FIELD, 'provider must be route53, digitalocean, noop or caas'));
}
validator(credentials, function (error) {