tidy help docs

This commit is contained in:
Tjatse 2015-01-12 16:58:26 +08:00
parent 690f2491dc
commit 44927fabcd
4 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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')
);
});

View File

@ -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);

View File

@ -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]+).*")