Compare commits

...

5 Commits

  1. 33
      README.md
  2. 12
      WALKTHROUGH.md
  3. 16
      package-lock.json
  4. 4
      package.json

33
README.md

@ -1,4 +1,4 @@
# [Greenlock Express](https://git.rootprojects.org/root/greenlock-express.js) is Let's Encrypt for Node
# [Greenlock Express v4](https://git.rootprojects.org/root/greenlock-express.js) is Let's Encrypt for Node
| Built by [Root](https://therootcompany.com) for [Hub](https://rootprojects.org/hub/) |
@ -85,9 +85,11 @@ Works with _any_ node http app, including
- [x] cluster
- [x] etc...
# QuickStart: Serve Sites with Free SSL
# v4 QuickStart
Easy as 1, 2, 3... 4
Serving sites with Free SSL is as easy as 1, 2, 3... 4
### Overview
1. Create a Project with Greenlock Express
- `server.js`
@ -99,6 +101,8 @@ Easy as 1, 2, 3... 4
4. Hello, World!
- `npm start -- --staging`
## 1. Create your Project
```bash
npm init
npm install --save greenlock-express@v4
@ -106,12 +110,14 @@ npm install --save greenlock-express@v4
You can use **local file storage** or a **database**. The default is to use file storage.
## 2. Initialize and Config (Dir or DB)
```bash
# Note: you can use the CLI to create `server.js` and `greenlock.d/config.json`
npx greenlock init --config-dir ./greenlock.d --maintainer-email 'jon@example.com'
```
<details>
<summary>server.js</summary>
`server.js`:
```js
"use strict";
@ -133,10 +139,7 @@ require("greenlock-express")
.serve(app);
```
</details>
<details>
<summary>app.js</summary>
`app.js`:
```js
"use strict";
@ -150,14 +153,14 @@ var app = function(req, res) {
module.exports = app;
```
</details>
### 3. Add Sites
```bash
# Note: you can use the CLI to edit the config file
npx greenlock add --subject example.com --altnames example.com
```
<details>
<summary>greenlock.d/config.json</summary>
`greenlock.d/config.json`:
<!-- TODO update manager to write array rather than object -->
@ -165,9 +168,10 @@ npx greenlock add --subject example.com --altnames example.com
{ "sites": [{ "subject": "example.com", "altnames": ["example.com"] }] }
```
</details>
### 4. Hello, Encrypted World!
```bash
# Note: you can use npm start to run server.js with the --staging flag set
npm start -- --staging
```
@ -181,7 +185,8 @@ Listening on 0.0.0.0:443 for secure traffic
## Walkthrough
Read the [WALKTHROUGH](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/WALKTHROUGH.md)
For a more detail read the full
[WALKTHROUGH](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/WALKTHROUGH.md).
# Examples

12
WALKTHROUGH.md

@ -140,11 +140,12 @@ cat .greenlockrc
</details>
```bash
# show the global defaults
# show the global defaults with the CLI
npx greenlock defaults
```
```js
// show the global defaults with the API
var defaults = await greenlock.defaults();
```
@ -174,11 +175,12 @@ var defaults = await greenlock.defaults();
</details>
```bash
# show per-site configs
# show per-site configs with the CLI
npx greenlock config --subject example.com
```
```js
// show a site config with the API
greenlock.sites.get({ subject: "example.com" });
```
@ -213,11 +215,12 @@ You need to create a Let's Encrypt _subscriber account_, which can be done globa
All individuals, and most businesses, should set this globally:
```bash
# Set a global subscriber account
# Set a global subscriber account with the CLI
npx greenlock defaults --subscriber-email 'mycompany@example.com' --agree-to-terms true
```
```js
// set a global subscriber account with the API
greenlock.manager.defaults({
subscriberEmail: "mycompany@example.com",
agreeToTerms: true
@ -230,11 +233,12 @@ A Let's Encrypt SSL certificate has a "Subject" (Primary Domain) and up to 100 "
(of which the first _must_ be the subject).
```bash
# Add a certificate with specific domains
# Add a certificate with specific domains with the CLI
npx greenlock add --subject example.com --altnames example.com,www.example.com
```
```js
// Add a certificate with specific domains with the API
greenlock.sites.add({
subject: "example.com",
altnames: ["example.com"]

16
package-lock.json

@ -1,6 +1,6 @@
{
"name": "@root/greenlock-express",
"version": "4.0.1",
"version": "4.0.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -13,9 +13,9 @@
}
},
"@root/acme": {
"version": "3.0.8",
"resolved": "https://registry.npmjs.org/@root/acme/-/acme-3.0.8.tgz",
"integrity": "sha512-VmBvLvWdCDkolkanI9Dzm1ouSWPaAa2eCCwcDZcVQbWoNiUIOqbbd57fcMA/gZxLyuJPStD2WXFuEuSMPDxcww==",
"version": "3.0.9",
"resolved": "https://registry.npmjs.org/@root/acme/-/acme-3.0.9.tgz",
"integrity": "sha512-/FgJF6RUrkqNpLmxqjktHaWMsLOwma6D+e4EBoxKtTjTAI+dBqW8Z8cH38feUsiIBR5LimPeYmBo/oqU3oMkKQ==",
"requires": {
"@root/encoding": "^1.0.1",
"@root/keypairs": "^0.9.0",
@ -48,12 +48,12 @@
"integrity": "sha512-OaEub02ufoU038gy6bsNHQOjIn8nUjGiLcaRmJ40IUykneJkIW5fxDqKxQx48cszuNflYldsJLPPXCrGfHs8yQ=="
},
"@root/greenlock": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@root/greenlock/-/greenlock-4.0.2.tgz",
"integrity": "sha512-vurGBFlullzHM3STzQq00jWGCwvCYhpzusZZU69/80o4GPHB9OnUuxe/JlcokRZcCq+HqiVUeUJIBzPG086VWA==",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/@root/greenlock/-/greenlock-4.0.3.tgz",
"integrity": "sha512-ocXz91v9LW3Y1OnEpZ3ExfW07CfxtdYfetsYaSXihMWWWOvy+tqWdn2lPIpEYrW9KoCmGj+ooqp44K0d+ZtsAg==",
"requires": {
"@greenlock/manager": "^3.1.0",
"@root/acme": "^3.0.8",
"@root/acme": "^3.0.9",
"@root/csr": "^0.8.1",
"@root/keypairs": "^0.9.0",
"@root/mkdirp": "^1.0.0",

4
package.json

@ -1,6 +1,6 @@
{
"name": "@root/greenlock-express",
"version": "4.0.1",
"version": "4.0.2",
"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",
@ -17,7 +17,7 @@
"example": "examples"
},
"dependencies": {
"@root/greenlock": "^4.0.2",
"@root/greenlock": "^4.0.3",
"redirect-https": "^1.1.5"
},
"trulyOptionalDependencies": {

Loading…
Cancel
Save