Skip to content

Commit

Permalink
Revert "Replaced keypair with rsa-keypair module (#10758)"
Browse files Browse the repository at this point in the history
This reverts commit 6473569.

- `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
  • Loading branch information
kevinansfield committed Jun 26, 2019
1 parent dd727a4 commit 3229de7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
10 changes: 6 additions & 4 deletions core/server/models/settings.js
Expand Up @@ -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'),
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 4 additions & 5 deletions yarn.lock
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 3229de7

Please sign in to comment.