remove unused files

This commit is contained in:
AJ ONeal 2015-11-28 05:44:52 +00:00
parent aa54664f80
commit c93c33f97f
4 changed files with 5 additions and 68 deletions

9
.gitignore vendored
View File

@ -1,13 +1,4 @@
redirects.json
Caddyfile
sites-available
sites-enabled
dyndns-token.js
vhosts
certs
.*.sw*
packages
var
# Logs
logs

View File

@ -14,8 +14,8 @@ var path = require('path');
//var minWorkers = 2;
var numCores = 2; // Math.max(minWorkers, require('os').cpus().length);
var workers = [];
var caddypath = '/usr/local/bin/caddy';
var useCaddy = require('fs').existsSync(caddypath);
var config = require('../../config');
var useCaddy = require('fs').existsSync(config.caddy.bin);
var conf = {
localPort: process.argv[2] || (useCaddy ? 4080 : 443) // system / local network
, insecurePort: process.argv[3] || (useCaddy ? 80 : 80) // meh
@ -24,7 +24,7 @@ var conf = {
// TODO externalInsecurePort?
, locked: false // TODO XXX
, ipcKey: null
, caddyfilepath: path.join(__dirname, '..', '..', 'Caddyfile')
, caddyfilepath: config.caddy.conf
, sitespath: path.join(__dirname, '..', '..', 'sites-enabled')
};
var state = {};
@ -45,7 +45,6 @@ cluster.on('online', function (worker) {
// TODO XXX Should these be configurable? If so, where?
var certPaths = [path.join(__dirname, '..', '..', 'certs', 'live')];
var info;
var config = require('../../config');
conf.ddns = config.ddns;
conf.redirects = config.redirects;
@ -87,8 +86,8 @@ cluster.on('online', function (worker) {
info.conf.sqlite3Sock = conf.sqlite3Sock;
// TODO get this from db config instead
var config = require('../../config');
info.conf.primaryNameserver = config.primaryNameserver;
info.conf.nameservers = config.nameservers;
info.conf.primaryNameserver = config.ddns.primaryNameserver;
info.conf.nameservers = config.ddns.nameservers;
// TODO get this from db config instead
info.conf.privkey = config.privkey;
info.conf.pubkey = config.pubkey;

View File

@ -1,52 +0,0 @@
#!/usr/bin/env node
'use strict';
// TODO have a quick timeout
require('ipify')(function (err, ip) {
console.log('ip', ip);
var path = require('path');
// dig -p 53 @redirect-www.org pi.nadal.daplie.com A
var updateIp = require('./holepunch/helpers/update-ip.js').update;
var redirects = require('./redirects');
var ddns = [];
var ddnsMap = {};
function add(hostname) {
ddns.push({
"name": hostname
, "answer": ip
});
}
redirects.forEach(function (r) {
if (!ddnsMap[r.from.hostname.toLowerCase()]) {
add(r.from.hostname);
}
if (!ddnsMap[r.to.hostname.toLowerCase()]) {
add(r.to.hostname);
}
});
return updateIp({
updater: 'ns1.redirect-www.org'
, port: 65443
, cacert: path.join(__dirname, 'certs/ca/ns1-test.root.crt.pem')
, ddns: ddns
, token: token
}).then(function (data) {
if ('string' === typeof data) {
try {
data = JSON.parse(data);
} catch(e) {
console.error('[ERROR] bad json response');
console.error(data);
}
}
console.log(JSON.stringify(data, null, ' '));
console.log('Test with');
console.log('dig <<hostname>> A');
});
});

View File

@ -1 +0,0 @@
module.exports = { token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy.zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" };