|
|
@ -12,13 +12,25 @@ module.exports.wrap = function(greenlock, gconf) { |
|
|
|
var myFind = gconf.find; |
|
|
|
delete gconf.find; |
|
|
|
|
|
|
|
var mega = mergeManager(gconf); |
|
|
|
var mega = mergeManager(greenlock, gconf); |
|
|
|
|
|
|
|
greenlock.manager = {}; |
|
|
|
greenlock.sites = {}; |
|
|
|
//greenlock.accounts = {};
|
|
|
|
//greenlock.certs = {};
|
|
|
|
|
|
|
|
greenlock.manager._modulename = gconf.manager.module; |
|
|
|
if ('/' === String(gconf.manager.module)[0]) { |
|
|
|
greenlock.manager._modulename = require('path').relative( |
|
|
|
gconf.packageRoot, |
|
|
|
greenlock.manager._modulename |
|
|
|
); |
|
|
|
if ('.' !== String(greenlock.manager._modulename)[0]) { |
|
|
|
greenlock.manager._modulename = |
|
|
|
'./' + greenlock.manager._modulename; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var allowed = [ |
|
|
|
'accountKeyType', //: ["P-256", "RSA-2048"],
|
|
|
|
'serverKeyType', //: ["RSA-2048", "P-256"],
|
|
|
@ -409,6 +421,7 @@ function loadManager(gconf) { |
|
|
|
); |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
try { |
|
|
|
// wrap this to be safe for @greenlock/manager
|
|
|
|
m = require(gconf.manager.module).create(gconf.manager); |
|
|
@ -431,7 +444,7 @@ function loadManager(gconf) { |
|
|
|
return m; |
|
|
|
} |
|
|
|
|
|
|
|
function mergeManager(gconf) { |
|
|
|
function mergeManager(greenlock, gconf) { |
|
|
|
var mng; |
|
|
|
function m() { |
|
|
|
if (mng) { |
|
|
@ -554,6 +567,21 @@ function mergeManager(gconf) { |
|
|
|
mega.get = m().get; |
|
|
|
} |
|
|
|
|
|
|
|
if (!mega.find) { |
|
|
|
mega._nofind = false; |
|
|
|
mega.find = async function(opts) { |
|
|
|
if (!mega._nofind) { |
|
|
|
console.warn( |
|
|
|
'Warning: manager `' + |
|
|
|
greenlock.manager._modulename + |
|
|
|
'` does not implement `find({})`\n' |
|
|
|
); |
|
|
|
mega._nofind = true; |
|
|
|
} |
|
|
|
return []; |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
if (!mega.get) { |
|
|
|
mega.get = function(opts) { |
|
|
|
var servername = opts.servername; |
|
|
|