v2.4.3: security notices separate from community notices
This commit is contained in:
parent
540ac6c310
commit
781a735146
|
@ -162,7 +162,8 @@ var greenlock = require('greenlock').create({
|
||||||
|
|
||||||
, email: 'user@example.com' // IMPORTANT: Change email and domains
|
, email: 'user@example.com' // IMPORTANT: Change email and domains
|
||||||
, agreeTos: true // Accept Let's Encrypt v2 Agreement
|
, agreeTos: true // Accept Let's Encrypt v2 Agreement
|
||||||
, communityMember: true // Optionally get important greenlock updates (security, api changes, etc)
|
, communityMember: true // Get (rare) non-mandatory updates about cool greenlock-related stuff (default false)
|
||||||
|
, securityUpdates: true // Important and mandatory notices related to security or breaking API changes (default true)
|
||||||
|
|
||||||
, approveDomains: approveDomains
|
, approveDomains: approveDomains
|
||||||
});
|
});
|
||||||
|
@ -530,6 +531,8 @@ See https://git.coolaj86.com/coolaj86/le-challenge-fs.js
|
||||||
|
|
||||||
Change History
|
Change History
|
||||||
==============
|
==============
|
||||||
|
* v2.4
|
||||||
|
* v2.4.3 - add security updates (default true) independent of community updates (default false)
|
||||||
* v2.2 - Let's Encrypt v2 Support
|
* v2.2 - Let's Encrypt v2 Support
|
||||||
* v2.2.11 - documentation updates
|
* v2.2.11 - documentation updates
|
||||||
* v2.2.10 - don't let SNICallback swallow approveDomains errors 6286883fc2a6ebfff711a540a2e4d92f3ac2907c
|
* v2.2.10 - don't let SNICallback swallow approveDomains errors 6286883fc2a6ebfff711a540a2e4d92f3ac2907c
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function addCommunityMember(pkg, email, domains) {
|
function addCommunityMember(pkg, action, email, domains, communityMember) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
var https = require('https');
|
var https = require('https');
|
||||||
var req = https.request({
|
var req = https.request({
|
||||||
|
@ -15,15 +15,29 @@ function addCommunityMember(pkg, email, domains) {
|
||||||
if (err) { return; }
|
if (err) { return; }
|
||||||
resp.on('data', function () {});
|
resp.on('data', function () {});
|
||||||
});
|
});
|
||||||
req.write(JSON.stringify({
|
var data = {
|
||||||
address: email
|
address: email
|
||||||
, comment: (pkg || 'community') + ' member w/ ' + (domains||[]).map(function (d) {
|
// greenlock-security is transactional and security only
|
||||||
|
, list: communityMember ? (pkg + '@ppl.family') : 'greenlock-security@ppl.family'
|
||||||
|
, action: action // reg | renew
|
||||||
|
, package: pkg
|
||||||
|
// hashed for privacy, but so we can still get some telemetry and inform users
|
||||||
|
// if abnormal things are happening (like several registrations for the same domain each day)
|
||||||
|
, domain: (domains||[]).map(function (d) {
|
||||||
return require('crypto').createHash('sha1').update(d).digest('base64')
|
return require('crypto').createHash('sha1').update(d).digest('base64')
|
||||||
.replace(/\//g, '_').replace(/\+/g, '-').replace(/=/g, '');
|
.replace(/\//g, '_').replace(/\+/g, '-').replace(/=/g, '');
|
||||||
}).join(',')
|
}).join(',')
|
||||||
}));
|
};
|
||||||
|
console.log(JSON.stringify(data, 2, null));
|
||||||
|
req.write(JSON.stringify(data, 2, null));
|
||||||
req.end();
|
req.end();
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.add = addCommunityMember;
|
module.exports.add = addCommunityMember;
|
||||||
|
|
||||||
|
if (require.main === module) {
|
||||||
|
//addCommunityMember('greenlock-express.js', 'reg', 'coolaj86+test42@gmail.com', ['coolaj86.com'], true);
|
||||||
|
//addCommunityMember('greenlock.js', 'reg', 'coolaj86+test37@gmail.com', ['oneal.im'], false);
|
||||||
|
//addCommunityMember('greenlock.js', 'reg', 'coolaj86+test11@gmail.com', ['ppl.family'], true);
|
||||||
|
}
|
||||||
|
|
10
lib/core.js
10
lib/core.js
|
@ -407,9 +407,10 @@ module.exports.create = function (gl) {
|
||||||
return core.certificates.checkAsync(args).then(function (certs) {
|
return core.certificates.checkAsync(args).then(function (certs) {
|
||||||
if (!certs) {
|
if (!certs) {
|
||||||
// There is no cert available
|
// There is no cert available
|
||||||
if (args.communityMember && !args._communityMemberAdded) {
|
if (false !== args.securityUpdates && !args._communityMemberAdded) {
|
||||||
try {
|
try {
|
||||||
require('./community').add(args._communityPackage + ' reg', args.email, args.domains);
|
// We will notify all greenlock users of mandatory and security updates
|
||||||
|
require('./community').add(args._communityPackage, 'reg', args.email, args.domains, args.communityMember);
|
||||||
} catch(e) { /* ignore */ }
|
} catch(e) { /* ignore */ }
|
||||||
args._communityMemberAdded = true;
|
args._communityMemberAdded = true;
|
||||||
}
|
}
|
||||||
|
@ -418,9 +419,10 @@ 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 (args.communityMember && !args._communityMemberAdded) {
|
if (false !== args.securityUpdates && !args._communityMemberAdded) {
|
||||||
try {
|
try {
|
||||||
require('./community').add(args._communityPackage + ' renew', args.email, args.domains);
|
// We will notify all greenlock users of mandatory and security updates
|
||||||
|
require('./community').add(args._communityPackage, 'renew', args.email, args.domains, args.communityMember);
|
||||||
} catch(e) { /* ignore */ }
|
} catch(e) { /* ignore */ }
|
||||||
args._communityMemberAdded = true;
|
args._communityMemberAdded = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "greenlock",
|
"name": "greenlock",
|
||||||
"version": "2.4.2",
|
"version": "2.4.3",
|
||||||
"description": "Let's Encrypt for node.js on npm",
|
"description": "Let's Encrypt for node.js on npm",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
Loading…
Reference in New Issue