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; var p;
if (1 === obj[key].length) { if (1 === obj[key].length) {
// wrap just in case it's synchronous (or improperly throws) // wrap just in case it's synchronous (or improperly throws)
p = function (opts) { p = function (opts) { return PromiseA.resolve().then(function () { obj[key](opts); }) };
return PromiseA.resolve(obj[key](opts));
};
} else { } else {
p = util.promisify(obj[key]); p = util.promisify(obj[key]);
} }
// internal backwards compat // internal backwards compat
obj[key + 'Async'] = util.promisify(obj[key]); obj[key + 'Async'] = p;
}); });
obj.__promisified = true; obj.__promisified = true;
return obj; return obj;

View File

@ -494,25 +494,22 @@ module.exports.create = function (gl) {
// returns pems // returns pems
return gl.store.certificates.checkAsync(args).then(function (cert) { return gl.store.certificates.checkAsync(args).then(function (cert) {
if (cert) { if (!cert) { log(args.debug, 'checkAsync failed to find certificates'); return null; }
cert = utils.attachCertInfo(cert);
if (utils.certHasDomain(cert, args.domain)) {
log(args.debug, 'checkAsync found existing certificates');
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; 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 found mismatched / incomplete certificates');
log(args.debug, 'checkAsync failed to find certificates');
return null;
}); });
} }
// Certificates // Certificates

8
package-lock.json generated
View File

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

View File

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