From 44927fabcd1db6155ce7704fda3cb8d9f49be282 Mon Sep 17 00:00:00 2001 From: Tjatse Date: Mon, 12 Jan 2015 16:58:26 +0800 Subject: [PATCH] tidy help docs --- README.md | 3 +-- bin/pm2-gui | 8 +++++++- lib/mon.js | 1 - test/bash/config.sh | 6 ++++++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2dc9e42..0b9c43c 100644 --- a/README.md +++ b/README.md @@ -95,13 +95,12 @@ port = 8088 ``` - **refresh** The heartbeat duration of monitor (backend), `5000` by default. -- **manipulation** A value indicates whether the client has permission to restart/stop processes, `true` by default. - **pm2** Root directory of Unitech/PM2, `~/.pm2` by default. - **port** Port of web interface. - **password** The encrypted authentication code, if this config is set, users need to be authorized before accessing the index page, `password` could only be set by `pm2-gui set password [password]` ([authorization](#authorization)). ### File -You can quit set configurations by `pm2-gui start --config [file]`, the `[file]` must be an valid **ini** file, and can including all the above keys. +You can quick set configurations by `pm2-gui start --config [file]`, the `[file]` must be a valid **ini** file, and can include all the above keys. Example ```bash diff --git a/bin/pm2-gui b/bin/pm2-gui index bdcb3ea..b56f166 100755 --- a/bin/pm2-gui +++ b/bin/pm2-gui @@ -20,7 +20,13 @@ commander.on('--help', function(){ chalk.grey(' $ pm2-gui start\n') + '\n' + ' Start the web server, by specific port (8090):\n' + - chalk.grey(' $ pm2-gui start 8090\n') + chalk.grey(' $ pm2-gui start 8090\n') + + '\n' + + ' Start the web server, by specific configuration file (pm2-gui.ini):\n' + + chalk.grey(' $ pm2-gui start --config\n') + + '\n' + + ' Start the web server, by specific configuration file:\n' + + chalk.grey(' $ pm2-gui start --config my-config.ini\n') ); }); diff --git a/lib/mon.js b/lib/mon.js index 46e6ffc..f051ca2 100644 --- a/lib/mon.js +++ b/lib/mon.js @@ -87,7 +87,6 @@ Monitor.prototype._init = function(options){ this.config('pm2', this._resolveHome(this.config('pm2')) || this.options.pm2); this.config('refresh', this.config('refresh') || this.options.refresh); this.config('port', this.config('port') || this.options.port || 8088); - var debugable = this.config('debug'); this.config('debug', typeof debugable == 'undefined' ? (debugable = !!this.options.debug) : !!debugable); diff --git a/test/bash/config.sh b/test/bash/config.sh index 2866287..d17f112 100644 --- a/test/bash/config.sh +++ b/test/bash/config.sh @@ -5,6 +5,12 @@ source "${SRC}/include.sh" cd $fixtures +head "set config (Encrypt)(password)" +$pg set password "passw@rd" > /dev/null +val=$(config "password:" "password:\s*([^\s]+)" | grep -o "[^ ]\+\( \+[^ ]\+\)*") +[ "$val" = "ebc4c06b266b84263efafa47003244cc" ] || fail "expect the password to be encrypted, but current not" +success "the password should be encrypted" + head "set config (Number)(refresh)" $pg set refresh 4000 > /dev/null val=$(config "refresh:" "^[^0-9]*([0-9]+).*")