* chore: update ssh2 and development deps

* feat: take LISTEN, PORT, and other env vars #294

* chore: rebuild client files

* docs: update readme

* chore: bump version

* chore: setup gpg for dev container
This commit is contained in:
Bill Church 2022-08-01 15:27:44 -04:00 committed by GitHub
parent 0bbc99a1ba
commit c0e67d2d57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 3023 additions and 3243 deletions

View file

@ -6,6 +6,8 @@ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:${VARIANT}
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here> # && apt-get -y install --no-install-recommends <your-package-list-here>
RUN apt-get update && apt-get install gnupg2 -y
# [Optional] Uncomment if you want to install an additional version of node using nvm # [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10 # ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" # RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

View file

@ -46,7 +46,7 @@ Alternatively in main for testing, you can send credentials via POST with the va
See [BUILDING.md](BUILDING.md) for more details. See [BUILDING.md](BUILDING.md) for more details.
# Docker Instructions # Docker Instructions
Some configuration options are available as [Environment Variables](#environment-variables). If there is a configuration option you require which does not have an environment variable please [open an issue requesting](../../issues/new/choose).
[webssh2 images are available in docker hub](https://hub.docker.com/repository/docker/billchurch/webssh2). [webssh2 images are available in docker hub](https://hub.docker.com/repository/docker/billchurch/webssh2).
@ -100,10 +100,17 @@ Alternatively if you don't want to build either and mount the config at runtime
docker run --name webssh2 -d -p 2222:2222 -v `pwd`/app/config.json:/usr/src/config.json billchurch/webssh2 docker run --name webssh2 -d -p 2222:2222 -v `pwd`/app/config.json:/usr/src/config.json billchurch/webssh2
``` ```
<ignoreend>
# Options # Options
## Environment Variables
Environment variables introduced in 0.4.7 will override anything specified in `config.json`. This is useful for settings that may be per-node, or in a container environment. These are optional and will default to whatever their peer config.json settings are
* **LISTEN** - _string_ - IP address node should listen on for client connections, defaults to `127.0.0.1`. Peer is **listen.ip**
* **PORT** - _integer_ - Port node should listen on for client connections, defaults to `2222`. Peer is **listen.port**
* **SOCKETIO_ORIGINS** - _array_ - COORS origins to allow connections from to socket.io server, defaults to `localhost:2222`. Changed in 0.3.1, to enable previous, less secure, default behavior of everything use `*:*` (not recommended). Check [#240](../../issues/240). Peer is **socketio.origins**
* **SOCKETIO_PATH** _string_ - Path to socket.io client files. Default: `/ssh/socket.io`. Peer is **socketio.path**
* **SOCKETIO_SERVECLIENT** _boolean_ - serve the socket.io client. This is built into the custom javascript, so you shouldn't need this. Kept as an option just in case. Default: `false`. Peer is **socketio.serveClient**
## POST request vars (in main branch for testing) ## POST request vars (in main branch for testing)
* **username** - _string_ - username to log into ssh with * **username** - _string_ - username to log into ssh with
@ -177,7 +184,11 @@ docker run --name webssh2 -d -p 2222:2222 -v `pwd`/app/config.json:/usr/src/conf
* **listen.port** - _integer_ - Port node should listen on for client connections, defaults to `2222` * **listen.port** - _integer_ - Port node should listen on for client connections, defaults to `2222`
* **http.origins** - _array_ - COORS origins to allow connections from to socket.io server, defaults to `localhost:2222`. Changed in 0.3.1, to enable previous, less secure, default behavior of everything use `*:*` (not recommended). Check [#240](../../issues/240) * **socketio.serveClient** - _boolean_ - serve the socket.io client. This is built into the custom javascript, so you shouldn't need this. Kept as an option just in case. Default: `false`
* **socketio.path** - _string_ - Path to socket.io client files. Default: `/ssh/socket.io`
* **socketio.origins** - _array_ - COORS origins to allow connections from to socket.io server, defaults to `localhost:2222`. Changed in 0.3.1, to enable previous, less secure, default behavior of everything use `*:*` (not recommended). Check [#240](../../issues/240)
* **user.name** - _string_ - Specify user name to authenticate with. In normal cases this should be left to the default `null` setting. * **user.name** - _string_ - Specify user name to authenticate with. In normal cases this should be left to the default `null` setting.

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,5 @@
/*! /*!
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com * Font Awesome Free 6.1.2 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
* Copyright 2022 Fonticons, Inc.
*/ */

View file

@ -36,6 +36,7 @@
*/ */
.xterm { .xterm {
cursor: text;
position: relative; position: relative;
user-select: none; user-select: none;
-ms-user-select: none; -ms-user-select: none;
@ -124,10 +125,6 @@
line-height: normal; line-height: normal;
} }
.xterm {
cursor: text;
}
.xterm.enable-mouse-events { .xterm.enable-mouse-events {
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
cursor: default; cursor: default;
@ -179,6 +176,19 @@
position: absolute; position: absolute;
} }
.xterm-decoration-overview-ruler {
z-index: 7;
position: absolute;
top: 0;
right: 0;
pointer-events: none;
}
.xterm-decoration-top {
z-index: 2;
position: relative;
}
body, html { body, html {
font-family: helvetica, sans-serif, arial; font-family: helvetica, sans-serif, arial;
font-size: 1em; font-size: 1em;

6156
app/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "webssh2", "name": "webssh2",
"version": "0.4.7-alpha.2", "version": "0.4.7-alpha.3",
"ignore": [ "ignore": [
".gitignore" ".gitignore"
], ],
@ -35,7 +35,6 @@
"basic-auth": "~2.0.1", "basic-auth": "~2.0.1",
"cidr-matcher": "^2.1.1", "cidr-matcher": "^2.1.1",
"debug": "^4.3.4", "debug": "^4.3.4",
"dotenv": "^16.0.1",
"express": "^4.18.1", "express": "^4.18.1",
"express-session": "^1.17.3", "express-session": "^1.17.3",
"json-merger": "^1.1.9", "json-merger": "^1.1.9",
@ -43,7 +42,7 @@
"read-config-ng": "^3.0.5", "read-config-ng": "^3.0.5",
"serve-favicon": "^2.5.0", "serve-favicon": "^2.5.0",
"socket.io": "^4.5.1", "socket.io": "^4.5.1",
"ssh2": "^1.10.0", "ssh2": "^1.11.0",
"validator": "^13.7.0" "validator": "^13.7.0"
}, },
"scripts": { "scripts": {
@ -57,33 +56,33 @@
"release": "standard-version" "release": "standard-version"
}, },
"devDependencies": { "devDependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/fontawesome-svg-core": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^5.15.3", "@fortawesome/free-solid-svg-icons": "^6.1.2",
"@typescript-eslint/eslint-plugin": "^4.23.0", "@typescript-eslint/eslint-plugin": "^5.31.0",
"@typescript-eslint/parser": "^4.23.0", "@typescript-eslint/parser": "^5.31.0",
"clean-webpack-plugin": "^3.0.0", "clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^8.1.1", "copy-webpack-plugin": "^11.0.0",
"css-loader": "^5.2.4", "css-loader": "^6.7.1",
"eslint": "^7.26.0", "eslint": "^8.21.0",
"eslint-config-airbnb-base": "^14.2.1", "eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.22.1", "eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^4.2.1",
"mini-css-extract-plugin": "^1.6.0", "mini-css-extract-plugin": "^2.6.1",
"nodaemon": "0.0.5", "nodaemon": "0.0.5",
"prettier": "^2.3.0", "prettier": "^2.7.1",
"snazzy": "^9.0.0", "snazzy": "^9.0.0",
"snyk": "^1.787.0", "snyk": "^1.981.0",
"socket.io-client": "^4.1.1", "socket.io-client": "^4.5.1",
"source-map-loader": "^2.0.1", "source-map-loader": "^4.0.0",
"standard-version": "^9.3.0", "standard-version": "^9.5.0",
"terser-webpack-plugin": "^5.1.2", "terser-webpack-plugin": "^5.3.3",
"ts-loader": "^9.1.2", "ts-loader": "^9.3.1",
"typescript": "^4.2.4", "typescript": "^4.7.4",
"webpack": "^5.37.0", "webpack": "^5.74.0",
"webpack-cli": "^4.7.0", "webpack-cli": "^4.10.0",
"webpack-merge": "^5.7.3", "webpack-merge": "^5.8.0",
"xterm": "^4.18.0", "xterm": "^4.19.0",
"xterm-addon-fit": "^0.5.0" "xterm-addon-fit": "^0.5.0"
}, },
"resolutions": { "resolutions": {

View file

@ -122,4 +122,15 @@ try {
} }
const config = myConfig; const config = myConfig;
if (process.env.LISTEN) config.listen.ip = process.env.LISTEN;
if (process.env.PORT) config.listen.port = process.env.PORT;
if (process.env.SOCKETIO_ORIGINS) config.socketio.origins = process.env.SOCKETIO_ORIGINS;
if (process.env.SOCKETIO_PATH) config.socketio.path = process.env.SOCKETIO_PATH;
if (process.env.SOCKETIO_SERVECLIENT)
config.socketio.serveClient = process.env.SOCKETIO_SERVECLIENT;
module.exports = config; module.exports = config;