Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aral committed Mar 24, 2021
1 parent 8853231 commit 9116ee3
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 60 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.0.7] - 2021-03-24

Once more, with documentation this time!

### Changed

- Updated documentation to reflect how the module actually works now.

## [7.0.6] - 2021-03-24

The hybrid approach.
Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@ Automatically provisions and installs locally-trusted TLS certificates for Node.

## How it works

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.
At npm package installation time, Auto Encrypt Localhost installs mkcert.

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).
At runtime, Auto Encrypt Localhost uses mkcert to create a local certificate authority and add it to the various trust stores. It then uses it to create locally-trusted TLS certificates that are automatically used by your server.

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).

## System requirements

Tested and supported on:

- Linux (tested with elementary OS Hera)
- Linux (tested with elementary OS 5.x/Hera)
- macOS (tested on Big Sur)
- Windows 10 (tested in Windows Terminal with PowerShell)
- Windows 10 (tested with Windows Terminal and PowerShell)

(WSL is not supported for certificates at localhost unless you’re running your browser under WSL also).

Expand All @@ -24,11 +26,7 @@ Tested and supported on:
npm i @small-tech/auto-encrypt-localhost
```

Note that during installation, Auto Encrypt Localhost will create your local certificate authority and install it in the system root store and generate locally-trusted certificates. These actions require elevated privileges. Since [npm does not handle sudo prompts correctly in lifecycle scripts](https://github.com/npm/cli/issues/2887), you will see a graphical sudo prompt pop up to ask you for your adminstrator password. Once you’ve provided it, installation will proceed as normal.

![Screenshot of graphical sudo prompt “Authentication required: Authentication is needed to run /bin/bash as the super user”](https://small-tech.org/images/graphical-sudo-prompt.png)

On Windows, you will also be prompted separately to allow the installation of the certificates.
Note that during installation, Auto Encrypt Localhost will download and install the correct mkcert binary for your system.

## Usage

Expand Down Expand Up @@ -65,7 +63,9 @@ server.listen(443, () => {
})
```

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:
On first run, Auto Encrypt Localhost will use mkcert to create your local certificate authority and install it in the system root store and generate locally-trusted certificates. These actions require elevated privileges and you will be prompted for your password unless you have passwordless sudo set up for your system.

Once your server is up and running, you can reach it 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:

```js
Object.entries(os.networkInterfaces())
Expand Down Expand Up @@ -161,8 +161,6 @@ If you’re evaluating this for a “startup” or an enterprise, let us save yo

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).

__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.__

## Related projects

From lower-level to higher-level:
Expand Down
Loading

1 comment on commit 9116ee3

@Body87
Copy link

@Body87 Body87 commented on 9116ee3 May 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2

Please sign in to comment.