ddns config fixes

This commit is contained in:
AJ ONeal 2015-11-21 12:37:04 +00:00
parent 4f23dae53e
commit e45264673a
2 changed files with 5 additions and 4 deletions

View File

@ -38,7 +38,7 @@ module.exports.update = function (opts) {
options.ca = opts.cacert;
}
options.ca = options.ca.map(function (str) {
options.ca = (options.ca||[]).map(function (str) {
if ('string' === typeof str && str.length < 1000) {
str = fs.readFileAsync(str);
}

View File

@ -15,8 +15,8 @@ function update(hostnames, addresses) {
// TODO use API to add and remove nameservers
var services = [
// TODO XXX don't disable cacert checking
{ hostname: 'ns1.redirect-www.org', port: 65443, cacert: false, pathname: '/api/dns' }
, { hostname: 'ns2.redirect-www.org', port: 65443, cacert: false, pathname: '/api/dns' }
{ hostname: 'ns1.redirect-www.org', port: 6443, cacert: false, pathname: '/api/com.daplie.dns/ddns' }
, { hostname: 'ns2.redirect-www.org', port: 6443, cacert: false, pathname: '/api/com.daplie.dns/ddns' }
// { cacert = [path.join(__dirname, '..', 'certs', 'ca', 'my-root-ca.crt.pem')] };
];
var answers = [];
@ -52,8 +52,9 @@ function update(hostnames, addresses) {
promises = services.map(function (service, i) {
return updateIp({
updater: service.hostname
hostname: service.hostname
, port: service.port
, pathname: service.pathname
, cacert: service.cacert
, token: token
, ddns: answers