mirror of
https://github.com/therootcompany/greenlock-express.js.git
synced 2024-11-16 17:28:59 +00:00
Compare commits
No commits in common. "cf93c77bd5c923af5a250e4f941e0e01b9b7c365" and "e6a008d498b009d2bf45443c05a67b1e644bf10b" have entirely different histories.
cf93c77bd5
...
e6a008d498
33
README.md
33
README.md
@ -1,4 +1,4 @@
|
||||
# [Greenlock Express v4](https://git.rootprojects.org/root/greenlock-express.js) is Let's Encrypt for Node
|
||||
# [Greenlock Express](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,11 +85,9 @@ Works with _any_ node http app, including
|
||||
- [x] cluster
|
||||
- [x] etc...
|
||||
|
||||
# v4 QuickStart
|
||||
# QuickStart: Serve Sites with Free SSL
|
||||
|
||||
Serving sites with Free SSL is as easy as 1, 2, 3... 4
|
||||
|
||||
### Overview
|
||||
Easy as 1, 2, 3... 4
|
||||
|
||||
1. Create a Project with Greenlock Express
|
||||
- `server.js`
|
||||
@ -101,8 +99,6 @@ Serving sites with Free SSL is as 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
|
||||
@ -110,14 +106,12 @@ 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'
|
||||
```
|
||||
|
||||
`server.js`:
|
||||
<details>
|
||||
<summary>server.js</summary>
|
||||
|
||||
```js
|
||||
"use strict";
|
||||
@ -139,7 +133,10 @@ require("greenlock-express")
|
||||
.serve(app);
|
||||
```
|
||||
|
||||
`app.js`:
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>app.js</summary>
|
||||
|
||||
```js
|
||||
"use strict";
|
||||
@ -153,14 +150,14 @@ var app = function(req, res) {
|
||||
module.exports = app;
|
||||
```
|
||||
|
||||
### 3. Add Sites
|
||||
</details>
|
||||
|
||||
```bash
|
||||
# Note: you can use the CLI to edit the config file
|
||||
npx greenlock add --subject example.com --altnames example.com
|
||||
```
|
||||
|
||||
`greenlock.d/config.json`:
|
||||
<details>
|
||||
<summary>greenlock.d/config.json</summary>
|
||||
|
||||
<!-- TODO update manager to write array rather than object -->
|
||||
|
||||
@ -168,10 +165,9 @@ npx greenlock add --subject example.com --altnames example.com
|
||||
{ "sites": [{ "subject": "example.com", "altnames": ["example.com"] }] }
|
||||
```
|
||||
|
||||
### 4. Hello, Encrypted World!
|
||||
</details>
|
||||
|
||||
```bash
|
||||
# Note: you can use npm start to run server.js with the --staging flag set
|
||||
npm start -- --staging
|
||||
```
|
||||
|
||||
@ -185,8 +181,7 @@ Listening on 0.0.0.0:443 for secure traffic
|
||||
|
||||
## Walkthrough
|
||||
|
||||
For a more detail read the full
|
||||
[WALKTHROUGH](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/WALKTHROUGH.md).
|
||||
Read the [WALKTHROUGH](https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/WALKTHROUGH.md)
|
||||
|
||||
# Examples
|
||||
|
||||
|
@ -140,12 +140,11 @@ cat .greenlockrc
|
||||
</details>
|
||||
|
||||
```bash
|
||||
# show the global defaults with the CLI
|
||||
# show the global defaults
|
||||
npx greenlock defaults
|
||||
```
|
||||
|
||||
```js
|
||||
// show the global defaults with the API
|
||||
var defaults = await greenlock.defaults();
|
||||
```
|
||||
|
||||
@ -175,12 +174,11 @@ var defaults = await greenlock.defaults();
|
||||
</details>
|
||||
|
||||
```bash
|
||||
# show per-site configs with the CLI
|
||||
# show per-site configs
|
||||
npx greenlock config --subject example.com
|
||||
```
|
||||
|
||||
```js
|
||||
// show a site config with the API
|
||||
greenlock.sites.get({ subject: "example.com" });
|
||||
```
|
||||
|
||||
@ -215,12 +213,11 @@ 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 with the CLI
|
||||
# Set a global subscriber account
|
||||
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
|
||||
@ -233,12 +230,11 @@ 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 with the CLI
|
||||
# Add a certificate with specific domains
|
||||
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
generated
16
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@root/greenlock-express",
|
||||
"version": "4.0.2",
|
||||
"version": "4.0.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@ -13,9 +13,9 @@
|
||||
}
|
||||
},
|
||||
"@root/acme": {
|
||||
"version": "3.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@root/acme/-/acme-3.0.9.tgz",
|
||||
"integrity": "sha512-/FgJF6RUrkqNpLmxqjktHaWMsLOwma6D+e4EBoxKtTjTAI+dBqW8Z8cH38feUsiIBR5LimPeYmBo/oqU3oMkKQ==",
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@root/acme/-/acme-3.0.8.tgz",
|
||||
"integrity": "sha512-VmBvLvWdCDkolkanI9Dzm1ouSWPaAa2eCCwcDZcVQbWoNiUIOqbbd57fcMA/gZxLyuJPStD2WXFuEuSMPDxcww==",
|
||||
"requires": {
|
||||
"@root/encoding": "^1.0.1",
|
||||
"@root/keypairs": "^0.9.0",
|
||||
@ -48,12 +48,12 @@
|
||||
"integrity": "sha512-OaEub02ufoU038gy6bsNHQOjIn8nUjGiLcaRmJ40IUykneJkIW5fxDqKxQx48cszuNflYldsJLPPXCrGfHs8yQ=="
|
||||
},
|
||||
"@root/greenlock": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@root/greenlock/-/greenlock-4.0.3.tgz",
|
||||
"integrity": "sha512-ocXz91v9LW3Y1OnEpZ3ExfW07CfxtdYfetsYaSXihMWWWOvy+tqWdn2lPIpEYrW9KoCmGj+ooqp44K0d+ZtsAg==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@root/greenlock/-/greenlock-4.0.2.tgz",
|
||||
"integrity": "sha512-vurGBFlullzHM3STzQq00jWGCwvCYhpzusZZU69/80o4GPHB9OnUuxe/JlcokRZcCq+HqiVUeUJIBzPG086VWA==",
|
||||
"requires": {
|
||||
"@greenlock/manager": "^3.1.0",
|
||||
"@root/acme": "^3.0.9",
|
||||
"@root/acme": "^3.0.8",
|
||||
"@root/csr": "^0.8.1",
|
||||
"@root/keypairs": "^0.9.0",
|
||||
"@root/mkdirp": "^1.0.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@root/greenlock-express",
|
||||
"version": "4.0.2",
|
||||
"version": "4.0.1",
|
||||
"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.3",
|
||||
"@root/greenlock": "^4.0.2",
|
||||
"redirect-https": "^1.1.5"
|
||||
},
|
||||
"trulyOptionalDependencies": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user