Compare commits
10 Commits
59f896ac62
...
5171a7d1e0
Author | SHA1 | Date |
---|---|---|
AJ ONeal | 5171a7d1e0 | |
AJ ONeal | 66f2574dbc | |
AJ ONeal | 21a937c491 | |
AJ ONeal | bfe68c04c7 | |
AJ ONeal | d1187b77de | |
AJ ONeal | 03f6b2dff1 | |
AJ ONeal | 5061b7391d | |
AJ ONeal | e2cca83a8c | |
AJ ONeal | 2e02eba962 | |
AJ ONeal | eb6819c7be |
25
README.md
25
README.md
|
@ -1,17 +1,16 @@
|
||||||
greenlock (node-letsencrypt)
|
| Sponsored by [ppl](https://ppl.family)
|
||||||
=========
|
|
||||||
|
|
||||||
Now supports **Let's Encrypt v2**!!
|
|
||||||
|
|
||||||
| [acme-v2.js](https://git.coolaj86.com/coolaj86/acme-v2.js)
|
| [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-cli](https://git.coolaj86.com/coolaj86/greenlock-cli.js)
|
||||||
| [greenlock-express](https://git.coolaj86.com/coolaj86/greenlock-express.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-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
|
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`
|
For `bash`, `fish`, `zsh`, `cmd.exe`, `PowerShell`
|
||||||
see [**greenlock-cli** (previously letsencrypt-cli)](https://git.coolaj86.com/coolaj86/greenlock-cli.js).
|
see [**greenlock-cli** (previously letsencrypt-cli)](https://git.coolaj86.com/coolaj86/greenlock-cli.js).
|
||||||
|
|
||||||
|
### Now supports **Let's Encrypt v2**!!
|
||||||
|
|
||||||
Install
|
Install
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
@ -281,7 +282,11 @@ See https://git.coolaj86.com/coolaj86/le-challenge-fs.js
|
||||||
|
|
||||||
Change History
|
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.17 - Nov 5th 2017 migrate back to personal repo
|
||||||
* v2.1.9 - Jan 18th 2017 renamed to greenlock
|
* v2.1.9 - Jan 18th 2017 renamed to greenlock
|
||||||
* v2.0.2 - Aug 9th 2016 update readme
|
* v2.0.2 - Aug 9th 2016 update readme
|
||||||
|
|
2
index.js
2
index.js
|
@ -103,6 +103,7 @@ LE.create = function (le) {
|
||||||
le.rsaKeySize = le.rsaKeySize || LE.rsaKeySize;
|
le.rsaKeySize = le.rsaKeySize || LE.rsaKeySize;
|
||||||
le.challengeType = le.challengeType || LE.challengeType;
|
le.challengeType = le.challengeType || LE.challengeType;
|
||||||
le._ipc = ipc;
|
le._ipc = ipc;
|
||||||
|
le._communityPackage = le._communityPackage || 'greenlock';
|
||||||
le.agreeToTerms = le.agreeToTerms || function (args, agreeCb) {
|
le.agreeToTerms = le.agreeToTerms || function (args, agreeCb) {
|
||||||
agreeCb(new Error("'agreeToTerms' was not supplied to LE and 'agreeTos' was not supplied to LE.register"));
|
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.domains = le.approvedDomains.slice(0);
|
||||||
lexOpts.email = le.email;
|
lexOpts.email = le.email;
|
||||||
lexOpts.agreeTos = le.agreeTos;
|
lexOpts.agreeTos = le.agreeTos;
|
||||||
|
lexOpts.communityMember = lexOpts.communityMember;
|
||||||
return cb(null, { options: lexOpts, certs: certs });
|
return cb(null, { options: lexOpts, certs: certs });
|
||||||
}
|
}
|
||||||
log(le.debug, 'unapproved domain', lexOpts.domains, le.approvedDomains);
|
log(le.debug, 'unapproved domain', lexOpts.domains, le.approvedDomains);
|
||||||
|
|
|
@ -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;
|
|
@ -384,6 +384,15 @@ module.exports.create = function (le) {
|
||||||
var copy = utils.merge(args, le);
|
var copy = utils.merge(args, le);
|
||||||
args = utils.tplCopy(copy);
|
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) {
|
return core.certificates.checkAsync(args).then(function (certs) {
|
||||||
if (!certs) {
|
if (!certs) {
|
||||||
// There is no cert available
|
// There is no cert available
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var homeRe = new RegExp("^~(\\/|\\\\|\\" + path.sep + ")");
|
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 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) {
|
module.exports.attachCertInfo = function (results) {
|
||||||
// XXX Note: Parsing the certificate info comes at a great cost (~500kb)
|
// XXX Note: Parsing the certificate info comes at a great cost (~500kb)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "greenlock",
|
"name": "greenlock",
|
||||||
"version": "2.2.4",
|
"version": "2.2.7",
|
||||||
"description": "Let's Encrypt for node.js on npm",
|
"description": "Let's Encrypt for node.js on npm",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -54,11 +54,12 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"request": "^2.75.0"
|
"request": "^2.75.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {},
|
"optionalDependencies": {
|
||||||
|
"bluebird": "^3.5.1"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acme-v2": "^1.0.2",
|
"acme-v2": "^1.0.2",
|
||||||
"asn1js": "^1.2.12",
|
"asn1js": "^1.2.12",
|
||||||
"bluebird": "^3.0.6",
|
|
||||||
"certpem": "^1.0.0",
|
"certpem": "^1.0.0",
|
||||||
"homedir": "^0.6.0",
|
"homedir": "^0.6.0",
|
||||||
"le-acme-core": "^2.1.2",
|
"le-acme-core": "^2.1.2",
|
||||||
|
|
Loading…
Reference in New Issue