From 1c9396216ab3b483869c356984c60950a7bbd483 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 6 Mar 2019 23:18:26 -0700 Subject: [PATCH] generate and store private key for telebit-remote --- bin/telebit-remote.js | 52 ++++- lib/keystore-fallback.js | 26 +++ lib/keystore-test.js | 22 ++ lib/keystore.js | 40 ++++ package-lock.json | 437 +++++++++++++++++++++++++++++++++++++-- package.json | 5 +- 6 files changed, 564 insertions(+), 18 deletions(-) create mode 100644 lib/keystore-fallback.js create mode 100644 lib/keystore-test.js create mode 100644 lib/keystore.js diff --git a/bin/telebit-remote.js b/bin/telebit-remote.js index 99183c2..66f9cdd 100755 --- a/bin/telebit-remote.js +++ b/bin/telebit-remote.js @@ -26,6 +26,9 @@ var camelCopy = recase.camelCopy.bind(recase); var urequest = require('@coolaj86/urequest'); var common = require('../lib/cli-common.js'); +var defaultConfPath = path.join(os.homedir(), '.config/telebit'); +var defaultConfFile = path.join(defaultConfPath, 'telebit.yml'); + var argv = process.argv.slice(2); var argIndex = argv.indexOf('--config'); @@ -40,6 +43,30 @@ if (-1 === argIndex) { } if (-1 !== argIndex) { confpath = argv.splice(argIndex, 2)[1]; + state.configArg = confpath; + // shortname + if (state.configArg) { + if (/^[\w:\.\-]+$/.test(state.configArg)) { + state.configDir = defaultConfPath; + state.configFile = path.join(defaultConfPath, confpath + '.yml'); + } else if (/[\/\\]$/.test(state.configArg)) { + state.configDir = state.configArg; + state.configFile = path.join(state.configDir, 'telebit.yml'); + } else if (/[\/\\][^\.\/\\]\.[^\.\/\\]$/.test(state.configArg)) { + state.configDir = path.pathname(state.configArg); + state.configFile = state.configArg; + } else { + console.error(); + console.error("Not a valid config path, file, or shortname: '%s'", state.configArg); + console.error(); + console.error("Valid config options look like this:"); + console.error(" Full path: ~/.config/telebit/telebit.yml (full path)"); + console.error(" Directory: ~/.config/telebit/ (directory)"); + console.error(" Shortname: lucky-duck (shortname)"); + process.exit(37); + } + confpath = state.configFile; + } } argIndex = argv.indexOf('--tty'); if (-1 !== argIndex) { @@ -58,7 +85,9 @@ function help() { var verstr = [ pkg.name + ' remote v' + pkg.version ]; if (!confpath) { - confpath = path.join(os.homedir(), '.config/telebit/telebit.yml'); + state.configDir = defaultConfPath; + state.configFile = defaultConfFile; + confpath = state.configFile; verstr.push('(--config \'' + confpath.replace(new RegExp('^' + os.homedir()), '~') + '\')'); } @@ -732,6 +761,25 @@ var parsers = { } }; -fs.readFile(confpath, 'utf8', parseConfig); +var keystore = require('../lib/keystore.js').create(state); +var keyname = 'telebit-remote'; +state.keystore = keystore; +state.keystoreSecure = !keystore.insecure; +keystore.get(keyname).then(function (jwk) { + if (jwk && jwk.kty) { + state.key = jwk; + fs.readFile(confpath, 'utf8', parseConfig); + return; + } + + console.info('Generating Private Key...'); + return require('keypairs').generate().then(function (jwk) { + return keystore.set(keyname, jwk).then(function () { + console.info("Generated New %s %s Private Key.", jwk.kty, (jwk.crv || Buffer.from(jwk.n, 'base64').byteLength * 8)); + state.key = jwk; + fs.readFile(confpath, 'utf8', parseConfig); + }); + }); +}); }()); diff --git a/lib/keystore-fallback.js b/lib/keystore-fallback.js new file mode 100644 index 0000000..782a3c4 --- /dev/null +++ b/lib/keystore-fallback.js @@ -0,0 +1,26 @@ +'use strict'; + +var fs = require('fs').promises; +var path = require('path'); + +module.exports.create = function (opts) { + return { + getPassword: function (service, name) { + var f = path.join(opts.configDir, name + '.key'); + return fs.readFile(f, 'utf8').catch(function (err) { + if ('ENOEXIST' === err.code) { + return; + } + }); + } + , setPassword: function (service, name, key) { + var f = path.join(opts.configDir, name + '.key'); + return fs.writeFile(f, key, 'utf8'); + } + , deletePassword: function (service, name) { + var f = path.join(opts.configDir, name + '.key'); + return fs.unlink(f); + } + , insecure: true + }; +}; diff --git a/lib/keystore-test.js b/lib/keystore-test.js new file mode 100644 index 0000000..859203c --- /dev/null +++ b/lib/keystore-test.js @@ -0,0 +1,22 @@ +'use strict'; + +var keystore = require('./keystore.js').create({ + configDir: require('path').join(require('os').homedir(), '.local/telebit/') +}); +var name = "testy-mctestface-1"; +return keystore.get(name).then(function (jwk) { + console.log("get1", typeof jwk, jwk); + if (!jwk || !jwk.kty) { + return require('keypairs').generate().then(function (jwk) { + var json = JSON.stringify(jwk.private); + return keystore.set(name, json).then(function () { + return keystore.get(name).then(function (val2) { + console.log("get2", val2); + }); + }).catch(function (err) { + console.log('badness', err); + }); + }); + } + return jwk; +}); diff --git a/lib/keystore.js b/lib/keystore.js new file mode 100644 index 0000000..69c6bbd --- /dev/null +++ b/lib/keystore.js @@ -0,0 +1,40 @@ +'use strict'; + +module.exports.create = function (opts) { + var service = "Telebit"; + var keytar; + try { + keytar = require('keytar'); + } catch(e) { + console.warn("Could not load native key management. Keys will be stored in plain text."); + keytar = require('./keystore-fallback.js').create(opts); + keytar.insecure = true; + } + + return { + get: function (name) { + return keytar.getPassword(service, name).then(maybeParse); + } + , set: function (name, value) { + return keytar.setPassword(service, name, maybeStringify(value)); + } + , delete: function (name) { + return keytar.deletePassword(service, name); + } + , insecure: keytar.insecure + }; +}; + +function maybeParse(str) { + if (str && '{' === str[0]) { + return JSON.parse(str); + } + return str; +} + +function maybeStringify(obj) { + if ('string' !== typeof obj && 'object' === typeof obj) { + return JSON.stringify(obj); + } + return obj; +} diff --git a/package-lock.json b/package-lock.json index 22a9787..f8adae0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,28 @@ "rsa-compat": "^1.9.2" } }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "optional": true + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -62,6 +84,16 @@ "file-uri-to-path": "1.0.0" } }, + "bl": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", + "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", + "optional": true, + "requires": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, "bluebird": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", @@ -96,6 +128,24 @@ "resolved": "https://registry.npmjs.org/cert-info/-/cert-info-1.5.0.tgz", "integrity": "sha512-3fE0DDJJ7FWwMsUqLqBd+FY5LQACK24R1p129BTCYMEe00Nql2Q9Dkr6TEBlZ8XJnNaSbjzf3qBLjLrD8KLutw==" }, + "chownr": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "optional": true + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -130,6 +180,27 @@ "ms": "2.0.0" } }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "optional": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "optional": true + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "optional": true + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -140,6 +211,17 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "optional": true + }, + "eckles": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/eckles/-/eckles-1.4.1.tgz", + "integrity": "sha512-auWyk/k8oSkVHaD4RxkPadKsLUcIwKgr/h8F7UZEueFDBO7BsE4y+H6IMUDbfqKIFPg/9MxV6KcBdJCmVVcxSA==" + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -150,6 +232,15 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "optional": true, + "requires": { + "once": "^1.4.0" + } + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -165,6 +256,12 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, + "expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "optional": true + }, "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -199,6 +296,28 @@ "readable-stream": "^2.0.0" } }, + "fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "optional": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, "generate-function": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-1.1.0.tgz", @@ -221,6 +340,12 @@ "pinkie-promise": "^2.0.0" } }, + "github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", + "optional": true + }, "greenlock": { "version": "2.6.7", "resolved": "https://registry.npmjs.org/greenlock/-/greenlock-2.6.7.tgz", @@ -235,6 +360,12 @@ "rsa-compat": "^1.9.2" } }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "optional": true + }, "http-errors": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", @@ -251,6 +382,12 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "optional": true + }, "into-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-2.0.1.tgz", @@ -259,6 +396,15 @@ "from2": "^2.1.1" } }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, "is-property": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", @@ -284,19 +430,22 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "keypairs": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/keypairs/-/keypairs-1.0.1.tgz", - "integrity": "sha512-vwzW+HWfifpSbjGP+qg3P2IXNrTc4tuFRxiVmddwZbV6jYkbARJOnGMQhG36OeBxW5/Ec1iBKDFTyoxjn+dLLg==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/keypairs/-/keypairs-1.2.5.tgz", + "integrity": "sha512-VKUxQ4iQB5LvVMtObOzNmZRfgXLTr5GMr+wg9A2BnILArBLrtg/DIuWRJQpDNRRfAGRQjHXxSVOW+7xpzIAY1Q==", "requires": { - "eckles": "^1.4.0", - "rasha": "^1.2.1" - }, - "dependencies": { - "eckles": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/eckles/-/eckles-1.4.0.tgz", - "integrity": "sha512-Bm5dpwhsBuoCHvKCY3gAvP8XFyXH7im8uAu3szykpVNbFBdC+lOuV8vLC8fvTYRZBfFqB+k/P6ud/ZPVO2V2tA==" - } + "eckles": "^1.4.1", + "rasha": "^1.2.4" + } + }, + "keytar": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-4.4.1.tgz", + "integrity": "sha512-6xEe7ybXSR5EZC+z0GI2yqLYZjV1tyPQY2xSZ8rGsBxrrLEh8VR/Lfqv59uGX+I+W+OZxH0jCXN1dU1++ify4g==", + "optional": true, + "requires": { + "nan": "2.12.1", + "prebuild-install": "5.2.4" } }, "le-challenge-fs": { @@ -343,6 +492,12 @@ "mime-db": "~1.33.0" } }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "optional": true + }, "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", @@ -367,6 +522,12 @@ "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", "optional": true }, + "napi-build-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", + "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==", + "optional": true + }, "ndjson": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/ndjson/-/ndjson-1.5.0.tgz", @@ -400,12 +561,45 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, + "node-abi": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.7.1.tgz", + "integrity": "sha512-OV8Bq1OrPh6z+Y4dqwo05HqrRL9YNF7QVMRfq1/pguwKLG+q9UB/Lk0x5qXjO23JjJg+/jqCHSTaG1P3tfKfuw==", + "optional": true, + "requires": { + "semver": "^5.4.1" + } + }, "node-forge": { "version": "0.7.6", "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.7.6.tgz", "integrity": "sha512-sol30LUpz1jQFBjOKwbjxijiE3b6pjd74YwfD0fJOKPjF+fONKb2Yg8rYgS6+bK6VDl+/wfr4IYpC7jDzLUIfw==", "optional": true }, + "noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", + "optional": true + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "optional": true + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -419,6 +613,21 @@ "ee-first": "1.1.1" } }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "optional": true + }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", @@ -442,6 +651,38 @@ "pinkie": "^2.0.0" } }, + "prebuild-install": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.2.4.tgz", + "integrity": "sha512-CG3JnpTZXdmr92GW4zbcba4jkDha6uHraJ7hW4Fn8j0mExxwOKK20hqho8ZuBDCKYCHYIkFM1P2jhtG+KpP4fg==", + "optional": true, + "requires": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.0", + "mkdirp": "^0.5.1", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "os-homedir": "^1.0.1", + "pump": "^2.0.1", + "rc": "^1.2.7", + "simple-get": "^2.7.0", + "tar-fs": "^1.13.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "optional": true + } + } + }, "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", @@ -461,6 +702,16 @@ "tasklist": "^3.1.0" } }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "optional": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "pyconf": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/pyconf/-/pyconf-1.1.6.tgz", @@ -475,9 +726,29 @@ "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" }, "rasha": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/rasha/-/rasha-1.2.1.tgz", - "integrity": "sha512-cs4Hu/rVF3/Qucq+V7lxSz449VfHNMVXJaeajAHno9H5FC1PWlmS4NM6IAX5jPKFF0IC2rOdHdf7iNxQuIWZag==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/rasha/-/rasha-1.2.4.tgz", + "integrity": "sha512-GsIwKv+hYSumJyK9wkTDaERLwvWaGYh1WuI7JMTBISfYt13TkKFU/HFzlY4n72p8VfXZRUYm0AqaYhkZVxOC3Q==" + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "optional": true + } + } }, "readable-stream": { "version": "2.3.6", @@ -535,6 +806,12 @@ "resolved": "https://registry.npmjs.org/sec/-/sec-1.0.0.tgz", "integrity": "sha1-Az1go60g7PLgCUDRT5eCNGV3QzU=" }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "optional": true + }, "send": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", @@ -605,11 +882,40 @@ } } }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "optional": true + }, "setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "optional": true + }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "optional": true + }, + "simple-get": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", + "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", + "optional": true, + "requires": { + "decompress-response": "^3.3.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "sni": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/sni/-/sni-1.0.0.tgz", @@ -641,6 +947,17 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -649,6 +966,60 @@ "safe-buffer": "~5.1.0" } }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "optional": true + }, + "tar-fs": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", + "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", + "optional": true, + "requires": { + "chownr": "^1.0.1", + "mkdirp": "^0.5.1", + "pump": "^1.0.0", + "tar-stream": "^1.1.2" + }, + "dependencies": { + "pump": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", + "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "optional": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "tar-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", + "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", + "optional": true, + "requires": { + "bl": "^1.0.0", + "buffer-alloc": "^1.2.0", + "end-of-stream": "^1.0.0", + "fs-constants": "^1.0.0", + "readable-stream": "^2.3.0", + "to-buffer": "^1.1.1", + "xtend": "^4.0.0" + } + }, "tasklist": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/tasklist/-/tasklist-3.1.0.tgz", @@ -675,11 +1046,26 @@ "xtend": "~4.0.1" } }, + "to-buffer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", + "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", + "optional": true + }, "toml": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/toml/-/toml-0.4.1.tgz", "integrity": "sha1-Iv5QHFe+WpV9o4JcHd5YS7LmL3M=" }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "optional": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -700,6 +1086,27 @@ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "optional": true + }, "ws": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/ws/-/ws-6.0.0.tgz", diff --git a/package.json b/package.json index 08692a6..29df0ee 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "finalhandler": "^1.1.1", "greenlock": "^2.6.7", "js-yaml": "^3.11.0", - "keypairs": "^1.0.1", + "keypairs": "^1.2.5", "mkdirp": "^0.5.1", "proxy-packer": "^2.0.2", "ps-list": "^5.0.0", @@ -72,6 +72,9 @@ "toml": "^0.4.1", "ws": "^6.0.0" }, + "optionalDependencies": { + "keytar": "^4.4.1" + }, "trulyOptionalDependencies": { "bluebird": "^3.5.1" },