You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [7.0.0] - 2021-03-06
9
+
10
+
This version is optimised for use on development machines via npm install. It carries out the mkcert binary installation in a postinstall script. In version 6.x and earlier, all binaries for all platforms were bundled as the library also supported use from a binary install (see [Site.js](https://sitejs.org)). The 6.x branch will still be updated with new mkcert versions but the 7.x and later versions will be used in [Place](https://github.com/small-tech/place).
11
+
12
+
### Changed
13
+
14
+
- Uses ECMAScript Modules (ESM; es6 modules)
15
+
-__Breaking change:__ mkcert binary is now downloaded during installation and the root certificate authority and TLS certificates are created at this time also.
16
+
-__Breaking change:__ The settings path is no longer configurable and is shared by all installations of this package. This means whenever you install this package, it will update to the latest version of mkcert and recreate the root certificate authorities and local certificates and these will be used by all instances of Auto Encrypt Localhost on your dev machine (and this is most likely the behaviour you want).
17
+
-__Breaking change:__ Removed command-line interface as it is no longer nececessary. Your local certificate authority and TLS certificates are ready to be used once your npm install is complete.
Copy file name to clipboardExpand all lines: README.md
+61-59Lines changed: 61 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,34 +4,24 @@ Automatically provisions and installs locally-trusted TLS certificates for Node.
4
4
5
5
## How it works
6
6
7
-
Before creating your HTTPS server, uses mkcert to create a local certificate authority, adds it to the various trust stores, and uses it to create locally-trusted TLS certificates that are installed in your server.
7
+
At installation time, Auto Encrypt Localhost uses mkcert to create a local certificate authority, adds it to the various trust stores, and uses it to create locally-trusted TLS certificates that are installed in your server.
8
8
9
-
You can reach your server via the local loopback addresses (localhost, 127.0.0.1) on the device itself and also from other devices on the local area network by using your device’s external IPv4 address.
9
+
At runtime, you can reach your server via the local loopback addresses (localhost, 127.0.0.1) on the device itself and also from other devices on the local area network by using your device’s external IPv4 address(es).
(On Linux, ports 80 and 443 require special privileges. Please see [A note on Linux and the security farce that is “privileged ports”](#a-note-on-linux-and-the-security-farce-that-is-priviliged-ports). If you just need a Node web server that handles all that and more for you – or to see how to implement privilege escalation seamlessly in your own servers – see [Site.js](https://sitejs.org)).
import AutoEncryptLocalhost from '@small-tech/auto-encrypt-localhost'
52
42
53
43
const server = AutoEncryptLocalhost.https.createServer((request, response) => {
54
44
response.end('Hello, world!')
55
45
})
56
46
57
-
server.listen(() => {
47
+
server.listen(443, () => {
58
48
console.log('Web server is running at https://localhost')
59
49
})
60
50
```
61
51
62
-
You can now reach your server via https://localhost, https://127.0.0.1, and via its external IPv4 address on your local area network. To find out what that is, you can run the following in the Node interpreter:
52
+
You can now reach your server via https://localhost, https://127.0.0.1, and via its external IPv4 address(es) on your local area network. To find the list of IP addresses that your local server is reachable from, you can run the following code in the Node interpreter:
If you just want to use the TLS certificates generated at installation time without using the Auto Encrypt Localhost library itself at runtime, you should install Auto Encrypt Localhost into your `dev-dependencies`. Post install, you can find your certificates in the _~/.small-tech.org/auto-encrypt-localhost_ folder.
65
+
66
+
Here’s a somewhat equivalent example to the one above but using Node’s regular `https`module instead of Auto Encrypt Localhost at runtime:
const server = https.createServer(options, (request, response) => {
84
+
response.end('Hello, world!')
85
+
})
86
+
87
+
server.listen(443, () => {
88
+
console.log('Web server is running at https://localhost')
89
+
})
90
+
```
91
+
92
+
_Note that if you don’t use Auto Encrypt Localhost at runtime, you won’t get some of the benefits that it provides, like automatically adding the certificate authority to Node’s trust store (for hitting your server using Node.js without certificate errors, the `/.ca` convenience route, and HTTP to HTTPS forwarding, etc.)_
93
+
94
+
### On Linux
95
+
96
+
To access your server on port 443, make sure you’ve disabled privileged ports:
(On Linux, ports 80 and 443 require special privileges. Please see [A note on Linux and the security farce that is “privileged ports”](#a-note-on-linux-and-the-security-farce-that-is-priviliged-ports). If you just need a Node web server that handles all that and more for you – or to see how to implement privilege escalation seamlessly in your own servers – see [Site.js](https://sitejs.org)).
103
+
72
104
### Multiple servers
73
105
74
106
You are not limited to running your server on port 443. You can listen on any port you like and you can have multiple servers with the following caveat: the HTTP server that redirects HTTP calls to HTTPS and serves your local root certificate authority public key (see below) will only be created for the first server and then only if port 80 is free.
@@ -91,29 +123,6 @@ The browser will download the local root certificate authority’s public key an
91
123
92
124
You can also transfer your key manually. You can find the key at `~/.small-tech/auto-encrypt-localhost/rootCA.pem` after you’ve created at least one server. For more details on transferring your key to other devices, please refer to [the relevant section in the mkcert documentation](https://github.com/FiloSottile/mkcert#mobile-devices).
93
125
94
-
95
-
## Configuration
96
-
97
-
You can specify a custom settings path for your local certificate authority and certificate data to be stored in by adding the Auto Encrypt Localhost-specific `settingsPath` option to the options object you pass to the Node `https` server. If not specified, the default settings path (_~/.small-tech.org/auto-encrypt-localhost/_) is used.
// Regular HTTPS server and TLS server options, if any, go here.
106
-
107
-
// Optional Auto Encrypt options:
108
-
settingsPath: '/custom/settings/path'
109
-
}
110
-
111
-
// Pass the options object to https.createServer()
112
-
const server = AutoEncryptLocalhost.https.createServer(options, listener)
113
-
114
-
// …
115
-
```
116
-
117
126
## Developer documentation
118
127
119
128
If you want to help improve Auto Encrypt Localhost or better understand how it is structured and operates, please see the [developer documentation](developer-documentation.md).
@@ -130,51 +139,44 @@ This is [small technology](https://small-tech.org/about/#small-technology).
130
139
131
140
If you’re evaluating this for a “startup” or an enterprise, let us save you some time: this is not the right tool for you. This tool is for individual developers to build personal web sites and apps for themselves and for others in a non-colonial manner that respects the human rights of the people who use them.
132
141
133
-
## Command-line interface
134
-
135
-
### Install
136
-
137
-
```sh
138
-
npm i -g @small-tech/auto-encrypt-localhost
139
-
```
140
-
141
-
### Use
142
-
143
-
```sh
144
-
auto-encrypt-localhost
145
-
```
146
-
Your certificates will be created in the _~/.small-tech.org/auto-encrypt-localhost_ directory.
147
-
148
142
## Caveats
149
143
150
144
### Windows
151
145
152
146
Locally-trusted certificates do not work under Firefox. Please use Edge or Chrome on this platform. This is [a mkcert limitation](https://github.com/FiloSottile/mkcert#supported-root-stores).
153
147
148
+
__Version 7.x is currently not tested under Windows.__ It may not be able to set the executable bit on the binary download if that’s necessary. __This notice will be removed once it’s been tested and confirmed to be working.__
Adds automatic provisioning and renewal of [Let’s Encrypt](https://letsencrypt.org) TLS certificates with [OCSP Stapling](https://letsencrypt.org/docs/integration-guide/#implement-ocsp-stapling) to [Node.js](https://nodejs.org) [https](https://nodejs.org/dist/latest-v12.x/docs/api/https.html) servers (including [Express.js](https://expressjs.com/), etc.)
A drop-in replacement for the [standard Node.js HTTPS module](https://nodejs.org/dist/latest-v12.x/docs/api/https.html) with automatic development-time (localhost) certificates via Auto Encrypt Localhost and automatic production certificates via Auto Encrypt.
A tool for developing, testing, and deploying a secure static or dynamic personal web site or app with zero configuration.
174
+
175
+
### Place (work-in-progress)
176
+
177
+
Small Web Protocol Reference Server.
176
178
177
-
A complete [small technology](https://small-tech.org/about/#small-technology) tool for developing, testing, and deploying a secure static or dynamic personal web site or app with zero configuration.
179
+
- Source: https://github.com/small-tech/place
178
180
179
181
## A note on Linux and the security farce that is “privileged ports”
180
182
@@ -207,7 +209,7 @@ We exist in part thanks to patronage by people like you. If you share [our visio
0 commit comments