v3.0.11: reduce scope of manager.find()

This commit is contained in:
AJ ONeal 2019-10-30 08:08:40 +00:00
parent 98e8eaf3f0
commit 59a04a1586
3 changed files with 26 additions and 9 deletions

View File

@ -230,7 +230,7 @@ G.create = function(gconf) {
greenlock._single = function(args) {
if ('string' !== typeof args.servername) {
return Promise.reject(new Error('no servername given'));
return Promise.reject(new Error('no `servername` given'));
}
// www.example.com => *.example.com
args.wildname =
@ -297,11 +297,28 @@ G.create = function(gconf) {
});
};
greenlock._find = function(args) {
var altnames = args.altnames || [];
// servername, wildname, and altnames are all the same
['wildname', 'servername'].forEach(function(k) {
var altname = args[k];
if (altname && !altnames.includes(altname)) {
altnames.push(altname);
}
});
if (altnames.length) {
args.altnames = altnames;
}
return greenlock.manager.find(args);
};
greenlock._config = function(args) {
return greenlock
._single(args)
.then(function() {
return greenlock.manager.find(args);
return greenlock._find(args);
})
.then(function(sites) {
if (!sites || !sites.length) {
@ -351,7 +368,7 @@ G.create = function(gconf) {
}
//console.log('greenlock._renew find', args);
return greenlock.manager.find(args).then(function(sites) {
return greenlock._find(args).then(function(sites) {
// Note: the manager must guaranteed that these are mutable copies
//console.log('greenlock._renew found', sites);

8
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@root/greenlock",
"version": "3.0.10",
"version": "3.0.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -90,9 +90,9 @@
"dev": true
},
"greenlock-manager-fs": {
"version": "0.6.5",
"resolved": "https://registry.npmjs.org/greenlock-manager-fs/-/greenlock-manager-fs-0.6.5.tgz",
"integrity": "sha512-Y/896/4nGM2ockujdzfT+ChLsuTkRp/WkWt/WqdeUxBrgp1qvDha6UUCH3v7nt9U+nqIbk+wz7sFhHPcqR1cDA==",
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/greenlock-manager-fs/-/greenlock-manager-fs-0.7.0.tgz",
"integrity": "sha512-cWmrfdSbT0ettDZzl6SXhZ47gVLj7saM/tdEP6sEfnsocJ3mRFRP3QUrJYyLVdCOCuVH6cclOKLembIrZjwDrQ==",
"requires": {
"@root/mkdirp": "^1.0.0",
"safe-replace": "^1.1.0"

View File

@ -1,6 +1,6 @@
{
"name": "@root/greenlock",
"version": "3.0.10",
"version": "3.0.11",
"description": "The easiest Let's Encrypt client for Node.js and Browsers",
"homepage": "https://rootprojects.org/greenlock/",
"main": "greenlock.js",
@ -42,7 +42,7 @@
"@root/request": "^1.3.10",
"acme-http-01-standalone": "^3.0.5",
"cert-info": "^1.5.1",
"greenlock-manager-fs": "^0.6.5",
"greenlock-manager-fs": "^0.7.0",
"greenlock-store-fs": "^3.2.0",
"safe-replace": "^1.1.0"
},