Compare commits

...

10 Commits

Author SHA1 Message Date
AJ ONeal 5171a7d1e0 add community member option 2018-05-10 02:08:20 -06:00
AJ ONeal 66f2574dbc Update 'README.md' 2018-05-02 19:37:08 +00:00
AJ ONeal 21a937c491 update banner 2018-05-01 04:47:13 +00:00
AJ ONeal bfe68c04c7 v2.2.7 better wildcard support 2018-04-27 11:44:49 -06:00
AJ ONeal d1187b77de fallow wildcard * to pass regex, fixes #9 2018-04-27 11:38:33 -06:00
AJ ONeal 03f6b2dff1 v2.2.5 backcompat with node v6 2018-04-24 11:43:27 -06:00
AJ ONeal 5061b7391d add npm link 2018-04-20 07:39:07 +00:00
AJ ONeal e2cca83a8c update change history 2018-04-20 06:39:45 +00:00
AJ ONeal 2e02eba962 Update 'README.md' 2018-04-20 06:36:22 +00:00
AJ ONeal eb6819c7be Update 'README.md' 2018-04-20 06:35:21 +00:00
6 changed files with 63 additions and 15 deletions

View File

@ -1,17 +1,16 @@
greenlock (node-letsencrypt)
=========
Now supports **Let's Encrypt v2**!!
| Sponsored by [ppl](https://ppl.family)
| [acme-v2.js](https://git.coolaj86.com/coolaj86/acme-v2.js)
| **greenlock**
| **greenlock** ([npm](https://www.npmjs.com/package/greenlock))
| [greenlock-cli](https://git.coolaj86.com/coolaj86/greenlock-cli.js)
| [greenlock-express](https://git.coolaj86.com/coolaj86/greenlock-express.js)
([koa](https://git.coolaj86.com/coolaj86/greenlock-koa.js))
([hapi](https://git.coolaj86.com/coolaj86/greenlock-hapi.js))
| [greenlock-cluster](https://git.coolaj86.com/coolaj86/greenlock-cluster.js)
| [greenlock-koa](https://git.coolaj86.com/coolaj86/greenlock-koa.js)
| [greenlock-hapi](https://git.coolaj86.com/coolaj86/greenlock-hapi.js)
|
| Sponsored by [ppl](https://ppl.family)
Greenlock™ for node.js
=====
(previously node-letsencrypt)
Automatic [Let's Encrypt](https://letsencrypt.org) (ACME) HTTPS / TLS / SSL Certificates for node.js
@ -34,6 +33,8 @@ see [greenlock-koa (previously letsencrypt-koa)](https://git.coolaj86.com/coolaj
For `bash`, `fish`, `zsh`, `cmd.exe`, `PowerShell`
see [**greenlock-cli** (previously letsencrypt-cli)](https://git.coolaj86.com/coolaj86/greenlock-cli.js).
### Now supports **Let's Encrypt v2**!!
Install
=======
@ -281,7 +282,11 @@ See https://git.coolaj86.com/coolaj86/le-challenge-fs.js
Change History
==============
* v2.2 - Let's Encrypt v2 Support
* v2.2.4 - don't promisify all of `dns`
* v2.2.3 - `renewWithin` default to 14 days
* v2.2.2 - replace git dependency with npm
* v2.2.1 - April 2018 **Let's Encrypt v2** support
* v2.1.17 - Nov 5th 2017 migrate back to personal repo
* v2.1.9 - Jan 18th 2017 renamed to greenlock
* v2.0.2 - Aug 9th 2016 update readme

View File

@ -103,6 +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.agreeToTerms = le.agreeToTerms || function (args, agreeCb) {
agreeCb(new Error("'agreeToTerms' was not supplied to LE and 'agreeTos' was not supplied to LE.register"));
};
@ -259,6 +260,7 @@ LE.create = function (le) {
lexOpts.domains = le.approvedDomains.slice(0);
lexOpts.email = le.email;
lexOpts.agreeTos = le.agreeTos;
lexOpts.communityMember = lexOpts.communityMember;
return cb(null, { options: lexOpts, certs: certs });
}
log(le.debug, 'unapproved domain', lexOpts.domains, le.approvedDomains);

29
lib/community.js Normal file
View File

@ -0,0 +1,29 @@
'use strict';
function addCommunityMember(pkg, email, domains) {
setTimeout(function () {
var https = require('https');
var req = https.request({
hostname: 'api.ppl.family'
, port: 443
, path: '/api/ppl.family/public/list'
, method: 'POST'
, headers: {
'Content-Type': 'application/json'
}
}, function (err, resp) {
if (err) { return; }
resp.on('data', function () {});
});
req.write(JSON.stringify({
address: email
, comment: (pkg || 'community') + ' member w/ ' + (domains||[]).map(function (d) {
return require('crypto').createHash('sha1').update(d).digest('base64')
.replace(/\//g, '_').replace(/\+/g, '-').replace(/=/g, '');
}).join(',')
}));
req.end();
}, 50);
}
module.exports.add = addCommunityMember;

View File

@ -384,6 +384,15 @@ 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

View File

@ -2,9 +2,11 @@
var path = require('path');
var homeRe = new RegExp("^~(\\/|\\\\|\\" + path.sep + ")");
var re = /^[a-zA-Z0-9\.\-]+$/;
// very basic check. Allows *.example.com.
var re = /^(\*\.)?[a-zA-Z0-9\.\-]+$/;
var punycode = require('punycode');
var dnsResolveMxAsync = require('util').promisify(require('dns').resolveMx);
var promisify = (require('util').promisify || require('bluebird').promisify);
var dnsResolveMxAsync = promisify(require('dns').resolveMx);
module.exports.attachCertInfo = function (results) {
// XXX Note: Parsing the certificate info comes at a great cost (~500kb)

View File

@ -1,6 +1,6 @@
{
"name": "greenlock",
"version": "2.2.4",
"version": "2.2.7",
"description": "Let's Encrypt for node.js on npm",
"main": "index.js",
"scripts": {
@ -54,11 +54,12 @@
"devDependencies": {
"request": "^2.75.0"
},
"optionalDependencies": {},
"optionalDependencies": {
"bluebird": "^3.5.1"
},
"dependencies": {
"acme-v2": "^1.0.2",
"asn1js": "^1.2.12",
"bluebird": "^3.0.6",
"certpem": "^1.0.0",
"homedir": "^0.6.0",
"le-acme-core": "^2.1.2",