Sorry if I've missed this, but just can't find it in the doco.
I have GL working just fine issuing certs. Works great - thx! :)
But... would like to implement this in a configurable server where domain names can be added or removed. For this need to find a list of configured domains (subjects) and for those that have been removed from the server configuration by the user need to also remove from GL handling.
Looking in greenlock-manager-fs (which appears to be the default) there is a find function but this mysteriously disappears and is not available by referencing the object returned from create.
Example code:
constglOpts={packageRoot:__dirname,configDir:settings.dir,maintainerEmail:settings.email,cluster:false,packageAgent:pkg.name+'/'+pkg.version,notify:(ev,params)=>{// snip
}};if(settings.staging){glOpts.staging=true;}constgl=require('greenlock').create(glOpts);// Add sites.
for(constdomainofsettings.domains){gl.add({subject:domain,altnames:[domain]});}constdomains=awaitgl.find();// Also tried: const domains = await gl.manager.find();
// At this point I would expect domains to hold list sites to process but
// the above fails as somehow the find function does not exist :(
Sorry if I've missed this, but just can't find it in the doco.
I have GL working just fine issuing certs. Works great - thx! :)
But... would like to implement this in a configurable server where domain names can be added or removed. For this need to `find` a list of configured domains (subjects) and for those that have been removed from the server configuration by the user need to also remove from GL handling.
Looking in `greenlock-manager-fs` (which appears to be the default) there is a `find` function but this mysteriously disappears and is not available by referencing the object returned from `create`.
Example code:
```JS
const glOpts = {
packageRoot: __dirname,
configDir: settings.dir,
maintainerEmail: settings.email,
cluster: false,
packageAgent: pkg.name + '/' + pkg.version,
notify: (ev, params) => {
// snip
}
};
if (settings.staging) {
glOpts.staging = true;
}
const gl = require('greenlock').create(glOpts);
// Add sites.
for (const domain of settings.domains) {
gl.add({ subject: domain, altnames: [domain] });
}
const domains = await gl.find();
// Also tried: const domains = await gl.manager.find();
// At this point I would expect domains to hold list sites to process but
// the above fails as somehow the find function does not exist :(
```
Sorry if I've missed this, but just can't find it in the doco.
I have GL working just fine issuing certs. Works great - thx! :)
But... would like to implement this in a configurable server where domain names can be added or removed. For this need to
find
a list of configured domains (subjects) and for those that have been removed from the server configuration by the user need to also remove from GL handling.Looking in
greenlock-manager-fs
(which appears to be the default) there is afind
function but this mysteriously disappears and is not available by referencing the object returned fromcreate
.Example code: