webssh2_client 0.2.20 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -63
- package/client/index.js +2 -2
- package/client/public/client.htm +6 -6
- package/client/public/webssh2.bundle.js +1 -1
- package/client/public/webssh2.css +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
WebSSH2 Client is a web-based SSH client that allows users to connect to SSH servers directly from their web browsers. It's built using modern web technologies and provides a seamless, secure SSH experience.
|
|
4
4
|
|
|
5
5
|
# EXPERIMENTAL
|
|
6
|
-
The current status is experimental, and this first version is a refactor of webssh2 v0.2.x to be compatible with a refactor of the same version of webssh2 as a stand-alone server-side component
|
|
6
|
+
The current status is experimental, and this first version is a refactor of webssh2 v0.2.x to be compatible with a refactor of the same version of webssh2 as a stand-alone server-side component running Node.js v6.9.1.
|
|
7
7
|
|
|
8
8
|
The intention is to harmonize the latest release of webssh2 by splitting out the client and server as separate repos (webssh2-client and webssh2-server) but joining them both together as modules in a parent webssh2 in an attempt to provide backward compatibility.
|
|
9
9
|
|
|
@@ -78,22 +78,11 @@ window.webssh2Config = {
|
|
|
78
78
|
sshTerm: 'xterm-color', // Terminal type
|
|
79
79
|
readyTimeout: 20000, // SSH connection timeout (ms)
|
|
80
80
|
},
|
|
81
|
-
terminal: {
|
|
82
|
-
cursorBlink: true, // Whether the cursor should blink
|
|
83
|
-
scrollback: 10000, // Number of rows to keep in scrollback
|
|
84
|
-
tabStopWidth: 8, // Tab width
|
|
85
|
-
bellStyle: 'sound', // Terminal bell style ('sound' or 'none')
|
|
86
|
-
fontSize: 14, // Font size in pixels
|
|
87
|
-
fontFamily: 'courier-new, courier, monospace', // Font family
|
|
88
|
-
letterSpacing: 0, // Letter spacing
|
|
89
|
-
lineHeight: 1, // Line height
|
|
90
|
-
},
|
|
91
81
|
header: {
|
|
92
82
|
text: null, // Custom header text
|
|
93
83
|
background: 'green', // Header background color
|
|
94
84
|
},
|
|
95
|
-
autoConnect: false
|
|
96
|
-
logLevel: 'info', // Logging level ('debug', 'info', 'warn', 'error')
|
|
85
|
+
autoConnect: false // Whether to connect automatically
|
|
97
86
|
};
|
|
98
87
|
```
|
|
99
88
|
|
|
@@ -131,18 +120,7 @@ When `autoConnect` is not used, ensure your server is configured to prompt for o
|
|
|
131
120
|
|
|
132
121
|
### Customization Examples
|
|
133
122
|
|
|
134
|
-
1.
|
|
135
|
-
```javascript
|
|
136
|
-
window.webssh2Config = {
|
|
137
|
-
terminal: {
|
|
138
|
-
fontSize: 16,
|
|
139
|
-
fontFamily: 'Fira Code, monospace',
|
|
140
|
-
cursorBlink: false
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
2. Setting a custom header:
|
|
123
|
+
1. Setting a custom header:
|
|
146
124
|
```javascript
|
|
147
125
|
window.webssh2Config = {
|
|
148
126
|
header: {
|
|
@@ -152,7 +130,7 @@ When `autoConnect` is not used, ensure your server is configured to prompt for o
|
|
|
152
130
|
};
|
|
153
131
|
```
|
|
154
132
|
|
|
155
|
-
|
|
133
|
+
2. Configuring for a specific SSH server with auto-connect:
|
|
156
134
|
```javascript
|
|
157
135
|
window.webssh2Config = {
|
|
158
136
|
ssh: {
|
|
@@ -251,64 +229,87 @@ The WebSSH2 client supports various URL parameters to customize the SSH connecti
|
|
|
251
229
|
- `password`: The password for SSH authentication (not recommended for production use).
|
|
252
230
|
- Example: `?password=secretpassword`
|
|
253
231
|
|
|
254
|
-
###
|
|
232
|
+
### UI Customization
|
|
255
233
|
|
|
256
|
-
- `
|
|
257
|
-
- Example: `?
|
|
234
|
+
- `header`: Custom text to display in the header.
|
|
235
|
+
- Example: `?header=My%20SSH%20Session`
|
|
258
236
|
|
|
259
|
-
- `
|
|
260
|
-
- Example: `?
|
|
237
|
+
- `headerBackground`: Background color for the header.
|
|
238
|
+
- Example: `?headerBackground=red`
|
|
261
239
|
|
|
262
|
-
|
|
263
|
-
- Example: `?cursorBlink=true`
|
|
240
|
+
### Usage Example
|
|
264
241
|
|
|
265
|
-
|
|
266
|
-
- Example: `?scrollback=5000`
|
|
242
|
+
A full URL with multiple parameters might look like this:
|
|
267
243
|
|
|
268
|
-
|
|
269
|
-
|
|
244
|
+
```
|
|
245
|
+
http://localhost:2222/ssh/host/192.168.1.100?port=2222&header=Production%20Server&headerBackground=red&fontSize=14&bellStyle=none
|
|
246
|
+
```
|
|
270
247
|
|
|
271
|
-
|
|
272
|
-
- Example: `?bellStyle=none`
|
|
248
|
+
This URL would connect to a SSH server at 192.168.1.100 on port 2222, with a red header displaying "Production Server", using a 14px font size and turning off the audible bell.
|
|
273
249
|
|
|
274
|
-
|
|
250
|
+
Note: Be cautious about including sensitive information like passwords in URL parameters, especially in production environments.
|
|
275
251
|
|
|
276
|
-
|
|
277
|
-
- Example: `?fontSize=14`
|
|
252
|
+
## Terminal Configuration
|
|
278
253
|
|
|
279
|
-
|
|
280
|
-
- Example: `?fontFamily=Consolas,Monaco,Lucida%20Console,Liberation%20Mono,DejaVu%20Sans%20Mono,Bitstream%20Vera%20Sans%20Mono,Courier%20New,monospace`
|
|
254
|
+
WebSSH2 Client allows users to customize their terminal experience through a set of configurable options. These settings are stored in the browser's localStorage under the key `webssh2.settings.global`, ensuring your preferences persist across sessions.
|
|
281
255
|
|
|
282
|
-
|
|
283
|
-
- Example: `?letterSpacing=1`
|
|
256
|
+
### Accessing Terminal Settings
|
|
284
257
|
|
|
285
|
-
|
|
286
|
-
- Example: `?lineHeight=1.2`
|
|
258
|
+
You can access the terminal configuration in two ways:
|
|
287
259
|
|
|
288
|
-
|
|
260
|
+
1. **From an Active Session:**
|
|
261
|
+
- Click on the menu icon (☰) in the bottom-left corner of the terminal.
|
|
262
|
+
- Select "Settings" from the dropdown menu.
|
|
289
263
|
|
|
290
|
-
|
|
291
|
-
|
|
264
|
+
2. **During Login:**
|
|
265
|
+
- In the login dialog, click on the gear icon (⚙️) next to the "Connect" button.
|
|
292
266
|
|
|
293
|
-
|
|
294
|
-
- Example: `?headerBackground=red`
|
|
267
|
+
### Available Settings
|
|
295
268
|
|
|
296
|
-
|
|
269
|
+
The terminal settings dialog offers the following customization options:
|
|
297
270
|
|
|
298
|
-
|
|
299
|
-
|
|
271
|
+
1. **Font Size**
|
|
272
|
+
- Range: 8-72 pixels
|
|
273
|
+
- Adjusts the size of the text in the terminal.
|
|
300
274
|
|
|
301
|
-
|
|
275
|
+
2. **Font Family**
|
|
276
|
+
- Specifies the font used in the terminal.
|
|
277
|
+
- Example: "Courier New, monospace"
|
|
302
278
|
|
|
303
|
-
|
|
279
|
+
3. **Cursor Blink**
|
|
280
|
+
- Options: On / Off
|
|
281
|
+
- Determines whether the cursor blinks in the terminal.
|
|
304
282
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
283
|
+
4. **Scrollback**
|
|
284
|
+
- Range: 1-200000 lines
|
|
285
|
+
- Sets the number of lines kept in the terminal's scrollback buffer.
|
|
308
286
|
|
|
309
|
-
|
|
287
|
+
5. **Tab Stop Width**
|
|
288
|
+
- Range: 1-100 spaces
|
|
289
|
+
- Defines the width of tab stops in the terminal.
|
|
310
290
|
|
|
311
|
-
|
|
291
|
+
6. **Bell Style**
|
|
292
|
+
- Options: Sound / None
|
|
293
|
+
- Configures the audible bell behavior in the terminal.
|
|
294
|
+
|
|
295
|
+
### Applying Settings
|
|
296
|
+
|
|
297
|
+
After adjusting your preferences:
|
|
298
|
+
|
|
299
|
+
1. Click "Save" to apply the new settings.
|
|
300
|
+
2. The changes will take effect immediately for the current session and all future sessions.
|
|
301
|
+
3. Click "Cancel" to close the dialog without saving changes.
|
|
302
|
+
|
|
303
|
+
### Resetting to Defaults
|
|
304
|
+
|
|
305
|
+
To reset all settings to their default values:
|
|
306
|
+
|
|
307
|
+
1. Clear your browser's localStorage for the WebSSH2 Client site.
|
|
308
|
+
2. Refresh the page.
|
|
309
|
+
|
|
310
|
+
### Note on Persistence
|
|
311
|
+
|
|
312
|
+
These settings are stored locally in your browser. If you use WebSSH2 Client on a different device or browser, you'll need to reconfigure your preferences.
|
|
312
313
|
|
|
313
314
|
## Debugging
|
|
314
315
|
|
package/client/index.js
CHANGED
package/client/public/client.htm
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Version Version 0.2.
|
|
1
|
+
<!-- Version Version 0.2.22 - 2024-08-19T18:58:58.568Z - 4c2b9ba -->
|
|
2
2
|
<!-- webssh2-client -->
|
|
3
3
|
<!-- /client/src/client.htm -->
|
|
4
4
|
<!DOCTYPE html>
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
<p id="errorMessage"></p>
|
|
39
39
|
</div>
|
|
40
40
|
</dialog>
|
|
41
|
-
<dialog id="
|
|
41
|
+
<dialog id="terminalSettingsDialog" class="modal">
|
|
42
42
|
<div class="modal-content">
|
|
43
|
-
<h2>Terminal
|
|
44
|
-
<form id="
|
|
43
|
+
<h2>Terminal Settings</h2>
|
|
44
|
+
<form id="terminalSettingsForm" class="pure-form pure-form-stacked">
|
|
45
45
|
<fieldset>
|
|
46
46
|
<label for="fontSize">Font Size</label>
|
|
47
47
|
<input type="number" id="fontSize" name="fontSize" min="8" max="72" required>
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
</select>
|
|
69
69
|
|
|
70
70
|
<button type="submit" class="pure-button pure-button-primary">Save</button>
|
|
71
|
-
<button type="button" id="
|
|
71
|
+
<button type="button" id="closeterminalSettingsBtn" class="pure-button">Cancel</button>
|
|
72
72
|
</fieldset>
|
|
73
73
|
</form>
|
|
74
74
|
</div>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<button id="downloadLogBtn" class="menu-button"><i class="fas fa-download fa-fw"></i> Download Log</button>
|
|
89
89
|
<button id="replayCredentialsBtn" class="menu-button"><i class="fas fa-key fa-fw"></i> Credentials</button>
|
|
90
90
|
<button id="reauthBtn" class="menu-button"><i class="fas fa-key fa-fw"></i> Switch User</button>
|
|
91
|
-
<button id="
|
|
91
|
+
<button id="terminalSettingsBtn" class="menu-button"><i class="fas fa-cog fa-fw"></i> Settings</button>
|
|
92
92
|
</div>
|
|
93
93
|
</div>
|
|
94
94
|
<div id="footer"></div>
|