* Servers now define 'firstMenu'. This allows e.g. SSH to pre auth, while Telnet still gets the matrix

This commit is contained in:
Bryan Ashby 2015-10-22 10:36:08 -06:00
parent 12e7722ec9
commit 4a22ce0924
4 changed files with 26 additions and 11 deletions

View File

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

View File

@ -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',
}
},

View File

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

View File

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