diff --git a/ChangeLog.md b/ChangeLog.md index 255ee36..2ea9f4a 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,11 +1,12 @@ # Change Log -## [0.2.5] TBD +## [0.2.5] 20180911 ### Added - Reauth function thanks to @vbeskrovny and @vvalchev (9bbc116) - Controlled by `config.json` option `options.allowreauth` true presents reauth dialog and false hides dialog ### Changed - `options.challengeButton` enabled - - previously this configuraiton option did nothing, this now enables the Credentials button site-wide regardless of the `allowreplay` header value + - previously this configuration option did nothing, this now enables the Credentials button site-wide regardless of the `allowreplay` header value +- Updated debug module to v4 ## [0.2.4] 2018-07-18 ### Added diff --git a/bin/startup_script_webssh_commands.sh b/bin/startup_script_webssh_commands.sh deleted file mode 100644 index bcb92bf..0000000 --- a/bin/startup_script_webssh_commands.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Filename: /config/startup_script_webssh_commands.sh -# Initializes WebSSH2 tmm-to-node listener -# WebSSHVSIP should be the IP on an existing BIGIP virtual server assigned to -# the WebSSH2 service. -# -# bill@f5.com February 2018 - -export myFileName=$0 -export REMOTEUSER=root -export WEBSSHVSIP= - -# check to see if we're in /config/startup, if not add ourselves -IN_STARTUP=`grep startup_script_webssh_commands.sh /config/startup | wc -l` -if [ $IN_STARTUP -eq 0 ]; then - echo Adding script to /config/startup and ensuring correct permissions... - logger -p local0.notice -t $myFileName Adding $0 to /config/startup and ensuring correct permissions... - chmod 755 /config/startup - chmod 755 /config/startup_script_webssh_commands.sh - echo /config/startup_script_webssh_commands.sh \& >> /config/startup - echo >> /config/startup -fi - -# Limit to 13 times in while-loop, ie. 12 x 10 secs sleep = 2 mins. -MAX_LOOP=13 - -while true -do -# check to see if tmm interface is up -IPLINKLIST=$(ip link list tmm 2>&1) -if [ $? -eq 0 ]; then - if [ ! -z $WEBSSHVSIP ]; then - IPADDRADD=$(/sbin/ip addr add $WEBSSHVSIP/32 dev tmm 2>&1) - if [ $? -eq 0 ]; then - # success - echo SUCCESS $IPADDRADD - logger -p local0.notice -t $myFileName IPADDRADD: SUCCESS: $IPADDRADD - else - # failure - echo FAILURE $IPADDRADD - logger -p local0.notice -t $myFileName IPADDRADD: FAILURE: $IPADDRADD - fi - else - echo FAILURE: WEBSSHVSIP not specified. - echo Open $0 and set the WEBSSHVSIP and try again - echo - logger -p local0.notice -t $myFileName IPADDRADD: FAILURE: NO WEBSSHVSIP SPECIFIED - fi - exit -fi -# If tmm interface is not up yet, script sleep 10 seconds and check again. -sleep 10 - -# Safety check not to run this script in background beyond 2 mins (ie. 12 times in while-loop). -if [ "$MAX_LOOP" -eq 1 ]; then - logger -p local0.notice -t $myFileName tmm interface not up within 2 minutes. Exiting script. - logger -p local0.notice -t $myFileName IPLINKLIST: $IPLINKLIST - exit -fi -((MAX_LOOP--)) -done - -# End of file /config/startup_script_webssh_commands.sh diff --git a/build.sh b/build.sh index 162364e..2fe4d59 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash ## Syncs from BIG-IP and builds a release based on version in extensions/ephemeral_auth/package.json -ilxhost=root@192.168.30.210 +ilxhost=root@192.168.30.216 workspace_name=webssh2 package_name=BIG-IP-13.1.0.8-ILX-WebSSH2 pua_location=/Users/bill/Documents/GitHub/f5-pua/bin diff --git a/index.js b/index.js index 13b1b43..2173768 100644 --- a/index.js +++ b/index.js @@ -1,10 +1,12 @@ -// index.js +'use strict' +/* jshint esversion: 6, asi: true, node: true */ /* + * index.js + * * WebSSH2 - Web to SSH2 gateway * Bill Church - https://github.com/billchurch/WebSSH2 - May 2017 * */ -'use strict' var config = require('./server/app').config var server = require('./server/app').server diff --git a/package.json b/package.json index acab24d..70856ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webssh2", - "version": "0.2.3", + "version": "0.2.5", "ignore": [ ".gitignore" ], @@ -30,7 +30,7 @@ "basic-auth": "^2.0.0", "colors": "^1.3.1", "compression": "^1.7.3", - "debug": "^3.1.0", + "debug": "^4.0.0", "express": "^4.16.3", "express-session": "^1.15.6", "morgan": "^1.9.0", diff --git a/revsync.sh b/revsync.sh new file mode 100755 index 0000000..7257f84 --- /dev/null +++ b/revsync.sh @@ -0,0 +1,12 @@ +#!/bin/bash +ilxhost=root@192.168.30.216 +workspace_name=webssh2 +package_name=BIG-IP-13.1.0.8-ILX-WebSSH2 +pua_location=/Users/bill/Documents/GitHub/f5-pua/bin +echo 'hello' +rsync -e 'ssh -ax' -av --delete --exclude='.DS_Store' --exclude extensions/$workspace_name/node_modules workspace/. $ilxhost:/var/ilx/workspaces/Common/$workspace_name/. + +ssh $ilxhost chown -R root.sdm /var/ilx/workspaces/Common/$workspace_name/ +ssh $ilxhost chmod -R ug+rwX,o-w /var/ilx/workspaces/Common/$workspace_name/ +ssh $ilxhost chmod u+rw,go-w /var/ilx/workspaces/Common/$workspace_name/version +ssh $ilxhost chmod u+rw,go-w /var/ilx/workspaces/Common/$workspace_name/node_version diff --git a/server/app.js b/server/app.js index c91a0dd..bd4ffe1 100644 --- a/server/app.js +++ b/server/app.js @@ -1,3 +1,5 @@ +'use strict' +/* jshint esversion: 6, asi: true, node: true */ // app.js var path = require('path') diff --git a/server/socket.js b/server/socket.js index d788b05..577607c 100644 --- a/server/socket.js +++ b/server/socket.js @@ -1,3 +1,5 @@ +'use strict' +/* jshint esversion: 6, asi: true, node: true */ // socket.js // private diff --git a/server/util.js b/server/util.js index 2bf52c6..634926f 100644 --- a/server/util.js +++ b/server/util.js @@ -1,3 +1,5 @@ +'use strict' +/* jshint esversion: 6, asi: true, node: true */ // util.js // private diff --git a/sync.sh b/sync.sh index 0e1809c..7600357 100755 --- a/sync.sh +++ b/sync.sh @@ -1,5 +1,5 @@ #!/bin/bash -ilxhost=root@192.168.30.210 +ilxhost=root@192.168.30.216 workspace_name=webssh2 package_name=BIG-IP-13.1.0.8-ILX-WebSSH2 pua_location=/Users/bill/Documents/GitHub/f5-pua/bin diff --git a/workspace/extensions/webssh2/ChangeLog.md b/workspace/extensions/webssh2/ChangeLog.md index e7bc383..2ea9f4a 100644 --- a/workspace/extensions/webssh2/ChangeLog.md +++ b/workspace/extensions/webssh2/ChangeLog.md @@ -1,4 +1,13 @@ # Change Log +## [0.2.5] 20180911 +### Added +- Reauth function thanks to @vbeskrovny and @vvalchev (9bbc116) + - Controlled by `config.json` option `options.allowreauth` true presents reauth dialog and false hides dialog +### Changed +- `options.challengeButton` enabled + - previously this configuration option did nothing, this now enables the Credentials button site-wide regardless of the `allowreplay` header value +- Updated debug module to v4 + ## [0.2.4] 2018-07-18 ### Added - Browser title window now changes with xterm escape sequences (see http://tldp.org/HOWTO/Xterm-Title-3.html) @@ -15,6 +24,9 @@ ## [0.2.3] unreleased +### Fixed +- ESC]0; is now removed from log files when using the browser-side logging feature + ## [0.2.0] 2018-02-10 Mostly client (browser) related changes in this release @@ -165,5 +177,3 @@ and events in the application (not including the ssh2 module debug) ## [0.0.1] - 2016-06-28 ### Added - Initial proof of concept and release. For historical purposes only. - - diff --git a/workspace/extensions/webssh2/README.md b/workspace/extensions/webssh2/README.md index d0044e3..a438dcd 100644 --- a/workspace/extensions/webssh2/README.md +++ b/workspace/extensions/webssh2/README.md @@ -1,6 +1,7 @@ # WebSSH2 -[![GitHub version](https://badge.fury.io/gh/billchurch%2Fwebssh2.svg)](https://badge.fury.io/gh/billchurch%2Fwebssh2) [![Build Status](https://travis-ci.org/billchurch/WebSSH2.svg?branch=master)](https://travis-ci.org/billchurch/WebSSH2) [![Known Vulnerabilities](https://snyk.io/test/github/billchurch/webssh2/badge.svg)](https://snyk.io/test/github/billchurch/webssh2) [![bitHound Overall Score](https://www.bithound.io/github/billchurch/WebSSH2/badges/score.svg)](https://www.bithound.io/github/billchurch/WebSSH2) [![bitHound Dependencies](https://www.bithound.io/github/billchurch/WebSSH2/badges/dependencies.svg)](https://www.bithound.io/github/billchurch/WebSSH2/master/dependencies/npm) [![NSP Status](https://nodesecurity.io/orgs/billchurch/projects/b0a0d9df-1340-43ef-9736-ef983c057764/badge)](https://nodesecurity.io/orgs/billchurch/projects/b0a0d9df-1340-43ef-9736-ef983c057764) [![Greenkeeper badge](https://badges.greenkeeper.io/billchurch/WebSSH2.svg)](https://greenkeeper.io/) +[![GitHub version](https://badge.fury.io/gh/billchurch%2Fwebssh2.svg)](https://badge.fury.io/gh/billchurch%2Fwebssh2) [![Build Status](https://travis-ci.org/billchurch/WebSSH2.svg?branch=master)](https://travis-ci.org/billchurch/WebSSH2) [![Known Vulnerabilities](https://snyk.io/test/github/billchurch/webssh2/badge.svg)](https://snyk.io/test/github/billchurch/webssh2) [![NSP Status](https://nodesecurity.io/orgs/billchurch/projects/b0a0d9df-1340-43ef-9736-ef983c057764/badge)](https://nodesecurity.io/orgs/billchurch/projects/b0a0d9df-1340-43ef-9736-ef983c057764) [![Greenkeeper badge](https://badges.greenkeeper.io/billchurch/WebSSH2.svg)](https://greenkeeper.io/) +[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/billchurch) Web SSH Client using ssh2, socket.io, xterm.js, and express @@ -8,6 +9,14 @@ A bare bones example of an HTML5 web-based terminal emulator and SSH client. We WebSSH2 v0.2.0 demo +# Requirements +Node v6.x or above. If using ') +}) + app.get('/ssh/host/:host?', function (req, res, next) { res.sendFile(path.join(path.join(publicPath, 'client.htm'))) // capture, assign, and validated variables @@ -60,7 +67,8 @@ app.get('/ssh/host/:host?', function (req, res, next) { tabStopWidth: (validator.isInt(req.query.tabStopWidth + '', {min: 1, max: 100}) && req.query.tabStopWidth) ? req.query.tabStopWidth : config.terminal.tabStopWidth, bellStyle: ((req.query.bellStyle) && (['sound', 'none'].indexOf(req.query.bellStyle) > -1)) ? req.query.bellStyle : config.terminal.bellStyle }, - allowreplay: (validator.isBoolean(req.headers.allowreplay + '') ? myutil.parseBool(req.headers.allowreplay) : false), + allowreplay: config.options.challengeButton || (validator.isBoolean(req.headers.allowreplay + '') ? myutil.parseBool(req.headers.allowreplay) : false), + allowreauth: config.options.allowreauth || false, mrhsession: ((validator.isAlphanumeric(req.headers.mrhsession + '') && req.headers.mrhsession) ? req.headers.mrhsession : 'none'), serverlog: { client: config.serverlog.client || false, diff --git a/workspace/extensions/webssh2/server/socket.js b/workspace/extensions/webssh2/server/socket.js index a43cebd..577607c 100644 --- a/workspace/extensions/webssh2/server/socket.js +++ b/workspace/extensions/webssh2/server/socket.js @@ -1,3 +1,5 @@ +'use strict' +/* jshint esversion: 6, asi: true, node: true */ // socket.js // private @@ -7,7 +9,8 @@ var SSH = require('ssh2').Client // var fs = require('fs') // var hostkeys = JSON.parse(fs.readFileSync('./hostkeyhashes.json', 'utf8')) var termCols, termRows -var menuData = ' Start Log Download Log' +var menuData = ' Start Log' + + ' Download Log' // public module.exports = function socket (socket) { @@ -24,7 +27,7 @@ module.exports = function socket (socket) { termRows = rows }) conn.on('banner', function connOnBanner (data) { - // need to convert to cr/lf for proper formatting + // need to convert to cr/lf for proper formatting data = data.replace(/\r?\n/g, '\r\n') socket.emit('data', data.toString('utf-8')) }) @@ -40,6 +43,7 @@ module.exports = function socket (socket) { socket.emit('status', 'SSH CONNECTION ESTABLISHED') socket.emit('statusBackground', 'green') socket.emit('allowreplay', socket.request.session.ssh.allowreplay) + socket.emit('allowreauth', socket.request.session.ssh.allowreauth) conn.shell({ term: socket.request.session.ssh.term, cols: termCols, diff --git a/workspace/extensions/webssh2/server/util.js b/workspace/extensions/webssh2/server/util.js index 546a0b5..634926f 100644 --- a/workspace/extensions/webssh2/server/util.js +++ b/workspace/extensions/webssh2/server/util.js @@ -1,3 +1,5 @@ +'use strict' +/* jshint esversion: 6, asi: true, node: true */ // util.js // private @@ -12,7 +14,7 @@ exports.basicAuth = function basicAuth (req, res, next) { req.session.userpassword = myAuth.pass debug('myAuth.name: ' + myAuth.name.yellow.bold.underline + ' and password ' + ((myAuth.pass) ? 'exists'.yellow.bold.underline - : 'is blank'.underline.red.bold)) + : 'is blank'.underline.red.bold)) next() } else { res.statusCode = 401