Revert "Replaced keypair with rsa-keypair module (#10758)"

This reverts commit 64735693be.

- `rsa-keypair` is a binary dependency that was failing to install for a lot of users, reverting for now so we can look at alternative options for speeding up boot time
This commit is contained in:
Kevin Ansfield 2019-06-26 13:58:50 +01:00
parent dd727a44df
commit 3229de75f8
3 changed files with 11 additions and 10 deletions

View File

@ -2,7 +2,7 @@ const Promise = require('bluebird'),
_ = require('lodash'),
uuid = require('uuid'),
crypto = require('crypto'),
keypair = require('rsa-keypair'),
keypair = require('keypair'),
ghostBookshelf = require('./base'),
common = require('../lib/common'),
validation = require('../data/validation'),
@ -25,10 +25,12 @@ function parseDefaultSettings() {
theme_session_secret: crypto.randomBytes(32).toString('hex')
};
const membersKeypair = keypair.generate(1024);
const membersKeypair = keypair({
bits: 1024
});
dynamicDefault.members_public_key = membersKeypair.publicKey;
dynamicDefault.members_private_key = membersKeypair.privateKey;
dynamicDefault.members_public_key = membersKeypair.public;
dynamicDefault.members_private_key = membersKeypair.private;
_.each(defaultSettingsInCategories, function each(settings, categoryName) {
_.each(settings, function each(setting, settingName) {

View File

@ -89,6 +89,7 @@
"js-yaml": "3.13.1",
"jsonpath": "1.0.0",
"jsonwebtoken": "8.4.0",
"keypair": "1.0.1",
"knex": "0.14.6",
"knex-migrator": "3.2.5",
"lodash": "4.17.11",
@ -112,7 +113,6 @@
"passport-oauth2-client-password": "0.1.2",
"path-match": "1.2.4",
"probe-image-size": "4.0.0",
"rsa-keypair": "^2.0.2",
"rss": "1.2.2",
"sanitize-html": "1.20.0",
"semver": "5.6.0",

View File

@ -3949,6 +3949,10 @@ keygrip@~1.0.2, keygrip@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/keygrip/-/keygrip-1.0.3.tgz#399d709f0aed2bab0a059e0cdd3a5023a053e1dc"
keypair@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/keypair/-/keypair-1.0.1.tgz#7603719270afb6564ed38a22087a06fc9aa4ea1b"
keyv@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.0.0.tgz#44923ba39e68b12a7cec7df6c3268c031f2ef373"
@ -6262,11 +6266,6 @@ rimraf@~2.4.0:
dependencies:
glob "^6.0.1"
rsa-keypair@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/rsa-keypair/-/rsa-keypair-2.0.2.tgz#47ec7fa29486ceaefdd1af1f80f1db2284dba236"
integrity sha512-FmMjEQrH9oJrBy13wMbSQx1bomRbub7mzxwvVuXFvqJIeZ7NkWd9NJhFoeftd4lzQAeLP8/avm7HHmtEIGLHpQ==
rss@1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/rss/-/rss-1.2.2.tgz#50a1698876138133a74f9a05d2bdc8db8d27a921"