From 3b27aa68064b48e793222de1470411fa61b5c8d3 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 10 May 2018 12:09:20 -0600 Subject: [PATCH 01/11] don't overwrite community package name --- lex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lex.js b/lex.js index c749dc3..18f1fda 100644 --- a/lex.js +++ b/lex.js @@ -3,7 +3,7 @@ // opts.approveDomains(options, certs, cb) module.exports.create = function (opts) { // accept all defaults for le.challenges, le.store, le.middleware - opts._communityPackage = 'greenlock-express.js'; + opts._communityPackage = opts._communityPackage || 'greenlock-express.js'; var le = require('greenlock').create(opts); opts.app = opts.app || function (req, res) { From 89e0ddaecf2ee89b2d9f19d7f2c9160389201bba Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 10 May 2018 12:09:43 -0600 Subject: [PATCH 02/11] Greenlock branding --- lex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lex.js b/lex.js index 18f1fda..c61bcf1 100644 --- a/lex.js +++ b/lex.js @@ -7,7 +7,7 @@ module.exports.create = function (opts) { var le = require('greenlock').create(opts); opts.app = opts.app || function (req, res) { - res.end("Hello, World!\nWith Love,\nLet's Encrypt Express"); + res.end("Hello, World!\nWith Love,\nGreenlock for Express.js"); }; opts.listen = function (plainPort, port) { From d9c6a77bfce3da8ef25bf32ca789c1200de9cd22 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 10 May 2018 12:51:00 -0600 Subject: [PATCH 03/11] bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5a0491b..51e84af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlock-express", - "version": "2.1.2", + "version": "2.1.3", "description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.", "main": "lex.js", "homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js", From 7f340412d7c207252d29004f5a6b2b7de934a36b Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 13:15:28 -0600 Subject: [PATCH 04/11] better error messages as per https://git.coolaj86.com/coolaj86/greenlock-express.js/issues/9#issuecomment-103 --- lex.js | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/lex.js b/lex.js index c61bcf1..751e2dc 100644 --- a/lex.js +++ b/lex.js @@ -24,6 +24,21 @@ module.exports.create = function (opts) { var ports = port; var servers = []; + function explainError(e) { + console.error('Error:' + e.message); + if ('EACCES' === e.errno) { + console.error("You don't have prmission to access '" + e.address + ":" + e.port + "'."); + console.error("You probably need to use \"sudo\" or \"sudo setcap 'cap_net_bind_service=+ep' $(which node)\""); + return; + } + if ('EADDRINUSE' === e.errno) { + console.error("'" + e.address + ":" + e.port + "' is already being used by some other program."); + console.error("You probably need to stop that program or restart your computer."); + return; + } + console.error(e.code + ": '" + e.address + ":" + e.port + "'"); + } + if (!plainPorts) { plainPorts = 80; } @@ -37,20 +52,30 @@ module.exports.create = function (opts) { } plainPorts.forEach(function (p) { - promises.push(new PromiseA(function (resolve, reject) { + if (!(parseInt(p, 10) >= 0)) { console.warn("'" + p + "' doesn't seem to be a valid port number for http"); } + promises.push(new PromiseA(function (resolve) { require('http').createServer(le.middleware(require('redirect-https')())).listen(p, function () { - console.log("Handling ACME challenges and redirecting to https on plain port " + p); + console.log("Success! Bound to port '" + p + "' to handle ACME challenges and redirect to https"); resolve(); - }).on('error', reject); + }).on('error', function (e) { + console.log("Did not successfully create http server and bind to port '" + p + "':"); + explainError(e); + process.exit(0); + }); })); }); ports.forEach(function (p) { - promises.push(new PromiseA(function (resolve, reject) { + if (!(parseInt(p, 10) >= 0)) { console.warn("'" + p + "' doesn't seem to be a valid port number for https"); } + promises.push(new PromiseA(function (resolve) { var server = require('https').createServer(le.httpsOptions, le.middleware(le.app)).listen(p, function () { - console.log("Handling ACME challenges and serving https " + p); + console.log("Success! Serving https on port '" + p + "'"); resolve(); - }).on('error', reject); + }).on('error', function (e) { + console.log("Did not successfully create https server and bind to port '" + p + "':"); + explainError(e); + process.exit(0); + }); servers.push(server); })); }); From 5eab460ec2ef380949e6c907fdf217944bc48ca8 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 13:17:40 -0600 Subject: [PATCH 05/11] v2.1.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 51e84af..5ea741b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "greenlock-express", - "version": "2.1.3", + "version": "2.1.4", "description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.", "main": "lex.js", "homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js", From 8cd7648df61620bfc91953b342e909d7d588367c Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 19:58:37 +0000 Subject: [PATCH 06/11] Cleanup plugins list --- README.md | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 06e03c6..a026f66 100644 --- a/README.md +++ b/README.md @@ -166,16 +166,43 @@ Plugins ===== **IMPORTANT**: Community plugins may or may not be maintained and working. Please try with the defaults before switching to community plugins. -| | challenge | store | -|:--------------:|:---------:|:-----:| -| Build Your Own | [le-challenge-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-manual.js.git) | [le-store-SPEC](https://git.coolaj86.com/coolaj86/le-store-SPEC.js.git) | -| Defaults (fs) | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | [le-store-certbot](https://git.coolaj86.com/coolaj86/le-store-certbot.js.git) | -| Full List | [Search le-store- on npm](https://www.npmjs.com/search?q=le-store-) | [Search le-challenge- on npm](https://www.npmjs.com/search?q=le-challenge-) | -| AWS Route 53 | [thadeetrompetter/le-challenge-route53](https://github.com/thadeetrompetter/le-challenge-route53) | - | -| AWS S3 | | [paco3346/le-store-awss3](https://github.com/paco3346/le-store-awss3) | -| AWS S3 | [llun/le-challenge-s3](https://github.com/llun/le-challenge-s3) | [llun/le-store-s3](https://github.com/llun/le-store-s3) | -| json | - | [paulgrove/le-store-simple-fs](https://github.com/paulgrove/le-store-simple-fs) -| Redis | - | [digitalbazaar/le-store-redis](https://github.com/digitalbazaar/le-store-redis) | +HTTP-01 Challenges +----------- + +| | Plugin | +|:--------------:|:---------:| +| Build Your Own | [le-challenge-http-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-manual.js.git) | [le-challenge-dns-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | +| Default (fs) | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | +| Full List | [Search le-challenge- on npm](https://www.npmjs.com/search?q=le-challenge-) | +| AWS S3 | [llun/le-challenge-s3](https://github.com/llun/le-challenge-s3) | +| Digital Ocean | [bmv437/le-challenge-digitalocean](https://www.npmjs.com/package/le-challenge-digitalocean) | + + +DNS-01 Challenges +----------- + +| | Plugin | +|:--------------:|:---------:| +| Build Your Own | [le-challenge-dns-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | +| Manual (cli) | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | +| Full List | [Search le-challenge- on npm](https://www.npmjs.com/search?q=le-challenge-) | +| AWS Route 53 | [thadeetrompetter/le-challenge-route53](https://github.com/thadeetrompetter/le-challenge-route53) | +| CloudFlare | [buschtoens/le-challenge-cloudflare](https://github.com/buschtoens/le-challenge-cloudflare) | +| CloudFlare | [llun/le-challenge-cloudflare](https://github.com/llun/le-challenge-cloudflare) | +| Digital Ocean | [bmv437/le-challenge-digitalocean](https://github.com/bmv437/le-challenge-digitalocean) | + +Account & Certificate Storage +----------- + +| | Plugin | +|:--------------:|:---------:| +| Build Your Own | [le-store-SPEC](https://git.coolaj86.com/coolaj86/le-store-SPEC.js.git) | +| Defaults (fs) | [le-store-certbot](https://git.coolaj86.com/coolaj86/le-store-certbot.js.git) | +| Full List | [Search le-store- on npm](https://www.npmjs.com/search?q=le-store-) | +| AWS S3 | [paco3346/le-store-awss3](https://github.com/paco3346/le-store-awss3) | +| AWS S3 | [llun/le-store-s3](https://github.com/llun/le-store-s3) | +| json (fs) | [paulgrove/le-store-simple-fs](https://github.com/paulgrove/le-store-simple-fs) +| Redis | [digitalbazaar/le-store-redis](https://github.com/digitalbazaar/le-store-redis) | Bugs: Please report bugs with the community plugins to the appropriate owner first, then here if you don't get a response. From 27085a7f645178276c93e1aad20667ae6fd1f2ba Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 20:03:02 +0000 Subject: [PATCH 07/11] Update plugins list again --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index a026f66..fb47b92 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,13 @@ Features - [x] Express.js - [x] [Koa](https://git.coolaj86.com/coolaj86/greenlock-koa.js) - [x] [hapi](https://git.coolaj86.com/coolaj86/greenlock-hapi.js) + - [x] Extensible Plugin Support + - [x] AWS (S3, Route53) + - [x] Azure + - [x] CloudFlare + - [x] Digital Ocean + - [x] etcd + - [x] Redis Install ======= @@ -190,6 +197,7 @@ DNS-01 Challenges | CloudFlare | [buschtoens/le-challenge-cloudflare](https://github.com/buschtoens/le-challenge-cloudflare) | | CloudFlare | [llun/le-challenge-cloudflare](https://github.com/llun/le-challenge-cloudflare) | | Digital Ocean | [bmv437/le-challenge-digitalocean](https://github.com/bmv437/le-challenge-digitalocean) | +| etcd | [ceecko/le-challenge-etcd](https://github.com/ceecko/le-challenge-etcd) | Account & Certificate Storage ----------- @@ -201,6 +209,7 @@ Account & Certificate Storage | Full List | [Search le-store- on npm](https://www.npmjs.com/search?q=le-store-) | | AWS S3 | [paco3346/le-store-awss3](https://github.com/paco3346/le-store-awss3) | | AWS S3 | [llun/le-store-s3](https://github.com/llun/le-store-s3) | +| Azure | [kolarcz/node-le-challenge-azure-storage](https://github.com/kolarcz/node-le-challenge-azure-storage) | | json (fs) | [paulgrove/le-store-simple-fs](https://github.com/paulgrove/le-store-simple-fs) | Redis | [digitalbazaar/le-store-redis](https://github.com/digitalbazaar/le-store-redis) | From 57806ef06f19fdbcdd75abcfacfde39890600e84 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 20:06:18 +0000 Subject: [PATCH 08/11] typo fix in plugins --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb47b92..c256812 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ HTTP-01 Challenges | | Plugin | |:--------------:|:---------:| | Build Your Own | [le-challenge-http-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-manual.js.git) | [le-challenge-dns-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | -| Default (fs) | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | +| **Default (fs)** | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | | Full List | [Search le-challenge- on npm](https://www.npmjs.com/search?q=le-challenge-) | | AWS S3 | [llun/le-challenge-s3](https://github.com/llun/le-challenge-s3) | | Digital Ocean | [bmv437/le-challenge-digitalocean](https://www.npmjs.com/package/le-challenge-digitalocean) | @@ -191,7 +191,7 @@ DNS-01 Challenges | | Plugin | |:--------------:|:---------:| | Build Your Own | [le-challenge-dns-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | -| Manual (cli) | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | +| **Manual (cli)** | [le-challenge-dns](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | | Full List | [Search le-challenge- on npm](https://www.npmjs.com/search?q=le-challenge-) | | AWS Route 53 | [thadeetrompetter/le-challenge-route53](https://github.com/thadeetrompetter/le-challenge-route53) | | CloudFlare | [buschtoens/le-challenge-cloudflare](https://github.com/buschtoens/le-challenge-cloudflare) | From 48d990a6e88bb2b683ddf18fa6ff2764e5b54ec4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 20:11:11 +0000 Subject: [PATCH 09/11] adjust plugins list --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c256812..ab49d6c 100644 --- a/README.md +++ b/README.md @@ -178,11 +178,11 @@ HTTP-01 Challenges | | Plugin | |:--------------:|:---------:| -| Build Your Own | [le-challenge-http-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-manual.js.git) | [le-challenge-dns-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | | **Default (fs)** | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | -| Full List | [Search le-challenge- on npm](https://www.npmjs.com/search?q=le-challenge-) | | AWS S3 | [llun/le-challenge-s3](https://github.com/llun/le-challenge-s3) | | Digital Ocean | [bmv437/le-challenge-digitalocean](https://www.npmjs.com/package/le-challenge-digitalocean) | +| - | Build Your Own
[le-challenge-http-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-manual.js.git) | +| Full List | Search [le-challenge-](https://www.npmjs.com/search?q=le-challenge-) on npm | DNS-01 Challenges @@ -190,28 +190,28 @@ DNS-01 Challenges | | Plugin | |:--------------:|:---------:| -| Build Your Own | [le-challenge-dns-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | | **Manual (cli)** | [le-challenge-dns](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | -| Full List | [Search le-challenge- on npm](https://www.npmjs.com/search?q=le-challenge-) | | AWS Route 53 | [thadeetrompetter/le-challenge-route53](https://github.com/thadeetrompetter/le-challenge-route53) | | CloudFlare | [buschtoens/le-challenge-cloudflare](https://github.com/buschtoens/le-challenge-cloudflare) | | CloudFlare | [llun/le-challenge-cloudflare](https://github.com/llun/le-challenge-cloudflare) | | Digital Ocean | [bmv437/le-challenge-digitalocean](https://github.com/bmv437/le-challenge-digitalocean) | | etcd | [ceecko/le-challenge-etcd](https://github.com/ceecko/le-challenge-etcd) | +| - | Build Your Own
[le-challenge-dns-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git) | +| Full List | Search [le-challenge-](https://www.npmjs.com/search?q=le-challenge-) on npm | Account & Certificate Storage ----------- | | Plugin | |:--------------:|:---------:| -| Build Your Own | [le-store-SPEC](https://git.coolaj86.com/coolaj86/le-store-SPEC.js.git) | -| Defaults (fs) | [le-store-certbot](https://git.coolaj86.com/coolaj86/le-store-certbot.js.git) | -| Full List | [Search le-store- on npm](https://www.npmjs.com/search?q=le-store-) | +| **Defaults (fs)** | [le-store-certbot](https://git.coolaj86.com/coolaj86/le-store-certbot.js.git) | | AWS S3 | [paco3346/le-store-awss3](https://github.com/paco3346/le-store-awss3) | | AWS S3 | [llun/le-store-s3](https://github.com/llun/le-store-s3) | | Azure | [kolarcz/node-le-challenge-azure-storage](https://github.com/kolarcz/node-le-challenge-azure-storage) | | json (fs) | [paulgrove/le-store-simple-fs](https://github.com/paulgrove/le-store-simple-fs) | Redis | [digitalbazaar/le-store-redis](https://github.com/digitalbazaar/le-store-redis) | +| - | Build Your Own
[le-store-SPEC](https://git.coolaj86.com/coolaj86/le-store-SPEC.js.git) | +| Full List | Search [le-store-](https://www.npmjs.com/search?q=le-store-) on npm | Bugs: Please report bugs with the community plugins to the appropriate owner first, then here if you don't get a response. From e192c4af1149971fffa146d07f350b2747dfc4e4 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 20:13:16 +0000 Subject: [PATCH 10/11] correct plugin categorization --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index ab49d6c..eb63c98 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ HTTP-01 Challenges |:--------------:|:---------:| | **Default (fs)** | [le-challenge-fs](https://git.coolaj86.com/coolaj86/le-challenge-fs.js.git) | | AWS S3 | [llun/le-challenge-s3](https://github.com/llun/le-challenge-s3) | -| Digital Ocean | [bmv437/le-challenge-digitalocean](https://www.npmjs.com/package/le-challenge-digitalocean) | +| Azure | [kolarcz/node-le-challenge-azure-storage](https://github.com/kolarcz/node-le-challenge-azure-storage) | | - | Build Your Own
[le-challenge-http-SPEC](https://git.coolaj86.com/coolaj86/le-challenge-manual.js.git) | | Full List | Search [le-challenge-](https://www.npmjs.com/search?q=le-challenge-) on npm | @@ -207,7 +207,6 @@ Account & Certificate Storage | **Defaults (fs)** | [le-store-certbot](https://git.coolaj86.com/coolaj86/le-store-certbot.js.git) | | AWS S3 | [paco3346/le-store-awss3](https://github.com/paco3346/le-store-awss3) | | AWS S3 | [llun/le-store-s3](https://github.com/llun/le-store-s3) | -| Azure | [kolarcz/node-le-challenge-azure-storage](https://github.com/kolarcz/node-le-challenge-azure-storage) | | json (fs) | [paulgrove/le-store-simple-fs](https://github.com/paulgrove/le-store-simple-fs) | Redis | [digitalbazaar/le-store-redis](https://github.com/digitalbazaar/le-store-redis) | | - | Build Your Own
[le-store-SPEC](https://git.coolaj86.com/coolaj86/le-store-SPEC.js.git) | From 6c5813d86df010c47df8bc5656b73d0504fb895a Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 11 May 2018 20:27:53 +0000 Subject: [PATCH 11/11] add consul to plugins --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index eb63c98..9743058 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Features - [x] AWS (S3, Route53) - [x] Azure - [x] CloudFlare + - [x] Consul - [x] Digital Ocean - [x] etcd - [x] Redis @@ -207,6 +208,7 @@ Account & Certificate Storage | **Defaults (fs)** | [le-store-certbot](https://git.coolaj86.com/coolaj86/le-store-certbot.js.git) | | AWS S3 | [paco3346/le-store-awss3](https://github.com/paco3346/le-store-awss3) | | AWS S3 | [llun/le-store-s3](https://github.com/llun/le-store-s3) | +| Consul | [sebastian-software/le-store-consul](https://github.com/sebastian-software/le-store-consul) | | json (fs) | [paulgrove/le-store-simple-fs](https://github.com/paulgrove/le-store-simple-fs) | Redis | [digitalbazaar/le-store-redis](https://github.com/digitalbazaar/le-store-redis) | | - | Build Your Own
[le-store-SPEC](https://git.coolaj86.com/coolaj86/le-store-SPEC.js.git) |