update community member option

This commit is contained in:
AJ ONeal 2018-05-10 02:31:24 -06:00
parent 5171a7d1e0
commit 8fb396cfe9
2 changed files with 13 additions and 10 deletions

View File

@ -103,7 +103,7 @@ LE.create = function (le) {
le.rsaKeySize = le.rsaKeySize || LE.rsaKeySize;
le.challengeType = le.challengeType || LE.challengeType;
le._ipc = ipc;
le._communityPackage = le._communityPackage || 'greenlock';
le._communityPackage = le._communityPackage || 'greenlock.js';
le.agreeToTerms = le.agreeToTerms || function (args, agreeCb) {
agreeCb(new Error("'agreeToTerms' was not supplied to LE and 'agreeTos' was not supplied to LE.register"));
};

View File

@ -384,23 +384,26 @@ module.exports.create = function (le) {
var copy = utils.merge(args, le);
args = utils.tplCopy(copy);
if (args.communityMember && !args._communityMemberAdded) {
try {
require('./community').add(args._communityPackage, args.email, args.domains);
} catch(e) {
// ignore
}
args._communityMemberAdded = true;
}
return core.certificates.checkAsync(args).then(function (certs) {
if (!certs) {
// There is no cert available
if (args.communityMember && !args._communityMemberAdded) {
try {
require('./community').add(args._communityPackage + ' reg', args.email, args.domains);
} catch(e) { /* ignore */ }
args._communityMemberAdded = true;
}
return core.certificates.registerAsync(args);
}
if (core.certificates._isRenewable(args, certs)) {
// it's time to renew the available cert
if (args.communityMember && !args._communityMemberAdded) {
try {
require('./community').add(args._communityPackage + ' renew', args.email, args.domains);
} catch(e) { /* ignore */ }
args._communityMemberAdded = true;
}
certs.renewing = core.certificates.renewAsync(args, certs);
if (args.waitForRenewal) {
return certs.renewing;