diff --git a/core/bbs.js b/core/bbs.js index 0cc83794..d8fae297 100644 --- a/core/bbs.js +++ b/core/bbs.js @@ -12,6 +12,7 @@ var paths = require('path'); var async = require('async'); var util = require('util'); var _ = require('lodash'); +var assert = require('assert'); exports.bbsMain = bbsMain; @@ -179,6 +180,9 @@ function startListening() { return; } + // servers require 'firstMenu' + assert(module.runtime.config.firstMenu, 'Server missing \'firstMenu\' member!'); + var moduleInst = new module.getModule(); var server = moduleInst.createServer(); @@ -204,7 +208,7 @@ function startListening() { // Go to module -- use default error handler prepareClient(client, function onPrepared() { - require('./connect.js').connectEntry(client); + require('./connect.js').connectEntry(client, module.runtime.config.firstMenu); }); }); diff --git a/core/config.js b/core/config.js index c9d7e96c..c2e6b033 100644 --- a/core/config.js +++ b/core/config.js @@ -65,8 +65,6 @@ function getDefaultConfig() { loginAttempts : 3, }, - firstMenu : 'connected', - preLoginTheme : '*', users : { @@ -124,12 +122,14 @@ function getDefaultConfig() { telnet : { port : 8888, enabled : true, + firstMenu : 'telnetConnected', }, ssh : { port : 8889, enabled : true, rsaPrivateKey : paths.join(__dirname, './../misc/default_key.rsa'), dsaPrivateKey : paths.join(__dirname, './../misc/default_key.dsa'), + firstMenu : 'sshConnected', } }, diff --git a/core/connect.js b/core/connect.js index 47afeb33..98a93d26 100644 --- a/core/connect.js +++ b/core/connect.js @@ -88,7 +88,7 @@ function displayBanner(term) { '|00'); } -function connectEntry(client) { +function connectEntry(client, nextMenu) { var term = client.term; /* @@ -143,7 +143,7 @@ function connectEntry(client) { displayBanner(term); setTimeout(function onTimeout() { - client.gotoMenuModule( { name : Config.firstMenu } ); + client.gotoMenuModule( { name : nextMenu } ); }, 500); }); } diff --git a/mods/menu.hjson b/mods/menu.hjson index f9e7b840..63e35c1a 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -51,12 +51,23 @@ } */ menus: { - connected: { - art: CONNECT - next: matrix - options: { - nextTimeout: 1500 - } + // + // Send telnet connections to matrix where users can login, apply, etc. + // + telnetConnected: { + art: CONNECT + next: matrix + options: { nextTimeout: 1500 } + } + + // + // SSH connections are pre-authenticated via the SSH server itself. + // Jump directly to the login sequence + // + sshConnected: { + art: CONNECT + next: fullLoginSequenceLoginArt + options: { nextTimeout: 1500 } } matrix: {