chore: modify webssh2 debug keyword

This commit is contained in:
Bill Church 2021-05-20 13:18:59 -04:00
parent df2a896139
commit 6aca5b414f
3 changed files with 23 additions and 6 deletions

View file

@ -1,4 +1,16 @@
# Change Log # Change Log
## 0.5.0 [TBD]
### BREAKING
- Debug environment for webssh2 changed from `WebSSH2` to `webssh2`
### Changes
- Credentials are now retreived using passport.js (should make it easier to expand to other methods in the future) for #247
- Refactored ./app/server/app.js
- Safe shutdown feature moved to ./app/server/safeShutdown.js and re-worked
- Session setup moved out of `/ssh/host` route into ./app/server/sessionSetup.js for readability and reuse for #247
### Added
- New route `/ssh/login/host` to gather `username` and `password` credentials from either GET or POST
## 0.4.0 [20210519] ## 0.4.0 [20210519]
### BREAKING ### BREAKING
- Disabled ssh.serverlog.client option, this disables the POC which allowed for logging of the data sent between the client/server to the console.log. - Disabled ssh.serverlog.client option, this disables the POC which allowed for logging of the data sent between the client/server to the console.log.

View file

@ -17,7 +17,7 @@ console.log(`WebSSH2 service listening on ${config.listen.ip}:${config.listen.po
server.on('error', (err) => { server.on('error', (err) => {
if (err.code === 'EADDRINUSE') { if (err.code === 'EADDRINUSE') {
config.listen.port += 1; config.listen.port += 1;
console.warn(`WebSSH2 Address in use, retrying on port ${config.listen.port}`); console.error(`WebSSH2 Address in use, retrying on port ${config.listen.port}`);
setTimeout(() => { setTimeout(() => {
server.listen(config.listen.port); server.listen(config.listen.port);
}, 250); }, 250);

View file

@ -3,7 +3,7 @@
// eslint-disable-next-line import/order // eslint-disable-next-line import/order
const config = require('./config'); const config = require('./config');
const path = require('path'); const path = require('path');
const debug = require('debug')('WebSSH2'); const debug = require('debug')('webssh2');
require('colors'); require('colors');
// allow for color property extensions in log messages // allow for color property extensions in log messages
@ -42,6 +42,11 @@ passport.use(
password: config.user.password, password: config.user.password,
privatekey: config.user.privatekey, privatekey: config.user.privatekey,
}; };
debug(
`overridebasic username: ${user.username.yellow.bold.underline} and password ${
user.password ? 'exists'.yellow.bold.underline : 'is blank'.underline.red.bold
}`
);
return done(null, user); return done(null, user);
} }
return done(null, false); return done(null, false);
@ -56,8 +61,8 @@ passport.use(
password, password,
}; };
debug( debug(
`myAuth.name: ${username.yellow.bold.underline} and password ${ `HTTP Basic username: ${user.username.yellow.bold.underline} and password ${
password ? 'exists'.yellow.bold.underline : 'is blank'.underline.red.bold user.password ? 'exists'.yellow.bold.underline : 'is blank'.underline.red.bold
}` }`
); );
return done(null, user); return done(null, user);
@ -73,8 +78,8 @@ passport.use(
password, password,
}; };
debug( debug(
`myAuth.name: ${username.yellow.bold.underline} and password ${ `HTTP GET/POST username: ${user.username.yellow.bold.underline} and password ${
password ? 'exists'.yellow.bold.underline : 'is blank'.underline.red.bold user.password ? 'exists'.yellow.bold.underline : 'is blank'.underline.red.bold
}` }`
); );
return done(null, user); return done(null, user);