Skip to content

Commit

Permalink
Fix environment variable handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aral committed Apr 7, 2020
1 parent 1c38ea2 commit 22af6d8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Nothing yet.

## [4.0.0] - 2020-04-07

### Changed

- Breaking change: default environment variables are no longer customised. You must pass in custom variables manually.

### Fixed

- Environment variables set in the outer process will now correctly apply to the Pebble server.

## [3.0.3] - 2020-04-07

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ await Pebble.ready()

- `env`: Optional object with additional environment variables to set for the Pebble process.

By default, the Pebble process will be run with the following settings, which are optimised for frequently run unit tests:
For frequently run unit tests, pass the following environment variables for fastest test run time. You may want to include less frequently-run test tasks without these settings for a more robust test harness.

- `PEBBLE_VA_NOSLEEP=1`
- `PEBBLE_WFE_NONCEREJECT=0`
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ class Pebble {
* Promises to spawn a Pebble process and resolve the promise when the server is ready for use.
*
* @static
* @args {[String[]]|String} Optional space-delimited list or array of arguments to pass to Pebble process.
* @env {Object={ PEBBLE_VA_NOSLEEP: 1, PEBBLE_WFE_NONCEREJECT: 0 }} Optional environment variables to set for Pebble process.
* @param args {[String[]|String]=[]} Optional space-delimited list or array of arguments to pass to Pebble process.
* @param env {[Object={}]} Optional environment variables to set for Pebble process.
* @returns {Promise<ChildProcess>} Promise to return spawned child process.
*/
static async ready (args = [], env = { PEBBLE_VA_NOSLEEP: 1, PEBBLE_WFE_NONCEREJECT: 0 }) {
static async ready (args = [], env = {}) {
if (this.#pebbleProcess !== null) {
// Existing process exists, return that.
return this.#pebbleProcess
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@small-tech/node-pebble",
"version": "3.0.3",
"version": "4.0.0",
"description": "A Node.js wrapper for Let’s Encrypt’s Pebble (“a small RFC 8555 ACME test server not suited for a production certificate authority”).",
"main": "index.js",
"os": [
Expand Down

0 comments on commit 22af6d8

Please sign in to comment.