lighten the load

This commit is contained in:
AJ ONeal 2018-06-29 02:51:35 -06:00
parent 24d1be590f
commit ba7abf1897
4 changed files with 20 additions and 11 deletions

View File

@ -74,19 +74,17 @@ Install
npm install --save greenlock@2.x npm install --save greenlock@2.x
``` ```
<small>
**Optional** dependency for *more efficient* RSA key generation: **Optional** dependency for *more efficient* RSA key generation:
<small>(important for those on ARM devices like Raspberry Pi)</small>
```bash ```bash
npm install --save ursa npm install --save ursa
``` ```
(important for those on ARM devices like Raspberry Pi)
**Optional** dependency for *Let's Encrypt v01* (pre-draft ACME spec) compatibility: **Optional** dependency for *Let's Encrypt v01* (pre-draft ACME spec) compatibility:
<small>(important for those on ARM devices like Raspberry Pi)</small>
```bash ```bash
npm install --save le-acme-core npm install --save le-acme-core
``` ```
(important for those on ARM devices like Raspberry Pi)
</small>
### Production vs Staging ### Production vs Staging

View File

@ -3,6 +3,12 @@
var DAY = 24 * 60 * 60 * 1000; var DAY = 24 * 60 * 60 * 1000;
//var MIN = 60 * 1000; //var MIN = 60 * 1000;
var ACME = require('acme-v2/compat').ACME; var ACME = require('acme-v2/compat').ACME;
var PromiseA;
try {
PromiseA = require('bluebird');
} catch(e) {
PromiseA = global.Promise;
}
var Greenlock = module.exports; var Greenlock = module.exports;
Greenlock.Greenlock = Greenlock; Greenlock.Greenlock = Greenlock;
@ -70,8 +76,6 @@ Greenlock._undefine = function (gl) {
return gl; return gl;
}; };
Greenlock.create = function (gl) { Greenlock.create = function (gl) {
var PromiseA = require('bluebird');
gl.store = gl.store || require('le-store-certbot').create({ gl.store = gl.store || require('le-store-certbot').create({
debug: gl.debug debug: gl.debug
, configDir: gl.configDir , configDir: gl.configDir

View File

@ -1,5 +1,12 @@
'use strict'; 'use strict';
var PromiseA;
try {
PromiseA = require('bluebird');
} catch(e) {
PromiseA = global.Promise;
}
function _log(debug) { function _log(debug) {
if (debug) { if (debug) {
var args = Array.prototype.slice.call(arguments); var args = Array.prototype.slice.call(arguments);
@ -10,7 +17,6 @@ function _log(debug) {
} }
module.exports.create = function (gl) { module.exports.create = function (gl) {
var PromiseA = require('bluebird');
var utils = require('./utils'); var utils = require('./utils');
var RSA = PromiseA.promisifyAll(require('rsa-compat').RSA); var RSA = PromiseA.promisifyAll(require('rsa-compat').RSA);
var log = gl.log || _log; // allow custom log var log = gl.log || _log; // allow custom log

View File

@ -1,6 +1,6 @@
{ {
"name": "greenlock", "name": "greenlock",
"version": "2.2.20", "version": "2.3.0",
"description": "Let's Encrypt for node.js on npm", "description": "Let's Encrypt for node.js on npm",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -57,9 +57,10 @@
"devDependencies": { "devDependencies": {
"request": "^2.75.0" "request": "^2.75.0"
}, },
"optionalDependencies": { "trulyOptionalDependencies": {
"bluebird": "^3.5.1", "bluebird": "^3.5.1",
"le-acme-core": "^2.1.3" "le-acme-core": "^2.1.3",
"ursa": "^0.9.4"
}, },
"dependencies": { "dependencies": {
"acme": "^1.0.6", "acme": "^1.0.6",
@ -71,7 +72,7 @@
"le-store-certbot": "^2.1.0", "le-store-certbot": "^2.1.0",
"node.extend": "^1.1.5", "node.extend": "^1.1.5",
"pkijs": "^1.3.27", "pkijs": "^1.3.27",
"rsa-compat": "^1.3.2" "rsa-compat": "^1.4.0"
}, },
"engines": { "engines": {
"node": ">=4.5" "node": ">=4.5"