From 6650defebba74224d4cd10ce54581e82ba6c06cb Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 24 Aug 2019 12:54:23 -0400 Subject: [PATCH] 2.8.4: partial make Prettier, add campaign banner --- .prettierrc | 8 ++ README.md | 334 +++++++++++++++++++++++--------------------- package-lock.json | 230 +++++++++++++++--------------- package.json | 102 +++++++------- scripts/postinstall | 79 +++++++++++ 5 files changed, 426 insertions(+), 327 deletions(-) create mode 100644 .prettierrc create mode 100755 scripts/postinstall diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..7e5d770 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "bracketSpacing": true, + "printWidth": 80, + "singleQuote": true, + "tabWidth": 4, + "trailingComma": "none", + "useTabs": true +} diff --git a/README.md b/README.md index 43fb7d6..36ed85d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -!["Greenlock Logo"](https://git.rootprojects.org/root/greenlock.js/raw/branch/master/logo/greenlock-1063x250.png "Greenlock lock logo and work mark") +!["Greenlock Logo"](https://git.rootprojects.org/root/greenlock.js/raw/branch/master/logo/greenlock-1063x250.png 'Greenlock lock logo and work mark') -!["Greenlock Function"](https://git.rootprojects.org/root/greenlock.js/raw/branch/master/logo/from-not-secure-to-secure-url-bar.png "from url bar showing not secure to url bar showing secure") +!["Greenlock Function"](https://git.rootprojects.org/root/greenlock.js/raw/branch/master/logo/from-not-secure-to-secure-url-bar.png 'from url bar showing not secure to url bar showing secure') # [Greenlock](https://git.rootprojects.org/root/greenlock.js)™ for node.js | a [Root](https://rootprojects.org) project @@ -12,7 +12,6 @@ Greenlock provides Free SSL, Free Wildcard SSL, and Fully Automated HTTPS
!["Weekly Downloads"](https://img.shields.io/npm/dw/greenlock.svg "Weekly Download Count can't be shown") !["Stackoverflow Questions"](https://img.shields.io/stackexchange/stackoverflow/t/greenlock.svg "S.O. Question count can't be shown") - Greenlock works in the [Commandline](https://git.rootprojects.org/root/greenlock-cli.js) (cli), as a [Web Server](https://git.rootprojects.org/root/greenlock-express.js), @@ -21,30 +20,30 @@ and with **node.js** ([npm](https://www.npmjs.com/package/greenlock)). # Features - - [x] Actively Maintained and Commercially Supported - - [x] VanillaJS - - [x] Limited Dependencies - - [x] MPL-2.0 licensed (great for hobbyists and DIYers) - - [x] [Contact us](mailto:support@rootprojects.org?subject=Greenlock%20Commercial%20Support) for Business Support Plans and Commercial LTS Licensing (great for IoT, On-Prem, Web Hosting, etc) - - [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 via [acme.js](https://git.rootprojects.org/root/acme-v2.js) - - [x] "dry run" with self-diagnostics - - [x] ACME draft 12 - - [x] Let's Encrypt v2 - - [x] ~Let's Encrypt v1~ (deprecated) - - [x] [Commandline](https://git.rootprojects.org/root/greenlock-cli.js) (cli) Utilities - - [x] Works with `bash`, `fish`, `zsh`, `cmd.exe`, `PowerShell`, and more - - [x] [Browser](https://git.rootprojects.org/root/greenlock.html) Support - - [x] Full node.js support, with modules for - - [x] [http/https](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples), [Express.js](https://git.rootprojects.org/root/greenlock-express.js), [hapi](https://git.rootprojects.org/root/greenlock-hapi.js), [Koa](https://git.rootprojects.org/root/greenlock-koa.js), [rill](https://git.rootprojects.org/root/greenlock-rill.js), spdy, etc - - [x] Great for securing your Raspberry Pi and IoT projects - - [x] Extensible Plugin Support - - [x] AWS S3, AWS Route53, Azure, CloudFlare, Consul, Digital Ocean, etcd, Redis +- [x] Actively Maintained and Commercially Supported + - [x] VanillaJS + - [x] Limited Dependencies + - [x] MPL-2.0 licensed (great for hobbyists and DIYers) + - [x] [Contact us](mailto:support@rootprojects.org?subject=Greenlock%20Commercial%20Support) for Business Support Plans and Commercial LTS Licensing (great for IoT, On-Prem, Web Hosting, etc) +- [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 via [acme.js](https://git.rootprojects.org/root/acme-v2.js) + - [x] "dry run" with self-diagnostics + - [x] ACME draft 12 + - [x] Let's Encrypt v2 + - [x] ~Let's Encrypt v1~ (deprecated) +- [x] [Commandline](https://git.rootprojects.org/root/greenlock-cli.js) (cli) Utilities + - [x] Works with `bash`, `fish`, `zsh`, `cmd.exe`, `PowerShell`, and more +- [x] [Browser](https://git.rootprojects.org/root/greenlock.html) Support +- [x] Full node.js support, with modules for + - [x] [http/https](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples), [Express.js](https://git.rootprojects.org/root/greenlock-express.js), [hapi](https://git.rootprojects.org/root/greenlock-hapi.js), [Koa](https://git.rootprojects.org/root/greenlock-koa.js), [rill](https://git.rootprojects.org/root/greenlock-rill.js), spdy, etc +- [x] Great for securing your Raspberry Pi and IoT projects +- [x] Extensible Plugin Support + - [x] AWS S3, AWS Route53, Azure, CloudFlare, Consul, Digital Ocean, etcd, Redis ## Greenlock.js for Middleware @@ -57,14 +56,14 @@ Documentation for using Greenlock with # Table of Contents - * Install - * **QuickStart** - * Simple Examples - * Example with ALL OPTIONS - * API - * Developer API - * Change History - * License +- Install +- **QuickStart** +- Simple Examples +- Example with ALL OPTIONS +- API +- Developer API +- Change History +- License # Install @@ -72,10 +71,9 @@ Documentation for using Greenlock with npm install --save greenlock@2.x ``` -**Optional** for *more efficient* RSA key generation you must use node v10.12+ +**Optional** for _more efficient_ RSA key generation you must use node v10.12+ (important for those on ARM devices like Raspberry Pi) - ### Production vs Staging If at first you don't succeed, stop and switch to staging. @@ -98,19 +96,18 @@ Watch the QuickStart demonstration: [https://youtu.be/e8vaR4CEZ5s](https://youtu YouTube Video Preview -* [0:00](https://www.youtube.com/watch?v=e8vaR4CEZ5s&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk#t=0) - Intro -* [2:22](https://www.youtube.com/watch?v=e8vaR4CEZ5s&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk#t=142) - Demonstrating QuickStart Example -* [6:37](https://www.youtube.com/watch?v=e8vaR4CEZ5s&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk?t=397) - Troubleshooting / Gotchas +- [0:00](https://www.youtube.com/watch?v=e8vaR4CEZ5s&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk#t=0) - Intro +- [2:22](https://www.youtube.com/watch?v=e8vaR4CEZ5s&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk#t=142) - Demonstrating QuickStart Example +- [6:37](https://www.youtube.com/watch?v=e8vaR4CEZ5s&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk?t=397) - Troubleshooting / Gotchas #### Production Configuration (Part 2) -* [1:00](https://www.youtube.com/watch?v=bTEn93gxY50&index=2&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk&t=60) - Bringing Greenlock into an Existing Express Project -* [2:26](https://www.youtube.com/watch?v=bTEn93gxY50&index=2&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk&t=146) - The `approveDomains` callback +- [1:00](https://www.youtube.com/watch?v=bTEn93gxY50&index=2&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk&t=60) - Bringing Greenlock into an Existing Express Project +- [2:26](https://www.youtube.com/watch?v=bTEn93gxY50&index=2&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk&t=146) - The `approveDomains` callback #### Security Concerns (Part 3) -* [0:00](https://www.youtube.com/watch?v=aZgVqPzoZTY&index=3&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk) - Potential Attacks, and Mitigation - +- [0:00](https://www.youtube.com/watch?v=aZgVqPzoZTY&index=3&list=PLZaEVINf2Bq_lrS-OOzTUJB4q3HxarlXk) - Potential Attacks, and Mitigation # Easy as 1, 2, 3... 4 @@ -119,13 +116,12 @@ Greenlock is built to incredibly easy to use, without sacrificing customization The following examples range from just a few lines of code for getting started, to more robust examples that you might start with for an enterprise-grade use of the ACME api. -* Automatic HTTPS (for single sites) -* Fully Automatic HTTPS (for multi-domain vhosts) -* Manual HTTPS (for API integration) +- Automatic HTTPS (for single sites) +- Fully Automatic HTTPS (for multi-domain vhosts) +- Manual HTTPS (for API integration) ## Automatic HTTPS - **Note**: For (fully) automatic HTTPS you may prefer the [Express.js module](https://git.rootprojects.org/root/greenlock-express.js) @@ -133,8 +129,8 @@ This works for most people, but it's not as fun as some of the other examples. Great when - - [x] You only need a limited number of certificates - - [x] You want to use the bare node http and https modules without fluff +- [x] You only need a limited number of certificates +- [x] You want to use the bare node http and https modules without fluff ```js //////////////////// @@ -142,12 +138,12 @@ Great when //////////////////// var greenlock = require('greenlock').create({ - email: 'user@example.com' // IMPORTANT: Change email and domains -, agreeTos: true // Accept Let's Encrypt v2 Agreement -, configDir: '~/.config/acme' // A writable folder (a non-fs plugin) + email: 'user@example.com', // IMPORTANT: Change email and domains + agreeTos: true, // Accept Let's Encrypt v2 Agreement + configDir: '~/.config/acme', // A writable folder (a non-fs plugin) -, 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) + 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) }); ``` @@ -157,11 +153,15 @@ var greenlock = require('greenlock').create({ //////////////////// var redir = require('redirect-https')(); -require('http').createServer(greenlock.middleware(redir)).listen(80); +require('http') + .createServer(greenlock.middleware(redir)) + .listen(80); -require('spdy').createServer(greenlock.tlsOptions, function (req, res) { - res.end('Hello, Secure World!'); -}).listen(443); +require('spdy') + .createServer(greenlock.tlsOptions, function(req, res) { + res.end('Hello, Secure World!'); + }) + .listen(443); ``` ## Fully Automatic HTTPS @@ -171,9 +171,9 @@ the [Express.js module](https://git.rootprojects.org/root/greenlock-express.js) Great when - - [x] You have a growing number of domains - - [x] You're integrating into your own hosting solution - - [x] Customize ACME http-01 or dns-01 challenge +- [x] You have a growing number of domains +- [x] You're integrating into your own hosting solution +- [x] Customize ACME http-01 or dns-01 challenge ```js //////////////////// @@ -181,68 +181,72 @@ Great when //////////////////// var path = require('path'); -var os = require('os') +var os = require('os'); var Greenlock = require('greenlock'); var greenlock = Greenlock.create({ - version: 'draft-12' -, server: 'https://acme-v02.api.letsencrypt.org/directory' + version: 'draft-12', + server: 'https://acme-v02.api.letsencrypt.org/directory', - // Use the approveDomains callback to set per-domain config - // (default: approve any domain that passes self-test of built-in challenges) -, approveDomains: approveDomains + // Use the approveDomains callback to set per-domain config + // (default: approve any domain that passes self-test of built-in challenges) + approveDomains: approveDomains, - // the default servername to use when the client doesn't specify -, servername: 'example.com' + // the default servername to use when the client doesn't specify + servername: 'example.com', - // If you wish to replace the default account and domain key storage plugin -, store: require('le-store-fs').create({ - configDir: path.join(os.homedir(), 'acme/etc') - , webrootPath: '/tmp/acme-challenges' - }) + // If you wish to replace the default account and domain key storage plugin + store: require('le-store-fs').create({ + configDir: path.join(os.homedir(), 'acme/etc'), + webrootPath: '/tmp/acme-challenges' + }) }); - ///////////////////// // APPROVE DOMAINS // ///////////////////// -var http01 = require('le-challenge-fs').create({ webrootPath: '/tmp/acme-challenges' }); +var http01 = require('le-challenge-fs').create({ + webrootPath: '/tmp/acme-challenges' +}); function approveDomains(opts, certs, cb) { - // This is where you check your database and associated - // email addresses with domains and agreements and such + // This is where you check your database and associated + // email addresses with domains and agreements and such - // Opt-in to submit stats and get important updates - opts.communityMember = true; + // Opt-in to submit stats and get important updates + opts.communityMember = true; - // If you wish to replace the default challenge plugin, you may do so here - opts.challenges = { 'http-01': http01 }; + // If you wish to replace the default challenge plugin, you may do so here + opts.challenges = { 'http-01': http01 }; - // The domains being approved for the first time are listed in opts.domains - // Certs being renewed are listed in certs.altnames - // certs.domains; - // certs.altnames; - opts.email = 'john.doe@example.com'; - opts.agreeTos = true; + // The domains being approved for the first time are listed in opts.domains + // Certs being renewed are listed in certs.altnames + // certs.domains; + // certs.altnames; + opts.email = 'john.doe@example.com'; + opts.agreeTos = true; - // NOTE: you can also change other options such as `challengeType` and `challenge` - // opts.challengeType = 'http-01'; - // opts.challenge = require('le-challenge-fs').create({}); + // NOTE: you can also change other options such as `challengeType` and `challenge` + // opts.challengeType = 'http-01'; + // opts.challenge = require('le-challenge-fs').create({}); - cb(null, { options: opts, certs: certs }); + cb(null, { options: opts, certs: certs }); } - //////////////////// // CREATE SERVERS // //////////////////// var redir = require('redirect-https')(); -require('http').createServer(greenlock.middleware(redir)).listen(80); +require('http') + .createServer(greenlock.middleware(redir)) + .listen(80); -require('https').createServer(greenlock.tlsOptions, function (req, res) { - res.end('Hello, Secure World!'); -}).listen(443); +require('https') + .createServer(greenlock.tlsOptions, function(req, res) { + res.end('Hello, Secure World!'); + }) + .listen(443); ``` ## Manual HTTPS @@ -293,19 +297,24 @@ greenlock.register(opts).then(function (certs) { The domain key and ssl certificates you get back can be used in a webserver like this: ```js -var tlsOptions = { key: certs.privkey, cert: certs.cert + '\r\n' + certs.chain }; -require('https').createServer(tlsOptions, function (req, res) { - res.end('Hello, Secure World!'); -}).listen(443); +var tlsOptions = { + key: certs.privkey, + cert: certs.cert + '\r\n' + certs.chain +}; +require('https') + .createServer(tlsOptions, function(req, res) { + res.end('Hello, Secure World!'); + }) + .listen(443); ``` # Example with ALL OPTIONS The configuration consists of 3 components: -* Storage Backend (search npm for projects starting with 'le-store-') -* ACME Challenge Handlers (search npm for projects starting with 'le-challenge-') -* Letsencryt Config (this is all you) +- Storage Backend (search npm for projects starting with 'le-store-') +- ACME Challenge Handlers (search npm for projects starting with 'le-challenge-') +- Letsencryt Config (this is all you) ```javascript 'use strict'; @@ -419,8 +428,7 @@ Here's what `results` looks like: } ``` -API ---- +## API The full end-user API is exposed in the example above and includes all relevant options. @@ -433,7 +441,7 @@ greenlock.check(opts) We do expose a few helper functions: -* Greenlock.validDomain(hostname) // returns '' or the hostname string if it's a valid ascii or punycode domain name +- Greenlock.validDomain(hostname) // returns '' or the hostname string if it's a valid ascii or punycode domain name TODO fetch domain tld list @@ -441,16 +449,16 @@ TODO fetch domain tld list The following variables will be tempalted in any strings passed to the options object: -* `~/` replaced with `os.homedir()` i.e. `/Users/aj` -* `:hostname` replaced with the first domain in the list i.e. `example.com` +- `~/` replaced with `os.homedir()` i.e. `/Users/aj` +- `:hostname` replaced with the first domain in the list i.e. `example.com` ### Dangerous Options By default SNI is made to lowercase and is automatically rejected if it contains invalid characters for a domain. This behavior can be modified: - * `__dns_allow_dangerous_names` allow SNI names like "Robert'); DROP TABLE Students;" - * `__dns_preserve_case` passes SNI names such as "ExAMpLE.coM" without converting to lower case +- `__dns_allow_dangerous_names` allow SNI names like "Robert'); DROP TABLE Students;" +- `__dns_preserve_case` passes SNI names such as "ExAMpLE.coM" without converting to lower case ## Developer API @@ -470,16 +478,16 @@ should be kept in sync. See [greenlock-store-test](https://git.rootprojects.org/root/greenlock-store-test.js) and [greenlock-store-fs](https://git.rootprojects.org/root/greenlock-store-fs.js) -* accounts. - * checkKeypair(opts) - * check(opts) - * setKeypair(opts) - * set(opts) -* certificates. - * checkKeypair(opts) - * check(opts) - * setKeypair(opts) - * set(opts) +- accounts. + - checkKeypair(opts) + - check(opts) + - setKeypair(opts) + - set(opts) +- certificates. + - checkKeypair(opts) + - check(opts) + - setKeypair(opts) + - set(opts) ### challenge implementation @@ -487,50 +495,52 @@ See [greenlock-challenge-test](https://git.rootprojects.org/root/greenlock-chall [acme-http-01-cli](https://git.rootprojects.org/root/acme-http-01-cli.js), and [acme-dns-01-cli](https://git.rootprojects.org/root/acme-dns-01-cli.js) -* `.set(opts);` -* `.get(opts);` -* `.remove(opts);` +- `.set(opts);` +- `.get(opts);` +- `.remove(opts);` # Change History -* v2.7 - * API: transitional for v3 API (Promies, async/await) - * Security: Zero external dependencies - * Plugins: `greenlock-store-fs` replaces `le-store-certbot` as the default storage plugin - * Features: Full wildcard support - * Licensing: Commercial licensing and support plans now available -* v2.6 - * better defaults, fewer explicit options - * better pre-flight self-tests, explicit domains not required -* v2.5 - * bugfix JWK (update rsa-compat) - * eliminate all external non-optional dependencies -* 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.11 - documentation updates - * v2.2.10 - don't let SNICallback swallow approveDomains errors 6286883fc2a6ebfff711a540a2e4d92f3ac2907c - * v2.2.8 - communityMember option support - * v2.2.7 - bugfix for wildcard support - * v2.2.5 - node v6.x compat - * 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 -* v2.0.1 - Aug 9th 2016 - * major refactor - * simplified API - * modular plugins - * knock out bugs -* v1.5.0 now using letiny-core v2.0.0 and rsa-compat -* v1.4.x I can't remember... but it's better! -* v1.1.0 Added letiny-core, removed node-letsencrypt-python -* v1.0.2 Works with node-letsencrypt-python -* v1.0.0 Thar be dragons + +- v2.7 + - API: transitional for v3 API (Promies, async/await) + - Security: Zero external dependencies + - Plugins: `greenlock-store-fs` replaces `le-store-certbot` as the default storage plugin + - Features: Full wildcard support + - Licensing: Commercial licensing and support plans now available +- v2.6 + - better defaults, fewer explicit options + - better pre-flight self-tests, explicit domains not required +- v2.5 + - bugfix JWK (update rsa-compat) + - eliminate all external non-optional dependencies +- 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.11 - documentation updates + - v2.2.10 - don't let SNICallback swallow approveDomains errors 6286883fc2a6ebfff711a540a2e4d92f3ac2907c + - v2.2.8 - communityMember option support + - v2.2.7 - bugfix for wildcard support + - v2.2.5 - node v6.x compat + - 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 +- v2.0.1 - Aug 9th 2016 + - major refactor + - simplified API + - modular plugins + - knock out bugs +- v1.5.0 now using letiny-core v2.0.0 and rsa-compat +- v1.4.x I can't remember... but it's better! +- v1.1.0 Added letiny-core, removed node-letsencrypt-python +- v1.0.2 Works with node-letsencrypt-python +- v1.0.0 Thar be dragons # Commercial Licensing + As the number of businesses using Greenlock commercially has increased, we've become more aware of the need for quick-turnaround support and licenses that allow for local private modifications. Currently we offer LTS support and commercial licensing models for IoT, On-Prem, and Web Hosting. Please [contact us](mailto:support@rootprojects.org?subject=Greenlock%20Commercial%20Support) to learn more. Our [trademark policy](https://therootcompany.com/legal/#trademark) is pretty much "attribute, but don't confuse". Your users should understand that your product _uses_ Greenlock and not be confused to think that it _is_ Greenlock. diff --git a/package-lock.json b/package-lock.json index 074fd25..0cf9c21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,117 +1,117 @@ { - "name": "greenlock", - "version": "2.8.2", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@root/mkdirp": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@root/mkdirp/-/mkdirp-1.0.0.tgz", - "integrity": "sha512-hxGAYUx5029VggfG+U9naAhQkoMSXtOeXtbql97m3Hi6/sQSRL/4khKZPyOF6w11glyCOU38WCNLu9nUcSjOfA==" - }, - "@root/request": { - "version": "1.3.11", - "resolved": "https://registry.npmjs.org/@root/request/-/request-1.3.11.tgz", - "integrity": "sha512-3a4Eeghcjsfe6zh7EJ+ni1l8OK9Fz2wL1OjP4UCa0YdvtH39kdXB9RGWuzyNv7dZi0+Ffkc83KfH0WbPMiuJFw==" - }, - "acme": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/acme/-/acme-1.3.1.tgz", - "integrity": "sha512-dnNbHWOfl6FX8NhsmrIh5EdkiENr4exJ0n3HWm56Irmp1DMTM6oAXULoUCsNNyYganJSAvThz7VtMgRqgBSDiA==", - "requires": { - "acme-v2": "^1.8.2" - } - }, - "acme-dns-01-cli": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/acme-dns-01-cli/-/acme-dns-01-cli-3.0.7.tgz", - "integrity": "sha512-Aa4bUpq6ftX1VODiShOetOY5U0tsXY5EV7+fQwme3Q8Y9rjYBArBXHgFCAVKtK1AF+Ev8pIuF6Z42hzMFa73/w==" - }, - "acme-v2": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.8.2.tgz", - "integrity": "sha512-uYGA+DuTnA44EsGXE413XnbTotGHCzkucXjMk23QRwGnaGlnr0lNBoYjByyeIVLSzj0W6Y9FqA9h+15+H+ltMw==", - "requires": { - "@root/request": "^1.3.11", - "rsa-compat": "^2.0.8" - } - }, - "cert-info": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/cert-info/-/cert-info-1.5.1.tgz", - "integrity": "sha512-eoQC/yAgW3gKTKxjzyClvi+UzuY97YCjcl+lSqbsGIy7HeGaWxCPOQFivhUYm27hgsBMhsJJFya3kGvK6PMIcQ==" - }, - "eckles": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/eckles/-/eckles-1.4.1.tgz", - "integrity": "sha512-auWyk/k8oSkVHaD4RxkPadKsLUcIwKgr/h8F7UZEueFDBO7BsE4y+H6IMUDbfqKIFPg/9MxV6KcBdJCmVVcxSA==" - }, - "greenlock-store-fs": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/greenlock-store-fs/-/greenlock-store-fs-3.0.2.tgz", - "integrity": "sha512-t4So75yKs1+7TqmxD5UKdf+zOQU0/4o0lb2auf5zUcAo7fwwNLOAXyWnnZRL3WuFBUiBGh1qXWleuMua0d3LPg==", - "requires": { - "@root/mkdirp": "^1.0.0", - "safe-replace": "^1.1.0" - } - }, - "keypairs": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/keypairs/-/keypairs-1.2.14.tgz", - "integrity": "sha512-ZoZfZMygyB0QcjSlz7Rh6wT2CJasYEHBPETtmHZEfxuJd7bnsOG5AdtPZqHZBT+hoHvuWCp/4y8VmvTvH0Y9uA==", - "requires": { - "eckles": "^1.4.1", - "rasha": "^1.2.4" - } - }, - "le-challenge-fs": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/le-challenge-fs/-/le-challenge-fs-2.0.9.tgz", - "integrity": "sha512-stzI6rxd+aXGxBl87QJKKY/i/wl3uz6EoWzX2xSazJvCPSYBQys1RVNgOcf0SfUQPh6TBCFJFSJkiR4mznb4sg==", - "requires": { - "@root/mkdirp": "^1.0.0" - } - }, - "le-sni-auto": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/le-sni-auto/-/le-sni-auto-2.1.9.tgz", - "integrity": "sha512-QmQHNwQDi/56GY8+qczFZ06FZbxaeJQjbjEhwwQHhkJ9IHhIQFkPfCT/OyDfLj4gqLIrg5ZX8CemxxVZnLEYfg==" - }, - "le-store-certbot": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/le-store-certbot/-/le-store-certbot-2.2.3.tgz", - "integrity": "sha512-c4ACR+v+JKMiAOOshLh6gdCKA7wIWR16+mROMLpQjq3rXJ3Vm8FaBHe2H+crT+flP+g7FmciAwUlfOJEJpIuCQ==", - "requires": { - "@root/mkdirp": "^1.0.0", - "pyconf": "^1.1.7", - "safe-replace": "^1.1.0" - } - }, - "pyconf": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/pyconf/-/pyconf-1.1.7.tgz", - "integrity": "sha512-v4clh33m68sjtMsh8XMpjhGWb/MQODAYZ1y7ORG5Qv58UK25OddoB+oXyexgDkK8ttFui/lZm2sQDgA2Ftjfkw==", - "requires": { - "safe-replace": "^1.0.2" - } - }, - "rasha": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/rasha/-/rasha-1.2.5.tgz", - "integrity": "sha512-KxtX+/fBk+wM7O3CNgwjSh5elwFilLvqWajhr6wFr2Hd63JnKTTi43Tw+Jb1hxJQWOwoya+NZWR2xztn3hCrTw==" - }, - "rsa-compat": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/rsa-compat/-/rsa-compat-2.0.8.tgz", - "integrity": "sha512-BFiiSEbuxzsVdaxpejbxfX07qs+rtous49Y6mL/zw6YHh9cranDvm2BvBmqT3rso84IsxNlP5BXnuNvm1Wn3Tw==", - "requires": { - "keypairs": "^1.2.14" - } - }, - "safe-replace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-replace/-/safe-replace-1.1.0.tgz", - "integrity": "sha512-9/V2E0CDsKs9DWOOwJH7jYpSl9S3N05uyevNjvsnDauBqRowBPOyot1fIvV5N2IuZAbYyvrTXrYFVG0RZInfFw==" - } - } + "name": "greenlock", + "version": "2.8.4", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@root/mkdirp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@root/mkdirp/-/mkdirp-1.0.0.tgz", + "integrity": "sha512-hxGAYUx5029VggfG+U9naAhQkoMSXtOeXtbql97m3Hi6/sQSRL/4khKZPyOF6w11glyCOU38WCNLu9nUcSjOfA==" + }, + "@root/request": { + "version": "1.3.11", + "resolved": "https://registry.npmjs.org/@root/request/-/request-1.3.11.tgz", + "integrity": "sha512-3a4Eeghcjsfe6zh7EJ+ni1l8OK9Fz2wL1OjP4UCa0YdvtH39kdXB9RGWuzyNv7dZi0+Ffkc83KfH0WbPMiuJFw==" + }, + "acme": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/acme/-/acme-1.3.1.tgz", + "integrity": "sha512-dnNbHWOfl6FX8NhsmrIh5EdkiENr4exJ0n3HWm56Irmp1DMTM6oAXULoUCsNNyYganJSAvThz7VtMgRqgBSDiA==", + "requires": { + "acme-v2": "^1.8.2" + } + }, + "acme-dns-01-cli": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/acme-dns-01-cli/-/acme-dns-01-cli-3.0.7.tgz", + "integrity": "sha512-Aa4bUpq6ftX1VODiShOetOY5U0tsXY5EV7+fQwme3Q8Y9rjYBArBXHgFCAVKtK1AF+Ev8pIuF6Z42hzMFa73/w==" + }, + "acme-v2": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.8.2.tgz", + "integrity": "sha512-uYGA+DuTnA44EsGXE413XnbTotGHCzkucXjMk23QRwGnaGlnr0lNBoYjByyeIVLSzj0W6Y9FqA9h+15+H+ltMw==", + "requires": { + "@root/request": "^1.3.11", + "rsa-compat": "^2.0.8" + } + }, + "cert-info": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/cert-info/-/cert-info-1.5.1.tgz", + "integrity": "sha512-eoQC/yAgW3gKTKxjzyClvi+UzuY97YCjcl+lSqbsGIy7HeGaWxCPOQFivhUYm27hgsBMhsJJFya3kGvK6PMIcQ==" + }, + "eckles": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/eckles/-/eckles-1.4.1.tgz", + "integrity": "sha512-auWyk/k8oSkVHaD4RxkPadKsLUcIwKgr/h8F7UZEueFDBO7BsE4y+H6IMUDbfqKIFPg/9MxV6KcBdJCmVVcxSA==" + }, + "greenlock-store-fs": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/greenlock-store-fs/-/greenlock-store-fs-3.0.2.tgz", + "integrity": "sha512-t4So75yKs1+7TqmxD5UKdf+zOQU0/4o0lb2auf5zUcAo7fwwNLOAXyWnnZRL3WuFBUiBGh1qXWleuMua0d3LPg==", + "requires": { + "@root/mkdirp": "^1.0.0", + "safe-replace": "^1.1.0" + } + }, + "keypairs": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/keypairs/-/keypairs-1.2.14.tgz", + "integrity": "sha512-ZoZfZMygyB0QcjSlz7Rh6wT2CJasYEHBPETtmHZEfxuJd7bnsOG5AdtPZqHZBT+hoHvuWCp/4y8VmvTvH0Y9uA==", + "requires": { + "eckles": "^1.4.1", + "rasha": "^1.2.4" + } + }, + "le-challenge-fs": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/le-challenge-fs/-/le-challenge-fs-2.0.9.tgz", + "integrity": "sha512-stzI6rxd+aXGxBl87QJKKY/i/wl3uz6EoWzX2xSazJvCPSYBQys1RVNgOcf0SfUQPh6TBCFJFSJkiR4mznb4sg==", + "requires": { + "@root/mkdirp": "^1.0.0" + } + }, + "le-sni-auto": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/le-sni-auto/-/le-sni-auto-2.1.9.tgz", + "integrity": "sha512-QmQHNwQDi/56GY8+qczFZ06FZbxaeJQjbjEhwwQHhkJ9IHhIQFkPfCT/OyDfLj4gqLIrg5ZX8CemxxVZnLEYfg==" + }, + "le-store-certbot": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/le-store-certbot/-/le-store-certbot-2.2.3.tgz", + "integrity": "sha512-c4ACR+v+JKMiAOOshLh6gdCKA7wIWR16+mROMLpQjq3rXJ3Vm8FaBHe2H+crT+flP+g7FmciAwUlfOJEJpIuCQ==", + "requires": { + "@root/mkdirp": "^1.0.0", + "pyconf": "^1.1.7", + "safe-replace": "^1.1.0" + } + }, + "pyconf": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/pyconf/-/pyconf-1.1.7.tgz", + "integrity": "sha512-v4clh33m68sjtMsh8XMpjhGWb/MQODAYZ1y7ORG5Qv58UK25OddoB+oXyexgDkK8ttFui/lZm2sQDgA2Ftjfkw==", + "requires": { + "safe-replace": "^1.0.2" + } + }, + "rasha": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/rasha/-/rasha-1.2.5.tgz", + "integrity": "sha512-KxtX+/fBk+wM7O3CNgwjSh5elwFilLvqWajhr6wFr2Hd63JnKTTi43Tw+Jb1hxJQWOwoya+NZWR2xztn3hCrTw==" + }, + "rsa-compat": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/rsa-compat/-/rsa-compat-2.0.8.tgz", + "integrity": "sha512-BFiiSEbuxzsVdaxpejbxfX07qs+rtous49Y6mL/zw6YHh9cranDvm2BvBmqT3rso84IsxNlP5BXnuNvm1Wn3Tw==", + "requires": { + "keypairs": "^1.2.14" + } + }, + "safe-replace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-replace/-/safe-replace-1.1.0.tgz", + "integrity": "sha512-9/V2E0CDsKs9DWOOwJH7jYpSl9S3N05uyevNjvsnDauBqRowBPOyot1fIvV5N2IuZAbYyvrTXrYFVG0RZInfFw==" + } + } } diff --git a/package.json b/package.json index 61d1382..a95bb67 100644 --- a/package.json +++ b/package.json @@ -1,52 +1,54 @@ { - "name": "greenlock", - "version": "2.8.3", - "description": "Greenlock is Let's Encrypt (ACME) client for node.js", - "homepage": "https://greenlock.domains/", - "main": "index.js", - "files": [ - "lib" - ], - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://git.rootprojects.org/root/greenlock.js.git" - }, - "keywords": [ - "Let's Encrypt", - "letsencrypt", - "ACME", - "v2", - "auto-sni", - "Free SSL", - "Automated HTTPS", - "tls", - "https" - ], - "author": "AJ ONeal (https://solderjs.com/)", - "license": "MPL-2.0", - "bugs": { - "url": "https://git.rootprojects.org/root/greenlock.js/issues" - }, - "trulyOptionalDependencies": { - "bluebird": "^3.5.1", - "le-acme-core": "^2.1.3" - }, - "dependencies": { - "acme": "^1.3.1", - "acme-dns-01-cli": "^3.0.0", - "acme-v2": "^1.8.2", - "cert-info": "^1.5.1", - "greenlock-store-fs": "^3.0.2", - "keypairs": "^1.2.14", - "le-challenge-fs": "^2.0.2", - "le-sni-auto": "^2.1.9", - "le-store-certbot": "^2.2.3", - "rsa-compat": "^2.0.8" - }, - "engines": { - "node": ">=4.5" - } + "name": "greenlock", + "version": "2.8.4", + "description": "Greenlock is Let's Encrypt (ACME) client for node.js", + "homepage": "https://greenlock.domains/", + "main": "index.js", + "files": [ + "lib", + "scripts" + ], + "scripts": { + "postinstall": "node scripts/postinstall", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://git.rootprojects.org/root/greenlock.js.git" + }, + "keywords": [ + "Let's Encrypt", + "letsencrypt", + "ACME", + "v2", + "auto-sni", + "Free SSL", + "Automated HTTPS", + "tls", + "https" + ], + "author": "AJ ONeal (https://solderjs.com/)", + "license": "MPL-2.0", + "bugs": { + "url": "https://git.rootprojects.org/root/greenlock.js/issues" + }, + "trulyOptionalDependencies": { + "bluebird": "^3.5.1", + "le-acme-core": "^2.1.3" + }, + "dependencies": { + "acme": "^1.3.1", + "acme-dns-01-cli": "^3.0.0", + "acme-v2": "^1.8.2", + "cert-info": "^1.5.1", + "greenlock-store-fs": "^3.0.2", + "keypairs": "^1.2.14", + "le-challenge-fs": "^2.0.2", + "le-sni-auto": "^2.1.9", + "le-store-certbot": "^2.2.3", + "rsa-compat": "^2.0.8" + }, + "engines": { + "node": ">=4.5" + } } diff --git a/scripts/postinstall b/scripts/postinstall new file mode 100755 index 0000000..8a7e77e --- /dev/null +++ b/scripts/postinstall @@ -0,0 +1,79 @@ +#!/usr/bin/env node +'use strict'; + +// BG WH \u001b[47m +// BOLD \u001b[1m +// RED \u001b[31m +// GREEN \u001b[32m +// RESET \u001b[0m + +var grabbers = [ + [ + '', + '================================================================================', + '', + ' 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥', + '🔥 🔥', + '🔥 Do you rely on Greenlock? 🔥', + '🔥 🔥', + ' 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥' + ], + + [ + '', + '================================================================================', + '', + ' 🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒', + '🍒 🍒', + '🍒 Do you rely on Greenlock? 🍒', + '🍒 🍒', + ' 🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒🍒' + ], + + [ + '', + '================================================================================', + '', + ' 👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇', + '👉 👈', + '👉 Do you rely on Greenlock? 👈', + '👉 👈', + ' 👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆 ' + ], + + [ + '', + '================================================================================', + '', + ' 👀 👀 👀 👀 👀 👀 👀 👀 👀 👀 👀 ', + '👀 👀', + '👀 Do you rely on Greenlock? 👀', + '👀 👀', + ' 👀 👀 👀 👀 👀 👀 👀 👀 👀 👀 👀 ' + ] +]; + +setTimeout(function() { + grabbers[Math.floor(Math.random() * grabbers.length)] + .concat([ + '', + "Hey! Let's Encrypt will \u001b[31mSTOP WORKING\u001b[0m with Greenlock v2 at the end of October,", + "and \u001b[31mWITHOUT YOUR HELP\u001b[0m we won't get the next release out in time.", + '', + 'If Greenlock has saved you time and money, and taken stress out of your life,', + 'or you just love it, please reach out to return the favor today:', + '', + '\u001b[31mSAVE GREENLOCK:\u001b[0m', + 'https://indiegogo.com/at/greenlock', + '', + '================================================================================', + '' + ]) + .forEach(function(line) { + console.info(line); + }); +}, 300); + +setTimeout(function() { + // give time to read +}, 1500);