* 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 async = require('async');
var util = require('util'); var util = require('util');
var _ = require('lodash'); var _ = require('lodash');
var assert = require('assert');
exports.bbsMain = bbsMain; exports.bbsMain = bbsMain;
@ -179,6 +180,9 @@ function startListening() {
return; return;
} }
// servers require 'firstMenu'
assert(module.runtime.config.firstMenu, 'Server missing \'firstMenu\' member!');
var moduleInst = new module.getModule(); var moduleInst = new module.getModule();
var server = moduleInst.createServer(); var server = moduleInst.createServer();
@ -204,7 +208,7 @@ function startListening() {
// Go to module -- use default error handler // Go to module -- use default error handler
prepareClient(client, function onPrepared() { 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, loginAttempts : 3,
}, },
firstMenu : 'connected',
preLoginTheme : '*', preLoginTheme : '*',
users : { users : {
@ -124,12 +122,14 @@ function getDefaultConfig() {
telnet : { telnet : {
port : 8888, port : 8888,
enabled : true, enabled : true,
firstMenu : 'telnetConnected',
}, },
ssh : { ssh : {
port : 8889, port : 8889,
enabled : true, enabled : true,
rsaPrivateKey : paths.join(__dirname, './../misc/default_key.rsa'), rsaPrivateKey : paths.join(__dirname, './../misc/default_key.rsa'),
dsaPrivateKey : paths.join(__dirname, './../misc/default_key.dsa'), dsaPrivateKey : paths.join(__dirname, './../misc/default_key.dsa'),
firstMenu : 'sshConnected',
} }
}, },

View File

@ -88,7 +88,7 @@ function displayBanner(term) {
'|00'); '|00');
} }
function connectEntry(client) { function connectEntry(client, nextMenu) {
var term = client.term; var term = client.term;
/* /*
@ -143,7 +143,7 @@ function connectEntry(client) {
displayBanner(term); displayBanner(term);
setTimeout(function onTimeout() { setTimeout(function onTimeout() {
client.gotoMenuModule( { name : Config.firstMenu } ); client.gotoMenuModule( { name : nextMenu } );
}, 500); }, 500);
}); });
} }

View File

@ -51,12 +51,23 @@
} }
*/ */
menus: { menus: {
connected: { //
art: CONNECT // Send telnet connections to matrix where users can login, apply, etc.
next: matrix //
options: { telnetConnected: {
nextTimeout: 1500 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: { matrix: {