From 8e29cafdf535306ce3c25a1600d6591fdeec2ff2 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 5 Jan 2020 17:32:20 -0700 Subject: [PATCH] updates for v4 --- README.md | 60 +++++++++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 8e000b3..06ee13c 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,11 @@ npm init ``` ```bash -npm install --save greenlock-express@v3 +npm install --save greenlock-express@v4 ``` ```bash -npx greenlock init --maintainer-email 'jon@example.com' +npx greenlock init --maintainer-email 'jon@example.com' --config-dir ./greenlock.d ```
@@ -65,13 +65,16 @@ require("greenlock-express") var pkg = require("./package.json"); module.exports = require("@root/greenlock").create({ // name & version for ACME client user agent - packageAgent: pkg.name + "/" + pkg.version, + //packageAgent: pkg.name + "/" + pkg.version, // contact for security and critical bug notices maintainerEmail: pkg.author, // where to find .greenlockrc and set default paths - packageRoot: __dirname + packageRoot: __dirname, + + // where config and certificate stuff go + configDir: "./greenlock.d" }); ``` @@ -221,32 +224,27 @@ later, if you need them. ```js "use strict"; +//var pkg = require("./package.json"); +var app = require("./app.js"); + require("greenlock-express") - .init(function() { - var pkg = require("./package.json"); - return { - greenlock: require("@root/greenlock").create({ - // name & version for ACME client user agent - packageAgent: pkg.name + "/" + pkg.version, + .init({ + // name & version for ACME client user agent + //packageAgent: pkg.name + "/" + pkg.version, - // contact for security and critical bug notices - maintainerEmail: pkg.author, + // contact for security and critical bug notices + maintainerEmail: pkg.author, - // where to find .greenlockrc and set default paths - packageRoot: __dirname - }), + // where to find .greenlockrc and set default paths + packageRoot: __dirname, - // whether or not to run at cloudscale - cluster: false - }; + // where config and certificate stuff go + configDir: "./greenlock.d", + + // whether or not to run at cloudscale + cluster: false }) - .ready(function(glx) { - var app = require("./app.js"); - - // Serves on 80 and 443 - // Get's SSL certificates magically! - glx.serveApp(app); - }); + .serve(app); ``` And start your server: @@ -267,9 +265,8 @@ npm start -- --staging ``` ```txt -Greenlock v3.0.0 -Greenlock Manager Config File: ~/.config/greenlock/manager.json -Greenlock Storage Directory: ~/.config/greenlock/ +Greenlock v4.0.0 +Greenlock Config Dir/File: ./greenlock.d/config.json Listening on 0.0.0.0:80 for ACME challenges and HTTPS redirects Listening on 0.0.0.0:443 for secure traffic @@ -296,8 +293,10 @@ cat .greenlockrc ```json { - "manager": "greenlock-manager-fs", - "configFile": "./greenlock.json" + "manager": { + "module": "@greenlock/manager" + }, + "configDir": "./greenlock.d" } ``` @@ -526,4 +525,3 @@ attribution, and/or visible source policies. We want to build great software and MPL-2.0 | [Terms of Use](https://therootcompany.com/legal/#terms) | [Privacy Policy](https://therootcompany.com/legal/#privacy) -[Privacy Policy](https://therootcompany.com/legal/#privacy) diff --git a/package.json b/package.json index c451a93..25c0e5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@root/greenlock-express", - "version": "3.1.1", + "version": "4.0.0", "description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.", "main": "greenlock-express.js", "homepage": "https://greenlock.domains",