|
|
@ -352,17 +352,8 @@ module.exports.create = function (gl) { |
|
|
|
// or we're forcing a refresh via 'dupliate: true'
|
|
|
|
log(args.debug, "Renewing!"); |
|
|
|
|
|
|
|
// TODO fetch email address / accountId (accountBydomain) if not present
|
|
|
|
// store.config.getAsync(args.domains).then(function (config) { /*...*/ });
|
|
|
|
if (!args.domains || (args.domains.length || 0) <= 2) { |
|
|
|
// this is a renewal, therefore we should renewal ALL of the domains
|
|
|
|
// associated with this certificate, unless args.domains is a list larger
|
|
|
|
// than example.com,www.example.com
|
|
|
|
// TODO check www. prefix
|
|
|
|
args.domains = certs.altnames; |
|
|
|
if (Array.isArray(certs.domains) && certs.domains.length) { |
|
|
|
args.domains = certs.domains; |
|
|
|
} |
|
|
|
if (!args.domains || !args.domains.length) { |
|
|
|
args.domains = args.servernames || [certs.subject].concat(certs.altnames); |
|
|
|
} |
|
|
|
|
|
|
|
return core.certificates.registerAsync(args); |
|
|
@ -410,7 +401,17 @@ module.exports.create = function (gl) { |
|
|
|
if (false !== args.securityUpdates && !args._communityMemberAdded) { |
|
|
|
try { |
|
|
|
// We will notify all greenlock users of mandatory and security updates
|
|
|
|
require('./community').add(args._communityPackage, 'reg', args.email, args.domains, args.communityMember); |
|
|
|
// We'll keep track of versions and os so we can make sure things work well
|
|
|
|
// { name, version, email, domains, action, communityMember, telemetry }
|
|
|
|
require('./community').add({ |
|
|
|
name: args._communityPackage |
|
|
|
, version: args._communityPackageVersion |
|
|
|
, email: args.email |
|
|
|
, domains: args.domains || args.servernames |
|
|
|
, action: 'reg' |
|
|
|
, communityMember: args.communityMember |
|
|
|
, telemetry: args.telemetry |
|
|
|
}); |
|
|
|
} catch(e) { /* ignore */ } |
|
|
|
args._communityMemberAdded = true; |
|
|
|
} |
|
|
@ -422,7 +423,17 @@ module.exports.create = function (gl) { |
|
|
|
if (false !== args.securityUpdates && !args._communityMemberAdded) { |
|
|
|
try { |
|
|
|
// We will notify all greenlock users of mandatory and security updates
|
|
|
|
require('./community').add(args._communityPackage, 'renew', args.email, args.domains, args.communityMember); |
|
|
|
// We'll keep track of versions and os so we can make sure things work well
|
|
|
|
// { name, version, email, domains, action, communityMember, telemetry }
|
|
|
|
require('./community').add({ |
|
|
|
name: args._communityPackage |
|
|
|
, version: args._communityPackageVersion |
|
|
|
, email: args.email |
|
|
|
, domains: args.domains || args.servernames |
|
|
|
, action: 'renew' |
|
|
|
, communityMember: args.communityMember |
|
|
|
, telemetry: args.telemetry |
|
|
|
}); |
|
|
|
} catch(e) { /* ignore */ } |
|
|
|
args._communityMemberAdded = true; |
|
|
|
} |
|
|
|