v2.7.9: further simplify storage module requirements

This commit is contained in:
AJ ONeal 2019-04-05 18:24:34 -06:00
parent 51ef9be517
commit d5d14bd968
4 changed files with 19 additions and 24 deletions

View File

@ -28,14 +28,12 @@ function promisifyAllStore(obj) {
var p;
if (1 === obj[key].length) {
// wrap just in case it's synchronous (or improperly throws)
p = function (opts) {
return PromiseA.resolve(obj[key](opts));
};
p = function (opts) { return PromiseA.resolve().then(function () { obj[key](opts); }) };
} else {
p = util.promisify(obj[key]);
}
// internal backwards compat
obj[key + 'Async'] = util.promisify(obj[key]);
obj[key + 'Async'] = p;
});
obj.__promisified = true;
return obj;

View File

@ -494,25 +494,22 @@ module.exports.create = function (gl) {
// returns pems
return gl.store.certificates.checkAsync(args).then(function (cert) {
if (cert) {
cert = utils.attachCertInfo(cert);
if (utils.certHasDomain(cert, args.domain)) {
log(args.debug, 'checkAsync found existing certificates');
if (!cert) { log(args.debug, 'checkAsync failed to find certificates'); return null; }
if (cert.privkey) {
cert = utils.attachCertInfo(cert);
if (utils.certHasDomain(cert, args.domain)) {
log(args.debug, 'checkAsync found existing certificates');
if (cert.privkey) {
return cert;
} else {
return gl.store.certificates.checkKeypairAsync(args).then(function (keypair) {
cert.privkey = RSA.exportPrivatePem(keypair).privateKeyPem;
return cert;
} else {
return gl.store.certificates.checkKeypairAsync(args).then(function (keypair) {
cert.privkey = RSA.exportPrivatePem(keypair).privateKeyPem;
return cert;
});
}
});
}
log(args.debug, 'checkAsync found mismatched / incomplete certificates');
}
log(args.debug, 'checkAsync failed to find certificates');
return null;
log(args.debug, 'checkAsync found mismatched / incomplete certificates');
});
}
// Certificates

8
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "greenlock",
"version": "2.7.7",
"version": "2.7.9",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -64,9 +64,9 @@
"integrity": "sha512-aEUP+DB5mfHi4kHY37nJdtVr+DIF5vxiXKdiZBPOLNgF7pK3iD0wJU6fiwDRtZRz2KOahX+VBxlgTN2r24nKhw=="
},
"le-store-certbot": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/le-store-certbot/-/le-store-certbot-2.2.1.tgz",
"integrity": "sha512-BhljZjTULhbNBAT6RBiv4TeZegFraMxURYEvh3WRUI048zmXf4ZfC8gwbdu5fnD2tTCsS9fbsCOAQyrFBl4jlA==",
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/le-store-certbot/-/le-store-certbot-2.2.2.tgz",
"integrity": "sha512-KOU8O2KAtUUiNj8SGdj4gg7v6Je2v5E/2IipzVIvs2bBM6+OsbVTFKz7/7PKm4t2dT2IoI93TYpi69lV29fkpQ==",
"requires": {
"mkdirp": "^0.5.1",
"pyconf": "^1.1.5",

View File

@ -1,6 +1,6 @@
{
"name": "greenlock",
"version": "2.7.9-rc1",
"version": "2.7.9",
"description": "Let's Encrypt for node.js on npm",
"main": "index.js",
"files": [