butlerx
5 years ago
4 changed files with 60 additions and 61 deletions
@ -1,93 +1,86 @@ |
|||
<a name="module_WeTTy"></a> |
|||
|
|||
## WeTTy |
|||
|
|||
Create WeTTY server |
|||
|
|||
* [WeTTy](#module_WeTTy) |
|||
* [~start](#module_WeTTy..start) ⇒ <code>Promise</code> |
|||
* ["connection"](#event_connection) |
|||
* ["spawn"](#event_spawn) |
|||
* ["exit"](#event_exit) |
|||
* ["disconnect"](#event_disconnect) |
|||
* ["server"](#event_server) |
|||
|
|||
<a name="module_WeTTy..start"></a> |
|||
- [WeTTy](#module_WeTTy) |
|||
- [start](#module_WeTTy..start) ⇒ `Promise` |
|||
- [connection](#event_connection) |
|||
- [spawn](#event_spawn) |
|||
- [exit](#event_exit) |
|||
- [disconnect](#event_disconnect) |
|||
- [server](#event_server) |
|||
|
|||
### WeTTy~start ⇒ <code>Promise</code> |
|||
### WeTTy.start ⇒ `Promise` |
|||
|
|||
Starts WeTTy Server |
|||
|
|||
**Kind**: inner property of [<code>WeTTy</code>](#module_WeTTy) |
|||
**Returns**: <code>Promise</code> - Promise resolves once server is running |
|||
|
|||
| Param | Type | Default | Description | |
|||
| ------------ | ------------------- | ------------------------------------- | --------------------------- | |
|||
| [ssh] | <code>Object</code> | | SSH settings | |
|||
| [ssh.user] | <code>string</code> | <code>"''"</code> | default user for ssh | |
|||
| [ssh.host] | <code>string</code> | <code>"localhost"</code> | machine to ssh too | |
|||
| [ssh.auth] | <code>string</code> | <code>"password"</code> | authtype to use | |
|||
| [ssh.port] | <code>number</code> | <code>22</code> | port to connect to over ssh | |
|||
| [serverPort] | <code>number</code> | <code>3000</code> | Port to run server on | |
|||
| [ssl] | <code>Object</code> | | SSL settings | |
|||
| [ssl.key] | <code>string</code> | | Path to ssl key | |
|||
| [ssl.cert] | <code>string</code> | | Path to ssl cert | |
|||
|
|||
<a name="event_connection"></a> |
|||
**Kind**: inner property of [`WeTTy`](#module_WeTTy) |
|||
**Returns**: `Promise` - Promise resolves once server is running |
|||
|
|||
| Param | Type | Default | Description | |
|||
| :------------------------ | --------- | ------------- | ---------------------------------------------------------------------------------------------------------------------- | |
|||
| [ssh] | `Object` | | SSH settings | |
|||
| [ssh.user] | `string` | `"''"` | default user for ssh | |
|||
| [ssh.host] | `string` | `"localhost"` | machine to ssh too | |
|||
| [ssh.auth] | `string` | `"password"` | authtype to use | |
|||
| [ssh.port] | `number` | `22` | port to connect to over ssh | |
|||
| [serverConf] | `Object` | | Server settings | |
|||
| [serverConf.base] | `Object` | `'/wetty/'` | Server settings | |
|||
| [serverConf.port] | `number` | `3000` | Port to run server on | |
|||
| [serverConf.host] | `string` | `'0.0.0.0'` | Host address for server | |
|||
| [serverConf.title] | `string` | `'WeTTy'` | Title of the server | |
|||
| [serverConf.bypasshelmet] | `boolean` | `false` | if helmet should be disabled on the sever | |
|||
| [command] | `string` | `"''"` | The command to execute. If running as root and no host specified this will be login if a host is specified will be ssh | |
|||
| [ssl] | `Object` | | SSL settings | |
|||
| [ssl.key] | `string` | | Path to ssl key | |
|||
| [ssl.cert] | `string` | | Path to ssl cert | |
|||
|
|||
### "connection" |
|||
|
|||
**Kind**: event emitted by [<code>WeTTy</code>](#module_WeTTy) |
|||
**Kind**: event emitted by [`WeTTy`](#module_WeTTy) |
|||
**Properties** |
|||
|
|||
| Name | Type | Description | |
|||
| ---- | ------------------- | --------------------------- | |
|||
| msg | <code>string</code> | Message for logs | |
|||
| date | <code>Date</code> | date and time of connection | |
|||
|
|||
<a name="event_spawn"></a> |
|||
| Name | Type | Description | |
|||
| ---- | -------- | --------------------------- | |
|||
| msg | `string` | Message for logs | |
|||
| date | `Date` | date and time of connection | |
|||
|
|||
### "spawn" |
|||
|
|||
Terminal process spawned |
|||
|
|||
**Kind**: event emitted by [<code>WeTTy</code>](#module_WeTTy) |
|||
**Kind**: event emitted by [`WeTTy`](#module_WeTTy) |
|||
**Properties** |
|||
|
|||
| Name | Type | Description | |
|||
| ------- | ------------------- | -------------------------------------- | |
|||
| msg | <code>string</code> | Message containing pid info and status | |
|||
| pid | <code>number</code> | Pid of the terminal | |
|||
| address | <code>string</code> | address of connecting user | |
|||
|
|||
<a name="event_exit"></a> |
|||
| Name | Type | Description | |
|||
| ------- | -------- | -------------------------------------- | |
|||
| msg | `string` | Message containing pid info and status | |
|||
| pid | `number` | Pid of the terminal | |
|||
| address | `string` | address of connecting user | |
|||
|
|||
### "exit" |
|||
|
|||
Terminal process exits |
|||
|
|||
**Kind**: event emitted by [<code>WeTTy</code>](#module_WeTTy) |
|||
**Kind**: event emitted by [`WeTTy`](#module_WeTTy) |
|||
**Properties** |
|||
|
|||
| Name | Type | Description | |
|||
| ---- | ------------------- | -------------------------------------- | |
|||
| code | <code>number</code> | the exit code | |
|||
| msg | <code>string</code> | Message containing pid info and status | |
|||
|
|||
<a name="event_disconnect"></a> |
|||
| Name | Type | Description | |
|||
| ---- | -------- | -------------------------------------- | |
|||
| code | `number` | the exit code | |
|||
| msg | `string` | Message containing pid info and status | |
|||
|
|||
### "disconnect" |
|||
|
|||
**Kind**: event emitted by [<code>WeTTy</code>](#module_WeTTy) |
|||
<a name="event_server"></a> |
|||
**Kind**: event emitted by [`WeTTy`](#module_WeTTy) |
|||
|
|||
### "server" |
|||
|
|||
**Kind**: event emitted by [<code>WeTTy</code>](#module_WeTTy) |
|||
**Kind**: event emitted by [`WeTTy`](#module_WeTTy) |
|||
**Properties** |
|||
|
|||
| Name | Type | Description | |
|||
| ---------- | ------------------- | ------------------------------- | |
|||
| msg | <code>string</code> | Message for logging | |
|||
| port | <code>number</code> | port sever is on | |
|||
| connection | <code>string</code> | connection type for web traffic | |
|||
| Name | Type | Description | |
|||
| ---------- | -------- | ------------------------------- | |
|||
| msg | `string` | Message for logging | |
|||
| port | `number` | port sever is on | |
|||
| connection | `string` | connection type for web traffic | |
|||
|
Loading…
Reference in new issue