From 0a3a62edf3c131769683fc390540aaa934c1e978 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 30 Aug 2016 21:31:24 -0600 Subject: [PATCH 1/3] * Added ability to pass a "menu result" from a menu when calling prev()/prevMenu() * Ability to fully quit newscan with X key using new menu result functionality --- core/menu_module.js | 6 +++++- core/menu_stack.js | 10 +++++++--- core/menu_util.js | 9 +++++---- core/new_scan.js | 8 ++++++++ mods/msg_list.js | 11 ++++++++++- 5 files changed, 35 insertions(+), 9 deletions(-) diff --git a/core/menu_module.js b/core/menu_module.js index f8e23113..5477e6d3 100644 --- a/core/menu_module.js +++ b/core/menu_module.js @@ -317,4 +317,8 @@ MenuModule.prototype.standardMCIReadyHandler = function(mciData, cb) { }; MenuModule.prototype.finishedLoading = function() { -}; \ No newline at end of file +}; + +MenuModule.prototype.getMenuResult = function() { + // nothing in base +}; diff --git a/core/menu_stack.js b/core/menu_stack.js index 0dcdf4d8..98a171b9 100644 --- a/core/menu_stack.js +++ b/core/menu_stack.js @@ -73,6 +73,8 @@ module.exports = class MenuStack { } prev(cb) { + const menuResult = this.top().instance.getMenuResult(); + // :TODO: leave() should really take a cb... this.pop().instance.leave(); // leave & remove current @@ -80,8 +82,9 @@ module.exports = class MenuStack { if(previousModuleInfo) { const opts = { - extraArgs : previousModuleInfo.extraArgs, - savedState : previousModuleInfo.savedState + extraArgs : previousModuleInfo.extraArgs, + savedState : previousModuleInfo.savedState, + lastMenuResult : menuResult, }; return this.goto(previousModuleInfo.name, opts, cb); @@ -112,7 +115,8 @@ module.exports = class MenuStack { }; if(_.isObject(options)) { - loadOpts.extraArgs = options.extraArgs; + loadOpts.extraArgs = options.extraArgs; + loadOpts.lastMenuResult = options.lastMenuResult; } loadMenu(loadOpts, (err, modInst) => { diff --git a/core/menu_util.js b/core/menu_util.js index a532899a..bc439a9b 100644 --- a/core/menu_util.js +++ b/core/menu_util.js @@ -90,10 +90,11 @@ function loadMenu(options, cb) { try { const moduleInstance = new modData.mod.getModule({ - menuName : options.name, - menuConfig : modData.config, - extraArgs : options.extraArgs, - client : options.client, + menuName : options.name, + menuConfig : modData.config, + extraArgs : options.extraArgs, + client : options.client, + lastMenuResult : options.lastMenuResult, }); return callback(null, moduleInstance); } catch(e) { diff --git a/core/new_scan.js b/core/new_scan.js index 09985e1f..fe8405af 100644 --- a/core/new_scan.js +++ b/core/new_scan.js @@ -37,6 +37,8 @@ function NewScanModule(options) { var self = this; var config = this.menuConfig.config; + this.newScanFullExit = _.has(options, 'lastMenuResult.fullExit') ? options.lastMenuResult.fullExit : false; + this.currentStep = 'messageConferences'; this.currentScanAux = {}; @@ -191,6 +193,12 @@ NewScanModule.prototype.restoreSavedState = function(savedState) { NewScanModule.prototype.mciReady = function(mciData, cb) { + if(this.newScanFullExit) { + // user has canceled the entire scan @ message list view + return cb(null); + } + + var self = this; var vc = self.viewControllers.allViews = new ViewController( { client : self.client } ); diff --git a/mods/msg_list.js b/mods/msg_list.js index 924f0d92..e397c52c 100644 --- a/mods/msg_list.js +++ b/mods/msg_list.js @@ -103,6 +103,11 @@ function MessageListModule(options) { } else { return cb(null); } + }, + + fullExit : function(formData, extraArgs, cb) { + self.menuResult = { fullExit : true }; + return self.prevMenu(cb); } }; @@ -249,4 +254,8 @@ MessageListModule.prototype.restoreSavedState = function(savedState) { if(savedState) { this.initialFocusIndex = savedState.initialFocusIndex; } -}; \ No newline at end of file +}; + +MessageListModule.prototype.getMenuResult = function() { + return this.menuResult; +}; From 6934f0d6aed8d55ef9939907688871a6c8e9b7d9 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 30 Aug 2016 21:32:57 -0600 Subject: [PATCH 2/3] Add X key to exit newscan --- mods/menu.hjson | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/menu.hjson b/mods/menu.hjson index 2bcf4810..d3c1f3f5 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -677,6 +677,10 @@ keys: [ "escape", "q", "shift + q" ] action: @systemMethod:prevMenu } + { + keys: [ "x", "shift + x" ] + action: @method:fullExit + } ] } } From 5112506e14453c247618d4cf021fd0d00b19ec55 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 30 Aug 2016 21:54:14 -0600 Subject: [PATCH 3/3] Documentation updates --- README.md | 12 ++++++++---- docs/index.md | 34 ++++++++++++++++++++++------------ 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 70ab9c9b..353c6a54 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ENiGMA½ is a modern BBS software with a nostalgic flair! ## Features Available Now - * Multi platform: Anywhere Node.js runs likely works (tested under Linux and OS X) + * Multi platform: Anywhere Node.js runs likely works (known to work under Linux, FreeBSD, OpenBSD, OS X and Windows) * Multi node support * **Highly** customizable via [HJSON](http://hjson.org/) based configuration, menus, and themes in addition to JavaScript based mods * MCI support for lightbars, toggles, input areas, and so on plus many other other bells and whistles @@ -17,7 +17,7 @@ ENiGMA½ is a modern BBS software with a nostalgic flair! * Pipe codes (ala Renegade) * [SQLite](http://sqlite.org/) storage of users and message areas * Strong [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2) backed password encryption - * Door support including common dropfile formats and legacy DOS doors (See [Doors](docs/doors.md)) + * Door support including common dropfile formats and legacy DOS doors, [BBSLink](http://bbslink.net/), and [DoorParty](http://forums.throwbackbbs.com/)! (See [Doors](docs/doors.md)) * [Bunyan](https://github.com/trentm/node-bunyan) logging * FidoNet Type Network (FTN) + BinkleyTerm Style Outbound (BSO) message import/export @@ -52,11 +52,15 @@ ENiGMA has been tested with many terminals. However, the following are suggested ## Boards * WQH: :skull: Xibalba :skull: (**telnet://xibalba.l33t.codes:44510**) * Support board: ☠ BLACK ƒlag ☠ (**telnet://blackflag.acid.org:2425**) -* HappyLand (**telnet://andrew.homeunix.org:2023**) +* [force9](http://bbs.force9.org/): (**telnet://bbs.force9.org**) ## Installation -Please see the [Quickstart](docs/index.md#quickstart) +``` +curl -o- https://raw.githubusercontent.com/NuSkooler/enigma-bbs/master/misc/install.sh | bash +``` +
+(See the [Quickstart](docs/index.md#quickstart) for more information) ## Special Thanks * [M. Brutman](http://www.brutman.com/), author of [mTCP](http://www.brutman.com/mTCP/mTCP.html) (Interwebs for DOS!) diff --git a/docs/index.md b/docs/index.md index 947ffe02..52b2d089 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,15 +4,25 @@ ENiGMA½ is a modern from scratch BBS package written in Node.js. # Quickstart TL;DR? This should get you started... -## Prerequisites +## The Easy Way +Under most Linux/UNIX like environments (Linux, BSD, OS X, ...) new users can simply execute the `install.sh` script to get everything up and running. Simply cut + paste the following into your terminal: + +``` +curl -o- https://raw.githubusercontent.com/NuSkooler/enigma-bbs/master/misc/install.sh | bash +``` + +## The Manual Way +For Windows environments or if you simply like to do things manually, read on... + +### Prerequisites * [Node.js](https://nodejs.org/) version **v4.2.x or higher** * :information_source: It is suggested to use [nvm](https://github.com/creationix/nvm) to manage your Node/io.js installs -* **Windows users will need additional dependencies installed** for the `npm install` step in order to compile native binaries: - * A recent copy of Visual Studio ([Visual Studio Express](https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx) editions OK). Note that you **should only need Visual C++**. - * [Python](https://www.python.org/downloads/) 2.7.x +* [Python](https://www.python.org/downloads/) 2.7.x +* A compiler such as Clang or GCC for Linux/UNIX systems or a recent copy of Visual Studio ([Visual Studio Express](https://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx) editions OK) for Windows users. Note that you **should only need the Visual C++ component**. + -## New to Node -If you're new to Node.js and/or do not care about Node itself and just want to get ENiGMA½ running these steps should get you going on most \*nix type enviornments: +### New to Node +If you're new to Node.js and/or do not care about Node itself and just want to get ENiGMA½ running these steps should get you going on most \*nix type enviornments (Please consider the `install.sh` approach unless you really want to manually install!): ```bash curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash @@ -23,12 +33,12 @@ nvm use 4.4.0 If the above completed without errors, you should now have `nvm`, `node`, and `npm` installed and in your environment. -## Clone +### Clone ```bash git clone https://github.com/NuSkooler/enigma-bbs.git ``` -## Install Node Modules +### Install Node Modules ```bash cd enigma-bbs npm install @@ -40,17 +50,17 @@ To utilize the SSH server, a SSH Private Key will need generated. This step can openssl genrsa -des3 -out ./misc/ssh_private_key.pem 2048 ``` -## Create a Minimal Config +### Create a Minimal Config The main system configuration is handled via `~/.config/enigma-bbs/config.hjson`. This is a [HJSON](http://hjson.org/) file (compiliant JSON is also OK). See [Configuration](config.md) for more information. -### Via oputil.js +#### Via oputil.js `oputil.js` can be utilized to generate your **initial** configuration. **This is the recommended way for all new users**: ./oputil.js config --new You wil be asked a series of basic questions. -### Example Starting Configuration +#### Example Starting Configuration Below is an _example_ configuration. It is recommended that you at least **start with a generated configuration using oputil.js described above**. ```hjson @@ -96,7 +106,7 @@ Logs are produced by Bunyan which outputs each entry as a JSON object. To tail l ENiGMA½ does not produce much to standard out. See below for tailing the log file to see what's going on. -### Points of Interest +## Points of Interest * Default ports are 8888 (Telnet) and 8889 (SSH) * Note that on *nix systems port such as telnet/23 are privileged (e.g. require root). See [this SO article](http://stackoverflow.com/questions/16573668/best-practices-when-running-node-js-with-port-80-ubuntu-linode) for some tips on using these ports on your system if desired. * **The first user you create via applying is the SysOp** (aka root)