Merge pull request #1 from billchurch/master

Align with master repo
This commit is contained in:
Matteo Pietro Dazzi 2020-10-09 16:37:33 +02:00 committed by GitHub
commit 4c39a76bf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 457 additions and 268 deletions

View file

@ -1,5 +1,7 @@
# WebSSH2
<ignorestart>
[![GitHub version](https://badge.fury.io/gh/billchurch%2Fwebssh2.svg)](https://badge.fury.io/gh/billchurch%2Fwebssh2)
[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/billchurch)
@ -63,6 +65,7 @@ docker run --name webssh2 -d -p 2222:2222 -v `pwd`/app/config.json:/usr/src/conf
```
<ignoreend>
# Options
## GET request vars

712
app/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -83,7 +83,7 @@
"postcss-discard-comments": "^4.0.2",
"snazzy": "^8.0.0",
"standard": "^14.3.1",
"standard-version": "^7.1.0",
"standard-version": "^8.0.1",
"style-loader": "^1.1.3",
"url-loader": "^3.0.0",
"webpack": "^4.42.0",

View file

@ -118,7 +118,7 @@ var validator = require('validator')
var io = require('socket.io')(server, { serveClient: false, path: '/ssh/socket.io' })
var socket = require('./socket')
var expressOptions = require('./expressOptions')
var favicon = require('serve-favicon');
var favicon = require('serve-favicon')
// express
app.use(safeShutdownGuard)
@ -143,10 +143,10 @@ app.get('/ssh/host/:host?', function (req, res, next) {
res.sendFile(path.join(path.join(publicPath, 'client.htm')))
// capture, assign, and validated variables
req.session.ssh = {
host: (validator.isIP(req.params.host + '') && req.params.host) ||
host: config.ssh.host || (validator.isIP(req.params.host + '') && req.params.host) ||
(validator.isFQDN(req.params.host) && req.params.host) ||
(/^(([a-z]|[A-Z]|[0-9]|[!^(){}\-_~])+)?\w$/.test(req.params.host) &&
req.params.host) || config.ssh.host,
req.params.host),
port: (validator.isInt(req.query.port + '', { min: 1, max: 65535 }) &&
req.query.port) || config.ssh.port,
localAddress: config.ssh.localAddress,