Browse Source

add communityMember option

beta
AJ ONeal 6 years ago
parent
commit
ab6635cd4d
  1. 52
      README.md
  2. 2
      examples/force-renew.js
  3. 9
      examples/normal.js
  4. 2
      examples/remote-access.js
  5. 3
      examples/simple.js
  6. 13
      examples/vhost.js
  7. 11
      package.json

52
README.md

@ -1,5 +1,8 @@
Greenlock™ for Express.js
=================
A high-level ACME client for Free SSL and Automated HTTPS.
| Sponsored by [ppl](https://ppl.family) |
[Greenlock™](https://git.coolaj86.com/coolaj86/greenlock.js) for
[cli](https://git.coolaj86.com/coolaj86/greenlock-cli.js),
@ -8,12 +11,24 @@ Greenlock™ for Express.js
[Koa](https://git.coolaj86.com/coolaj86/greenlock-koa.js),
[hapi](https://git.coolaj86.com/coolaj86/greenlock-hapi.js)
Free SSL for node.js, now with **Let's Encrypt v2** and **wildcard** domain support)
Fully automatic HTTPS with Express.js
(and all other middleware systems), including virtual hosting (vhost) support with multiple domains.
Certificate renewals happen in the background between 10 and 14 days before expiration (~78 days).
Features
========
- [x] Automatic HTTPS
- [x] Free SSL
- [x] Free Wildcard SSL
- [x] Multiple domain support (up to 100 altnames per SAN)
- [x] Dynamic Virtual Hosting (vhost)
- [x] Automatical renewal (10 to 14 days before expiration)
- [x] Great ACME support
- [x] ACME draft 11
- [x] Let's Encrypt v2
- [x] Let's Encrypt v1
- [x] Full node.js support
- [x] core https module
- [x] Express.js
- [x] [Koa](https://git.coolaj86.com/coolaj86/greenlock-koa.js),
- [x] [hapi](https://git.coolaj86.com/coolaj86/greenlock-hapi.js)
Install
=======
@ -22,6 +37,22 @@ Install
npm install --save greenlock-express@2.x
```
become a `communityMember`
==================
If you're the kind of person that likes the kinds of stuff that I do,
well, I want to do more of it and I'd like to get you involved.
When you set the `communityMember` option to `true` I save your
email and I'm able to inform you when there are mandatory updates
(such as with Let's Encrypt v2), notify you of important security issues,
give you early access to similar projects, and
get your feedback from time to time.
I'll also get a hash of domain names that receive and renew certificates,
which is a metric that has long interested me and may help me in getting
non-developers involved in this and future projects.
QuickStart
==========
<!--
@ -85,6 +116,9 @@ require('greenlock-express').create({
res.end('Hello, World!\n\n💚 🔒.js');
})
// Join the community to get notified of important updates and help me make greenlock better
, communityMember: true
//, debug: true
}).listen(80, 443);
@ -187,6 +221,9 @@ var lex = require('greenlock-express').create({
//, sni: require('le-sni-auto').create({})
, approveDomains: approveDomains
// Join the community to get notified of important updates and help me make greenlock better
, communityMember: true
});
```
@ -198,6 +235,7 @@ function approveDomains(opts, certs, cb) {
// This is where you check your database and associated
// email addresses with domains and agreements and such
opts.communityMember = true;
// The domains being approved for the first time are listed in opts.domains
// Certs being renewed are listed in certs.altnames
@ -275,4 +313,4 @@ Brief overview of some simple options for `greenlock.js`:
* Let's Encrypt v2 (aka v02 or ACME draft 11)
* ACME draft 11 (ACME v2 is a misnomer)
* Wildcard domains!! (via dns-01 challenges)
* `*.example.com`
* `*.example.com`

2
examples/force-renew.js

@ -18,5 +18,7 @@ require('../').create({
, renewWithin: (91 * 24 * 60 * 60 * 1000)
, renewBy: (90 * 24 * 60 * 60 * 1000)
// Get notified of important updates and help me make greenlock better
, communityMember: true
, debug: true
}).listen(80, 443);

9
examples/normal.js

@ -25,13 +25,13 @@ require('../').create({
, server: 'https://acme-staging-v02.api.letsencrypt.org/directory' // staging
// The previous 'simple' example set these values statically,
// but this example uses approveDomains() to set them dynamically
// but this example uses approveDomains() to set them dynamically
//, email: 'none@see.note.above'
//, agreeTos: false
// approveDomains is the right place to check a database for
// email addresses with domains and agreements and such
, approveDomains: approveDomains
, approveDomains: approveDomains
// You MUST have access to write to directory where certs are saved
// ex: /etc/greenlock/
@ -39,6 +39,9 @@ require('../').create({
, app: app
// Get notified of important updates and help me make greenlock better
, communityMember: true
//, debug: true
}).listen(80, 443);
@ -47,7 +50,7 @@ require('../').create({
//
// My Secure Database Check
//
function approveDomains(opts, certs, cb) {
function approveDomains(opts, certs, cb) {
// The domains being approved for the first time are listed in opts.domains
// Certs being renewed are listed in certs.altnames

2
examples/remote-access.js

@ -28,6 +28,8 @@ require('../').create({
, approveDomains: domains
, configDir: require('path').join(require('os').homedir(), 'acme', 'etc')
, app: remoteAccess(secret)
// Get notified of important updates and help me make greenlock better
, communityMember: true
//, debug: true
}).listen(3000, 8443);

3
examples/simple.js

@ -28,6 +28,9 @@ require('../').create({
res.end('Hello, World!\n\n💚 🔒.js');
})
// Get notified of important updates and help me make greenlock better
, communityMember: true
//, debug: true
}).listen(80, 443);

13
examples/vhost.js

@ -30,7 +30,7 @@ require('../').create({
// The domains being approved for the first time are listed in opts.domains
// Certs being renewed are listed in certs.altnames
if (certs) {
opts.domains = certs.altnames;
@ -83,13 +83,10 @@ require('../').create({
var serve = serveStatic(path.join(srv, hostname), { redirect: true });
serve(req, res, finalhandler(req, res));
}
/*
require('express')().use('/', function (req, res) {
res.setHeader('Content-Type', 'text/html; charset=utf-8')
res.end('Hello, World!\n\n💚 🔒.js');
})
*/
// Get notified of important updates and help me make greenlock better
, communityMember: true
//, debug: true
}).listen(80, 443);
}).listen(80, 443);

11
package.json

@ -1,6 +1,6 @@
{
"name": "greenlock-express",
"version": "2.1.1",
"version": "2.1.2",
"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",
@ -12,16 +12,17 @@
"le-challenge-fs": "^2.0.8",
"le-sni-auto": "^2.1.4",
"le-store-certbot": "^2.0.5",
"localhost.daplie.me-certificates": "^1.2.3",
"redirect-https": "^1.1.5"
"redirect-https": "^1.1.5",
},
"devDependencies": {
"express": "^4.16.3",
"express-basic-auth": "^1.1.5",
"serve-index": "^1.9.1"
"finalhandler": "^1.1.1",
"serve-index": "^1.9.1",
"serve-static": "^1.13.2"
},
"scripts": {
"test": "node examples/serve.js"
"test": "node examples/simple.js"
},
"repository": {
"type": "git",

Loading…
Cancel
Save