Commit d1323835 authored by Aral Balkan's avatar Aral Balkan

Nodecert configuration directory now uses ~/.small-tech.org namespace

Also, the tests now work properly.
parent 81f985f5
......@@ -9,6 +9,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Nothing yet.
## [3.1.2] - 2019-11-25
### Changed
- The configuration folder is now under ~/.small-tech.org namespace.
### Fixed
- The tests now actually check that local certificates are created at the custom directory instead of running the first set of tests again.
## [3.1.1] - 2019-11-25
### Added
......
......@@ -16,9 +16,9 @@ It should __just work™__ 🤞
I’d appreciate it if you can [help me test it](#help-wanted) on untested platforms and package managers 🤗
Want a local development server that uses nodecert? See [https-server](https://source.ind.ie/hypha/tools/https-server).
Nodecert is used in [Site.js](https://sitejs.org), a personal web tool for human beings (not startups or enterprises) that lets you develop, test, and deploy your secure static or dynamic personal web site with zero configuration.
For more details on how it all works, please [see the mkcert README](https://github.com/FiloSottile/mkcert/blob/master/README.md).
For more details on how nodecert works behind the scenes, please [see the mkcert README](https://github.com/FiloSottile/mkcert/blob/master/README.md).
## Installation
......@@ -34,7 +34,7 @@ npm i -g @ind.ie/nodecert
nodecert
```
Your certificates will be created in the _~/.nodecert_ directory.
Your certificates will be created in the _~/.small-tech.org/nodecert_ directory.
## Caveats
......@@ -48,7 +48,7 @@ Locally-trusted certificates do not work under Firefox. Please use Edge or Chrom
require('@ind.ie/nodecert')()
```
__As of version 3.1.1,__ you can now pass a custom directory for nodecert to use instead of the default (`~/.nodecert`) and the created certificates will be stored there.
__As of version 3.1.1,__ you can now pass a custom directory for nodecert to use instead of the default (`~/.small-tech.org/nodecert`) and the created certificates will be stored there.
For example:
......
......@@ -12,7 +12,7 @@ const syswidecas = require('syswide-cas')
let nodecertDir
module.exports = function (_nodecertDir = path.join(homeDir, '.nodecert')) {
module.exports = function (_nodecertDir = path.join(homeDir, '.small-tech.org', 'nodecert')) {
nodecertDir = _nodecertDir
......
{
"name": "@ind.ie/nodecert",
"version": "3.1.1",
"version": "3.1.2",
"description": "Automatically provision and use locally-trusted TLS certificates in Node.js using mkcert.",
"main": "index.js",
"bin": "bin/nodecert.js",
......
......@@ -22,7 +22,7 @@ function rmRFSync (dirPath) {
test('certificate creation', t => {
t.plan(10)
let nodecertDirectory = path.join(os.homedir(), '.nodecert')
let nodecertDirectory = path.join(os.homedir(), '.small-tech.org', 'nodecert')
if (fs.existsSync(nodecertDirectory)) {
// Clear the .nodecert directory if it already exists.
rmRFSync(nodecertDirectory)
......@@ -37,7 +37,17 @@ test('certificate creation', t => {
t.ok(fs.existsSync(path.join(nodecertDirectory, 'localhost.pem')), 'Local certificate exists')
t.ok(fs.existsSync(path.join(nodecertDirectory, 'localhost-key.pem')), 'Local certificate private key exists')
nodecert(path.join(os.homedir(), '.nodecert-test'))
//
// Custom nodecert directory.
//
nodecertDirectory = path.join(os.homedir(), '.small-tech.org', 'nodecert-custom-directory-test')
if (fs.existsSync(nodecertDirectory)) {
// Clear the .nodecert directory if it already exists.
rmRFSync(nodecertDirectory)
}
nodecert(nodecertDirectory)
t.ok(fs.existsSync(path.join(nodecertDirectory)), '(Custom path) Main nodecert directory exists')
t.ok(fs.existsSync(path.join(nodecertDirectory, 'rootCA.pem')), '(Custom path) Local certificate authority exists')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment