@small-tech/https 5.1.1 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +5 -3
  2. package/index.js +3 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -66,6 +66,8 @@ server.listen(443, () => {
66
66
 
67
67
  Hit `https://localhost` and you should see your site with locally-trusted TLS certificates.
68
68
 
69
+ > 💡 As of version 5.2.0, you can also use the localhost aliases _place1.localhost_ - _place4.localhost_ when testing the peer-to-peer features of [Small Web](https://ar.al/2020/08/07/what-is-the-small-web/) apps.
70
+
69
71
  @small-tech/https uses [Auto Encrypt Localhost](https://codeberg.org/small-tech/auto-encrypt-localhost) to create a local Certificate Authority (cA) and add it to the various trust stores. It then uses that CA to create locally-trusted TLS certificates that are automatically used by your server.
70
72
 
71
73
  ### At hostname with automatically-provisioned Let’s Encrypt certificates.
@@ -94,7 +96,7 @@ You can find a version of this example in the `/example` folder. To download and
94
96
 
95
97
  ```sh
96
98
  # Clone this repository.
97
- git clone https://source.small-tech.org/site.js/lib/https.git
99
+ git clone https://codeberg.org/small-tech/https.git
98
100
 
99
101
  # Switch to the directory.
100
102
  cd https
@@ -130,7 +132,7 @@ Lower-level:
130
132
 
131
133
  ### Auto Encrypt
132
134
 
133
- - Source: https://github.com/small-tech/auto-encrypt
135
+ - Source: https://codeberg.org/small-tech/auto-encrypt
134
136
  - Package: [@small-tech/auto-encrypt](https://www.npmjs.com/package/@small-tech/auto-encrypt)
135
137
 
136
138
  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 Polka, Express.js, etc.)
@@ -147,7 +149,7 @@ Higher level:
147
149
  ### Site.js
148
150
 
149
151
  - Web site: https://sitejs.org
150
- - Source: https://github.com/small-tech/site.js
152
+ - Source: https://codeberg.org/site.js/app
151
153
 
152
154
  A tool for developing, testing, and deploying a secure static or dynamic personal web site or app with zero configuration.
153
155
 
package/index.js CHANGED
@@ -36,7 +36,9 @@ smallTechHttps.createServer = function (options, listener) {
36
36
  options = {}
37
37
  }
38
38
 
39
- const serverScope = options.domains == undefined || options.domains.includes('localhost') ? 'local' : 'global'
39
+ const localDomains = ['localhost', 'place1.localhost', 'place2.localhost', 'place3.localhost', 'place4.localhost']
40
+ const isLocal = options.domains == undefined || options.domains.some(domain => localDomains.includes(domain))
41
+ const serverScope = isLocal ? 'local' : 'global'
40
42
  const settingsPath = options.settingsPath ? path.join(path.resolve(options.settingsPath), serverScope) : path.join(DEFAULT_SETTINGS_PATH, serverScope)
41
43
  options.settingsPath = settingsPath
42
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@small-tech/https",
3
- "version": "5.1.1",
3
+ "version": "5.2.0",
4
4
  "description": "A drop-in standard Node.js HTTPS module replacement with both automatic development-time (localhost) certificates via Auto Encrypt Localhost and automatic production certificates via Auto Encrypt.",
5
5
  "main": "index.js",
6
6
  "files": [