removed addresses and cwd from the config
This commit is contained in:
parent
f25a0191bd
commit
12e4a47855
|
@ -178,38 +178,6 @@ function fillConfig(config, args) {
|
|||
config.email = args.email;
|
||||
config.tls.acme.email = args.email;
|
||||
}
|
||||
|
||||
// maybe this should not go in config... but be ephemeral in some way?
|
||||
config.cwd = args.cwd || config.cwd || process.cwd();
|
||||
|
||||
var ipaddr = require('ipaddr.js');
|
||||
var addresses = [];
|
||||
var ifaces = require('../lib/local-ip.js').find();
|
||||
|
||||
Object.keys(ifaces).forEach(function (ifacename) {
|
||||
var iface = ifaces[ifacename];
|
||||
iface.ipv4.forEach(function (ip) {
|
||||
addresses.push(ip);
|
||||
});
|
||||
iface.ipv6.forEach(function (ip) {
|
||||
addresses.push(ip);
|
||||
});
|
||||
});
|
||||
|
||||
addresses.sort(function (a, b) {
|
||||
if (a.family !== b.family) {
|
||||
return 'IPv4' === a.family ? 1 : -1;
|
||||
}
|
||||
|
||||
return a.address > b.address ? 1 : -1;
|
||||
});
|
||||
|
||||
addresses.forEach(function (addr) {
|
||||
addr.range = ipaddr.parse(addr.address).range();
|
||||
});
|
||||
|
||||
// TODO maybe move to config.state.addresses (?)
|
||||
config.addresses = addresses;
|
||||
config.device = { hostname: require('os').hostname() };
|
||||
|
||||
config.tunnel = args.tunnel || config.tunnel;
|
||||
|
|
Loading…
Reference in New Issue