Skip to content

Commit d849f74

Browse files
committed
adding readyTimeout option, updating packages
adding readyTimeout option, updating packages
1 parent 458747d commit d849f74

File tree

15 files changed

+1477
-1123
lines changed

15 files changed

+1477
-1123
lines changed

ChangeLog.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
# Change Log
22
## [0.1.2] 2017-07-31
3+
### Added
4+
- ssh.readyTimeout option in config.json (time in ms, default 20000, 20sec)
35
### Changed
4-
- Updated xterm.js to 2.8.1 from 2.6.0
6+
- Updated xterm.js to 2.9.2 from 2.6.0
7+
- See https://github.com/sourcelair/xterm.js/releases/tag/2.9.2
8+
- See https://github.com/sourcelair/xterm.js/releases/tag/2.9.1
9+
- See https://github.com/sourcelair/xterm.js/releases/tag/2.9.0
510
- See https://github.com/sourcelair/xterm.js/releases/tag/2.8.1
611
- See https://github.com/sourcelair/xterm.js/releases/tag/2.8.0
712
- See https://github.com/sourcelair/xterm.js/releases/tag/2.7.0
813
- Updated ssh2 to 0.5.5 to keep current, no fixes impacting WebSSH2
914
- ssh-streams to 0.1.19 from 0.1.16
15+
- Updated validator.js to 8.0.0, no fixes impacting WebSSH2
16+
- https://github.com/chriso/validator.js/releases/tag/8.0.0
17+
- Updated Express to 4.15.4, no fixes impacting WebSSH2
18+
- https://github.com/expressjs/express/releases/tag/4.15.4
19+
- Updated Express-session to 1.15.5, no fixes impacting WebSSH2
20+
- https://github.com/expressjs/session/releases/tag/v1.15.5
21+
- Updated Debug to 3.0.0, no fixes impacting WebSSH2
22+
- https://github.com/visionmedia/debug/releases/tag/3.0.0
23+
- Running in strict mode ('use strict';)
24+
1025

1126
## [0.1.1] 2017-06-03
1227
### Added

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ You will be prompted for credentials to use on the SSH server via HTTP Basic aut
3131

3232
* **headerBackground=** - _string_ - optional background color of header to display on page
3333

34+
* **readyTimeout=** - _integer_ - How long (in milliseconds) to wait for the SSH handshake to complete. **Default:** 20000. **Enforced Values:** Min: 1, Max: 300000
35+
3436
## Headers
3537

3638
* **allowreplay** - _boolean_ - Allow use of password replay feature, example `allowreplay: true`
@@ -52,6 +54,8 @@ You will be prompted for credentials to use on the SSH server via HTTP Basic aut
5254

5355
* **ssh.term** - _string_ - Specify terminal emulation to use, defaults to `xterm-color`
5456

57+
* **ssh.readyTimeout - _integer_ - How long (in milliseconds) to wait for the SSH handshake to complete. **Default:** 20000.
58+
5559
* **useminified** - _boolean_ - Choose between ./public/client-full.htm (false/non-minified) or ./public/client-min.htm (true/minified js), defaults to false (non-minified version)
5660

5761
* **header.text** - _string_ - Specify header text, defaults to `My Header` but may also be set to `null`. When set to `null` no header bar will be displayed on the client.

app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ app.get('/ssh/host/:host?', function (req, res, next) {
5050
serverlog: {
5151
client: config.serverlog.client || false,
5252
server: config.serverlog.server || false
53-
}
53+
},
54+
readyTimeout: (validator.isInt(req.query.readyTimeout + '', {min: 1, max: 300000}) &&
55+
req.query.readyTimeout) || config.ssh.readyTimeout
5456
}
5557
req.session.ssh.header.name && validator.escape(req.session.ssh.header.name)
5658
req.session.ssh.header.background &&

config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"ssh": {
1111
"host": null,
1212
"port": 22,
13-
"term": "xterm-color"
13+
"term": "xterm-color",
14+
"readyTimeout": 20000
1415
},
1516
"useminified": false,
1617
"header": {

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Bill Church - https://github.com/billchurch/WebSSH2 - May 2017
55
*
66
*/
7+
'use strict'
78

89
var config = require('./app').config
910
var server = require('./app').server

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
"dependencies": {
3030
"basic-auth": "^1.1.0",
3131
"colors": "^1.1.2",
32-
"debug": "^2.6.8",
33-
"express": "^4.15.3",
34-
"express-session": "^1.15.3",
32+
"debug": "^3.0.0",
33+
"express": "^4.15.4",
34+
"express-session": "^1.15.5",
3535
"morgan": "^1.8.2",
3636
"read-config": "^1.6.0",
3737
"socket.io": "^1.7.4",
3838
"ssh2": "^0.5.5",
39-
"validator": "^7.0.0"
39+
"validator": "^8.0.0"
4040
},
4141
"scripts": {
4242
"start": "node index",
@@ -54,9 +54,9 @@
5454
"grunt-contrib-uglify": "^3.0.1",
5555
"nodemon": "^1.11.0",
5656
"snazzy": "^7.0.0",
57-
"snyk": "^1.30.1",
58-
"standard": "^10.0.2",
59-
"xterm": "^2.8.1"
57+
"snyk": "^1.39.1",
58+
"standard": "^10.0.3",
59+
"xterm": "^2.9.2"
6060
},
6161
"standard": {
6262
"ignore": [

public/src/css/xterm.css

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -89,53 +89,40 @@
8989
text-decoration: none;
9090
}
9191

92-
.terminal.focus:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar) .terminal-cursor {
93-
background-color: #fff;
94-
color: #000;
92+
.terminal .terminal-cursor {
93+
position: relative;
9594
}
9695

9796
.terminal:not(.focus) .terminal-cursor {
9897
outline: 1px solid #fff;
9998
outline-offset: -1px;
100-
background-color: transparent;
10199
}
102100

103-
.terminal:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus.xterm-cursor-blink-on .terminal-cursor {
104-
background-color: transparent;
105-
color: inherit;
101+
.terminal.xterm-cursor-style-block.focus:not(.xterm-cursor-blink-on) .terminal-cursor {
102+
background-color: #fff;
103+
color: #000;
106104
}
107105

108-
.terminal.xterm-cursor-style-bar .terminal-cursor,
109-
.terminal.xterm-cursor-style-underline .terminal-cursor {
110-
position: relative;
111-
}
112-
.terminal.xterm-cursor-style-bar .terminal-cursor::before,
113-
.terminal.xterm-cursor-style-underline .terminal-cursor::before {
114-
content: "";
115-
display: block;
106+
.terminal.focus.xterm-cursor-style-bar:not(.xterm-cursor-blink-on) .terminal-cursor::before,
107+
.terminal.focus.xterm-cursor-style-underline:not(.xterm-cursor-blink-on) .terminal-cursor::before {
108+
content: '';
116109
position: absolute;
117110
background-color: #fff;
118111
}
119-
.terminal.xterm-cursor-style-bar .terminal-cursor::before {
112+
113+
.terminal.focus.xterm-cursor-style-bar:not(.xterm-cursor-blink-on) .terminal-cursor::before {
120114
top: 0;
121-
bottom: 0;
122115
left: 0;
116+
bottom: 0;
123117
width: 1px;
124118
}
125-
.terminal.xterm-cursor-style-underline .terminal-cursor::before {
119+
120+
.terminal.focus.xterm-cursor-style-underline:not(.xterm-cursor-blink-on) .terminal-cursor::before {
126121
bottom: 0;
127122
left: 0;
128123
right: 0;
129124
height: 1px;
130125
}
131-
.terminal.xterm-cursor-style-bar.focus.xterm-cursor-blink.xterm-cursor-blink-on .terminal-cursor::before,
132-
.terminal.xterm-cursor-style-underline.focus.xterm-cursor-blink.xterm-cursor-blink-on .terminal-cursor::before {
133-
background-color: transparent;
134-
}
135-
.terminal.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before,
136-
.terminal.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before {
137-
background-color: #fff;
138-
}
139126

140127
.terminal .composition-view {
141128
background: #000;
@@ -217,6 +204,10 @@
217204
text-decoration: blink;
218205
}
219206

207+
.terminal .xterm-blink.xterm-underline {
208+
text-decoration: blink underline;
209+
}
210+
220211
.terminal .xterm-hidden {
221212
visibility: hidden;
222213
}

0 commit comments

Comments
 (0)