Updated packages: (#153)
Updated packages: "colors": "~1.4.0", "compression": "~1.7.4", "debug": "^4.1.1", "express": "~4.17.1", "express-session": "~1.17.0", "socket.io": "2.2.0", "ssh2": "~0.8.6", "terser-webpack-plugin": "^2.2.1", "validator": "~12.0.0", "xterm-addon-fit": "^0.3.0", "xterm-addon-search": "^0.3.0", "xterm-addon-web-links": "^0.2.1" "@fortawesome/fontawesome-svg-core": "^1.2.25", "@fortawesome/free-solid-svg-icons": "^5.11.2", "clean-webpack-plugin": "^3.0.0", "copy-webpack-plugin": "^5.0.5", "cross-env": "^6.0.3", "css-loader": "^3.2.0", "file-loader": "^4.2.0", "postcss-discard-comments": "^4.0.2", "standard": "^14.3.1", "style-loader": "^1.0.0", "url-loader": "^2.2.0", "webpack": "^4.41.2", "webpack-cli": "^3.3.10", "webpack-merge": "^4.2.2", "xterm": "^4.2.0"
This commit is contained in:
parent
1cbb195739
commit
9355ad7b5c
10 changed files with 7748 additions and 94 deletions
File diff suppressed because one or more lines are too long
8
app/client/public/webssh2.bundle.js.LICENSE
Normal file
8
app/client/public/webssh2.bundle.js.LICENSE
Normal file
|
@ -0,0 +1,8 @@
|
|||
/*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <http://feross.org>
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
/*! https://mths.be/utf8js v2.1.2 by @mathias */
|
|
@ -55,7 +55,7 @@
|
|||
* The z-index of the helpers must be higher than the canvases in order for
|
||||
* IMEs to appear on top.
|
||||
*/
|
||||
z-index: 10;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.xterm .xterm-helper-textarea {
|
||||
|
@ -69,7 +69,7 @@
|
|||
top: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
z-index: -10;
|
||||
z-index: -5;
|
||||
/** Prevent wrapping so the IME appears against the textarea at the correct position */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
@ -150,7 +150,7 @@
|
|||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 100;
|
||||
z-index: 10;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
'use strict'
|
||||
|
||||
import * as io from 'socket.io-client'
|
||||
import * as Terminal from 'xterm/dist/xterm'
|
||||
import * as fit from 'xterm/dist/addons/fit/fit'
|
||||
import { Terminal } from 'xterm'
|
||||
import { FitAddon } from 'xterm-addon-fit'
|
||||
/* import * as fit from 'xterm/dist/addons/fit/fit'
|
||||
*/
|
||||
import { library, dom } from '@fortawesome/fontawesome-svg-core'
|
||||
import { faBars, faClipboard, faDownload, faKey, faCog } from '@fortawesome/free-solid-svg-icons'
|
||||
library.add(faBars, faClipboard, faDownload, faKey, faCog)
|
||||
dom.watch()
|
||||
|
||||
require('xterm/dist/xterm.css')
|
||||
require('xterm/css/xterm.css')
|
||||
require('../css/style.css')
|
||||
|
||||
Terminal.applyAddon(fit)
|
||||
|
||||
/* global Blob, logBtn, credentialsBtn, reauthBtn, downloadLogBtn */
|
||||
var sessionLogEnable = false
|
||||
var loggedData = false
|
||||
|
@ -20,21 +20,23 @@ var allowreplay = false
|
|||
var allowreauth = false
|
||||
var sessionLog, sessionFooter, logDate, currentDate, myFile, errorExists
|
||||
var socket, termid // eslint-disable-line
|
||||
var term = new Terminal()
|
||||
const term = new Terminal()
|
||||
// DOM properties
|
||||
var status = document.getElementById('status')
|
||||
var header = document.getElementById('header')
|
||||
var dropupContent = document.getElementById('dropupContent')
|
||||
var footer = document.getElementById('footer')
|
||||
var fitAddon = new FitAddon()
|
||||
var terminalContainer = document.getElementById('terminal-container')
|
||||
term.loadAddon(fitAddon)
|
||||
term.open(terminalContainer)
|
||||
term.focus()
|
||||
term.fit()
|
||||
fitAddon.fit()
|
||||
|
||||
window.addEventListener('resize', resizeScreen, false)
|
||||
|
||||
function resizeScreen () {
|
||||
term.fit()
|
||||
fitAddon.fit()
|
||||
socket.emit('resize', { cols: term.cols, rows: term.rows })
|
||||
}
|
||||
|
||||
|
@ -49,7 +51,7 @@ if (document.location.pathname) {
|
|||
socket = io.connect()
|
||||
}
|
||||
|
||||
term.on('data', function (data) {
|
||||
term.onData(function (data) {
|
||||
socket.emit('data', data)
|
||||
})
|
||||
|
||||
|
@ -154,7 +156,7 @@ socket.on('reauth', function () {
|
|||
(allowreauth) && reauthSession()
|
||||
})
|
||||
|
||||
term.on('title', function (title) {
|
||||
term.onTitleChange(function (title) {
|
||||
document.title = title
|
||||
})
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
var config = require('./server/app').config
|
||||
var server = require('./server/app').server
|
||||
|
||||
server.listen({ host: config.listen.ip, port: config.listen.port
|
||||
})
|
||||
server.listen({ host: config.listen.ip, port: config.listen.port })
|
||||
|
||||
console.log('WebSSH2 service listening on ' + config.listen.ip + ':' + config.listen.port)
|
||||
|
||||
|
|
7633
app/package-lock.json
generated
Normal file
7633
app/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -28,16 +28,20 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"basic-auth": "~2.0.1",
|
||||
"colors": "~1.3.2",
|
||||
"compression": "~1.7.3",
|
||||
"debug": "~4.1.0",
|
||||
"express": "~4.16.4",
|
||||
"express-session": "~1.15.6",
|
||||
"colors": "~1.4.0",
|
||||
"compression": "~1.7.4",
|
||||
"debug": "^4.1.1",
|
||||
"express": "~4.17.1",
|
||||
"express-session": "~1.17.0",
|
||||
"morgan": "~1.9.1",
|
||||
"read-config": "git+https://github.com/billchurch/nodejs-read-config.git",
|
||||
"socket.io": "~2.2.0",
|
||||
"ssh2": "~0.6.1",
|
||||
"validator": "~10.9.0"
|
||||
"socket.io": "2.2.0",
|
||||
"ssh2": "~0.8.6",
|
||||
"terser-webpack-plugin": "^2.2.1",
|
||||
"validator": "~12.0.0",
|
||||
"xterm-addon-fit": "^0.3.0",
|
||||
"xterm-addon-search": "^0.3.0",
|
||||
"xterm-addon-web-links": "^0.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node index.js",
|
||||
|
@ -60,25 +64,24 @@
|
|||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.12",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.6.3",
|
||||
"clean-webpack-plugin": "^1.0.0",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"css-loader": "^2.1.0",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.25",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.11.2",
|
||||
"clean-webpack-plugin": "^3.0.0",
|
||||
"copy-webpack-plugin": "^5.0.5",
|
||||
"cross-env": "^6.0.3",
|
||||
"css-loader": "^3.2.0",
|
||||
"extract-text-webpack-plugin": "^4.0.0-beta.0",
|
||||
"file-loader": "^3.0.1",
|
||||
"file-loader": "^4.2.0",
|
||||
"nodaemon": "0.0.5",
|
||||
"postcss-discard-comments": "^4.0.1",
|
||||
"postcss-discard-comments": "^4.0.2",
|
||||
"snazzy": "^8.0.0",
|
||||
"standard": "^12.0.1",
|
||||
"style-loader": "^0.23.1",
|
||||
"uglifyjs-webpack-plugin": "^2.1.1",
|
||||
"url-loader": "^1.1.2",
|
||||
"webpack": "^4.28.4",
|
||||
"webpack-cli": "^3.2.1",
|
||||
"webpack-merge": "^4.2.1",
|
||||
"standard": "^14.3.1",
|
||||
"style-loader": "^1.0.0",
|
||||
"url-loader": "^2.2.0",
|
||||
"webpack": "^4.41.2",
|
||||
"webpack-cli": "^3.3.10",
|
||||
"webpack-merge": "^4.2.2",
|
||||
"webpack-stream": "^5.2.1",
|
||||
"xterm": "^3.10.1"
|
||||
"xterm": "^4.2.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
const webpack = require('webpack')
|
||||
const path = require('path')
|
||||
const CleanWebpackPlugin = require('clean-webpack-plugin')
|
||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||
/* const CleanWebpackPlugin = require('clean-webpack-plugin') */
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
module.exports = {
|
||||
|
@ -9,10 +9,7 @@ module.exports = {
|
|||
webssh2: './client/src/js/index.js'
|
||||
},
|
||||
plugins: [
|
||||
new CleanWebpackPlugin(['client/public'], {
|
||||
root: path.resolve('__dirname', '../'),
|
||||
verbose: true
|
||||
}),
|
||||
new CleanWebpackPlugin(),
|
||||
new CopyWebpackPlugin([
|
||||
'./client/src/client.htm',
|
||||
'./client/src/favicon.ico'
|
||||
|
|
|
@ -1,10 +1,23 @@
|
|||
const TerserPlugin = require('terser-webpack-plugin');
|
||||
const merge = require('webpack-merge')
|
||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||
// const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||
const common = require('./webpack.common.js')
|
||||
|
||||
module.exports = merge(common, {
|
||||
plugins: [
|
||||
new UglifyJSPlugin({
|
||||
optimization: {
|
||||
minimize: true,
|
||||
minimizer: [new TerserPlugin({
|
||||
terserOptions: {
|
||||
parallel: 4,
|
||||
ie8: false,
|
||||
safari10: false
|
||||
}
|
||||
})],
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
/* new UglifyJSPlugin({
|
||||
uglifyOptions: {
|
||||
ie8: false,
|
||||
dead_code: true,
|
||||
|
@ -13,6 +26,4 @@ module.exports = merge(common, {
|
|||
beautify: false
|
||||
}
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
}) */
|
|
@ -13,49 +13,49 @@ var logger = require('morgan')
|
|||
|
||||
// sane defaults if config.json or parts are missing
|
||||
let config = {
|
||||
'listen': {
|
||||
'ip': '0.0.0.0',
|
||||
'port': 2222
|
||||
listen: {
|
||||
ip: '0.0.0.0',
|
||||
port: 2222
|
||||
},
|
||||
'user': {
|
||||
'name': null,
|
||||
'password': null
|
||||
user: {
|
||||
name: null,
|
||||
password: null
|
||||
},
|
||||
'ssh': {
|
||||
'host': null,
|
||||
'port': 22,
|
||||
'term': 'xterm-color',
|
||||
'readyTimeout': 20000,
|
||||
'keepaliveInterval': 120000,
|
||||
'keepaliveCountMax': 10
|
||||
ssh: {
|
||||
host: null,
|
||||
port: 22,
|
||||
term: 'xterm-color',
|
||||
readyTimeout: 20000,
|
||||
keepaliveInterval: 120000,
|
||||
keepaliveCountMax: 10
|
||||
},
|
||||
'terminal': {
|
||||
'cursorBlink': true,
|
||||
'scrollback': 10000,
|
||||
'tabStopWidth': 8,
|
||||
'bellStyle': 'sound'
|
||||
terminal: {
|
||||
cursorBlink: true,
|
||||
scrollback: 10000,
|
||||
tabStopWidth: 8,
|
||||
bellStyle: 'sound'
|
||||
},
|
||||
'header': {
|
||||
'text': null,
|
||||
'background': 'green'
|
||||
header: {
|
||||
text: null,
|
||||
background: 'green'
|
||||
},
|
||||
'session': {
|
||||
'name': 'WebSSH2',
|
||||
'secret': 'mysecret'
|
||||
session: {
|
||||
name: 'WebSSH2',
|
||||
secret: 'mysecret'
|
||||
},
|
||||
'options': {
|
||||
'challengeButton': true,
|
||||
'allowreauth': true
|
||||
options: {
|
||||
challengeButton: true,
|
||||
allowreauth: true
|
||||
},
|
||||
'algorithms': {
|
||||
'kex': [
|
||||
algorithms: {
|
||||
kex: [
|
||||
'ecdh-sha2-nistp256',
|
||||
'ecdh-sha2-nistp384',
|
||||
'ecdh-sha2-nistp521',
|
||||
'diffie-hellman-group-exchange-sha256',
|
||||
'diffie-hellman-group14-sha1'
|
||||
],
|
||||
'cipher': [
|
||||
cipher: [
|
||||
'aes128-ctr',
|
||||
'aes192-ctr',
|
||||
'aes256-ctr',
|
||||
|
@ -65,23 +65,23 @@ let config = {
|
|||
'aes256-gcm@openssh.com',
|
||||
'aes256-cbc'
|
||||
],
|
||||
'hmac': [
|
||||
hmac: [
|
||||
'hmac-sha2-256',
|
||||
'hmac-sha2-512',
|
||||
'hmac-sha1'
|
||||
],
|
||||
'compress': [
|
||||
compress: [
|
||||
'none',
|
||||
'zlib@openssh.com',
|
||||
'zlib'
|
||||
]
|
||||
},
|
||||
'serverlog': {
|
||||
'client': false,
|
||||
'server': false
|
||||
serverlog: {
|
||||
client: false,
|
||||
server: false
|
||||
},
|
||||
'accesslog': false,
|
||||
'verify': false
|
||||
accesslog: false,
|
||||
verify: false
|
||||
}
|
||||
|
||||
// test if config.json exists, if not provide error message but try to run
|
||||
|
|
Loading…
Reference in a new issue