From e45264673aea176b3f623b9144be7aa2db4f197b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 21 Nov 2015 12:37:04 +0000 Subject: [PATCH] ddns config fixes --- holepunch/helpers/update-ip.js | 2 +- lib/ddns-updater.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/holepunch/helpers/update-ip.js b/holepunch/helpers/update-ip.js index 515f234..b1a7c53 100644 --- a/holepunch/helpers/update-ip.js +++ b/holepunch/helpers/update-ip.js @@ -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); } diff --git a/lib/ddns-updater.js b/lib/ddns-updater.js index e29db7b..e979341 100644 --- a/lib/ddns-updater.js +++ b/lib/ddns-updater.js @@ -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