Compare commits

..

No commits in common. "07cd2ced9cc9ae264c6f1ccb1580745c752c67ed" and "fb69d25250c09613c8697bedf116047ea1aa4b91" have entirely different histories.

3 changed files with 67 additions and 77 deletions

View File

@ -2,6 +2,7 @@
function addCommunityMember(opts) { function addCommunityMember(opts) {
// { name, version, email, domains, action, communityMember, telemetry } // { name, version, email, domains, action, communityMember, telemetry }
setTimeout(function () {
var https = require('https'); var https = require('https');
var req = https.request({ var req = https.request({
hostname: 'api.ppl.family' hostname: 'api.ppl.family'
@ -15,9 +16,6 @@ function addCommunityMember(opts) {
if (err) { return; } if (err) { return; }
resp.on('data', function () {}); resp.on('data', function () {});
}); });
req.on('error', function(error) {
/* ignore */
});
var os = require('os'); var os = require('os');
var data = { var data = {
address: opts.email address: opts.email
@ -41,22 +39,10 @@ function addCommunityMember(opts) {
} }
req.write(JSON.stringify(data, 2, null)); req.write(JSON.stringify(data, 2, null));
req.end(); req.end();
}, 50);
} }
function delay(ms) { module.exports.add = addCommunityMember;
return new Promise(function (resolve) {
return setTimeout(resolve, ms);
});
}
module.exports.add = function (opts) {
return delay(50).then(() => {
return addCommunityMember(opts);
})
.catch(function (ex) {
/* ignore */
})
}
if (require.main === module) { if (require.main === module) {
//addCommunityMember('greenlock-express.js', 'reg', 'coolaj86+test42@gmail.com', ['coolaj86.com'], true); //addCommunityMember('greenlock-express.js', 'reg', 'coolaj86+test42@gmail.com', ['coolaj86.com'], true);

View File

@ -558,6 +558,7 @@ module.exports.create = function (gl) {
if (!certs || !utils.certHasDomain(certs, args.domain)) { if (!certs || !utils.certHasDomain(certs, args.domain)) {
// There is no cert available // There is no cert available
if (false !== args.securityUpdates && !args._communityMemberAdded) { if (false !== args.securityUpdates && !args._communityMemberAdded) {
try {
// We will notify all greenlock users of mandatory and security updates // We will notify all greenlock users of mandatory and security updates
// We'll keep track of versions and os so we can make sure things work well // We'll keep track of versions and os so we can make sure things work well
// { name, version, email, domains, action, communityMember, telemetry } // { name, version, email, domains, action, communityMember, telemetry }
@ -570,6 +571,7 @@ module.exports.create = function (gl) {
, communityMember: args.communityMember , communityMember: args.communityMember
, telemetry: args.telemetry , telemetry: args.telemetry
}); });
} catch(e) { /* ignore */ }
args._communityMemberAdded = true; args._communityMemberAdded = true;
} }
return core.certificates.registerAsync(args); return core.certificates.registerAsync(args);
@ -578,6 +580,7 @@ module.exports.create = function (gl) {
if (core.certificates._isRenewable(args, certs)) { if (core.certificates._isRenewable(args, certs)) {
// it's time to renew the available cert // it's time to renew the available cert
if (false !== args.securityUpdates && !args._communityMemberAdded) { if (false !== args.securityUpdates && !args._communityMemberAdded) {
try {
// We will notify all greenlock users of mandatory and security updates // We will notify all greenlock users of mandatory and security updates
// We'll keep track of versions and os so we can make sure things work well // We'll keep track of versions and os so we can make sure things work well
// { name, version, email, domains, action, communityMember, telemetry } // { name, version, email, domains, action, communityMember, telemetry }
@ -590,6 +593,7 @@ module.exports.create = function (gl) {
, communityMember: args.communityMember , communityMember: args.communityMember
, telemetry: args.telemetry , telemetry: args.telemetry
}); });
} catch(e) { /* ignore */ }
args._communityMemberAdded = true; args._communityMemberAdded = true;
} }
certs.renewing = core.certificates.renewAsync(args, certs); certs.renewing = core.certificates.renewAsync(args, certs);

View File

@ -1,6 +1,6 @@
{ {
"name": "greenlock", "name": "greenlock",
"version": "2.8.2", "version": "2.8.1",
"description": "Greenlock is Let's Encrypt (ACME) client for node.js", "description": "Greenlock is Let's Encrypt (ACME) client for node.js",
"homepage": "https://greenlock.domains/", "homepage": "https://greenlock.domains/",
"main": "index.js", "main": "index.js",