update community member option
This commit is contained in:
parent
5171a7d1e0
commit
8fb396cfe9
2
index.js
2
index.js
|
@ -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"));
|
||||
};
|
||||
|
|
21
lib/core.js
21
lib/core.js
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue