v3.0.11: reduce scope of manager.find()
This commit is contained in:
parent
98e8eaf3f0
commit
59a04a1586
23
greenlock.js
23
greenlock.js
|
@ -230,7 +230,7 @@ G.create = function(gconf) {
|
||||||
|
|
||||||
greenlock._single = function(args) {
|
greenlock._single = function(args) {
|
||||||
if ('string' !== typeof args.servername) {
|
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
|
// www.example.com => *.example.com
|
||||||
args.wildname =
|
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) {
|
greenlock._config = function(args) {
|
||||||
return greenlock
|
return greenlock
|
||||||
._single(args)
|
._single(args)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
return greenlock.manager.find(args);
|
return greenlock._find(args);
|
||||||
})
|
})
|
||||||
.then(function(sites) {
|
.then(function(sites) {
|
||||||
if (!sites || !sites.length) {
|
if (!sites || !sites.length) {
|
||||||
|
@ -351,7 +368,7 @@ G.create = function(gconf) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//console.log('greenlock._renew find', args);
|
//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
|
// Note: the manager must guaranteed that these are mutable copies
|
||||||
//console.log('greenlock._renew found', sites);
|
//console.log('greenlock._renew found', sites);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@root/greenlock",
|
"name": "@root/greenlock",
|
||||||
"version": "3.0.10",
|
"version": "3.0.11",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -90,9 +90,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"greenlock-manager-fs": {
|
"greenlock-manager-fs": {
|
||||||
"version": "0.6.5",
|
"version": "0.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/greenlock-manager-fs/-/greenlock-manager-fs-0.6.5.tgz",
|
"resolved": "https://registry.npmjs.org/greenlock-manager-fs/-/greenlock-manager-fs-0.7.0.tgz",
|
||||||
"integrity": "sha512-Y/896/4nGM2ockujdzfT+ChLsuTkRp/WkWt/WqdeUxBrgp1qvDha6UUCH3v7nt9U+nqIbk+wz7sFhHPcqR1cDA==",
|
"integrity": "sha512-cWmrfdSbT0ettDZzl6SXhZ47gVLj7saM/tdEP6sEfnsocJ3mRFRP3QUrJYyLVdCOCuVH6cclOKLembIrZjwDrQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@root/mkdirp": "^1.0.0",
|
"@root/mkdirp": "^1.0.0",
|
||||||
"safe-replace": "^1.1.0"
|
"safe-replace": "^1.1.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@root/greenlock",
|
"name": "@root/greenlock",
|
||||||
"version": "3.0.10",
|
"version": "3.0.11",
|
||||||
"description": "The easiest Let's Encrypt client for Node.js and Browsers",
|
"description": "The easiest Let's Encrypt client for Node.js and Browsers",
|
||||||
"homepage": "https://rootprojects.org/greenlock/",
|
"homepage": "https://rootprojects.org/greenlock/",
|
||||||
"main": "greenlock.js",
|
"main": "greenlock.js",
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
"@root/request": "^1.3.10",
|
"@root/request": "^1.3.10",
|
||||||
"acme-http-01-standalone": "^3.0.5",
|
"acme-http-01-standalone": "^3.0.5",
|
||||||
"cert-info": "^1.5.1",
|
"cert-info": "^1.5.1",
|
||||||
"greenlock-manager-fs": "^0.6.5",
|
"greenlock-manager-fs": "^0.7.0",
|
||||||
"greenlock-store-fs": "^3.2.0",
|
"greenlock-store-fs": "^3.2.0",
|
||||||
"safe-replace": "^1.1.0"
|
"safe-replace": "^1.1.0"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue