Compare commits
15 commits
dependabot
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9c0ba04b31 | ||
![]() |
e499287079 | ||
![]() |
2a9a6c3562 | ||
![]() |
ad5d38259c | ||
![]() |
7c1f8fa48e | ||
![]() |
8dd4d0fda4 | ||
![]() |
5bbfcee0b6 | ||
![]() |
cb5c1fa809 | ||
![]() |
64e86994f7 | ||
![]() |
a97003bac2 | ||
![]() |
2576a495cf | ||
![]() |
d2ea50a0f2 | ||
![]() |
3246df75b6 | ||
![]() |
acb4e42fde | ||
![]() |
c3e54ef0d8 |
20 changed files with 5343 additions and 6754 deletions
|
@ -1,18 +0,0 @@
|
||||||
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
|
|
||||||
ARG VARIANT=16-bullseye
|
|
||||||
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:${VARIANT}
|
|
||||||
|
|
||||||
# [Optional] Uncomment this section to install additional OS packages.
|
|
||||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
||||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install gnupg2 -y
|
|
||||||
|
|
||||||
RUN npm i --location=global release-please
|
|
||||||
|
|
||||||
# [Optional] Uncomment if you want to install an additional version of node using nvm
|
|
||||||
# ARG EXTRA_NODE_VERSION=10
|
|
||||||
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
|
|
||||||
|
|
||||||
# [Optional] Uncomment if you want to install more global node packages
|
|
||||||
# RUN su node -c "npm install -g <your-package-list -here>"
|
|
|
@ -1,22 +1,27 @@
|
||||||
{
|
{
|
||||||
"name": "Node.js & TypeScript",
|
"name": "Node.js & TypeScript",
|
||||||
"build": {
|
"image": "mcr.microsoft.com/devcontainers/base:jammy",
|
||||||
"dockerfile": "Dockerfile",
|
|
||||||
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
|
|
||||||
// Append -bullseye or -buster to pin to an OS version.
|
|
||||||
// Use -bullseye variants on local on arm64/Apple Silicon.
|
|
||||||
"args": {
|
|
||||||
"VARIANT": "16-bullseye"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
"mounts": [
|
||||||
|
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh/personal_id_rsa.pub,target=/home/vscode/.hostssh/id_rsa.pub,readonly,type=bind,consistency=cached"
|
||||||
|
],
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {},
|
||||||
|
},
|
||||||
// Configure tool-specific properties.
|
// Configure tool-specific properties.
|
||||||
"customizations": {
|
"customizations": {
|
||||||
// Configure properties specific to VS Code.
|
// Configure properties specific to VS Code.
|
||||||
"vscode": {
|
"vscode": {
|
||||||
// Add the IDs of extensions you want installed when the container is created.
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"dbaeumer.vscode-eslint"
|
"ms-vscode-remote.remote-containers",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"GitHub.copilot",
|
||||||
|
"GitHub.copilot-chat",
|
||||||
|
"esbenp.prettier-vscode",
|
||||||
|
"rvest.vs-code-prettier-eslint",
|
||||||
|
"bierner.markdown-mermaid",
|
||||||
|
"stylelint.vscode-stylelint"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -25,8 +30,8 @@
|
||||||
// "forwardPorts": [],
|
// "forwardPorts": [],
|
||||||
|
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
// "postCreateCommand": "yarn install",
|
"postCreateCommand": "/bin/bash ./.devcontainer/scripts/tools.sh >> ~/post-create-tools.log",
|
||||||
|
|
||||||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||||
"remoteUser": "node"
|
"remoteUser": "vscode"
|
||||||
}
|
}
|
12
.devcontainer/scripts/tools.sh
Normal file
12
.devcontainer/scripts/tools.sh
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mkdir -p ~/.ssh && \
|
||||||
|
touch ~/.ssh/known_hosts && \
|
||||||
|
sudo tee ~/.ssh/config > /dev/null << EOF
|
||||||
|
Host github.com
|
||||||
|
HostName github.com
|
||||||
|
PreferredAuthentications publickey
|
||||||
|
IdentityFile ~/.hostssh/id_rsa.pub
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sudo chown -R vscode:vscode ~/.ssh
|
2
.github/workflows/action-test.yml
vendored
2
.github/workflows/action-test.yml
vendored
|
@ -62,4 +62,4 @@ jobs:
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.prep.outputs.tags }}
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
|
|
69
.github/workflows/docker-multiplatform-tag.yml
vendored
Normal file
69
.github/workflows/docker-multiplatform-tag.yml
vendored
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
---
|
||||||
|
name: 'Build Docker On Tag'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- bigip-server
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
|
||||||
|
workflow_dispatch: # Allows manual triggering from the GitHub UI
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 'Checkout'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare
|
||||||
|
id: prep
|
||||||
|
run: |
|
||||||
|
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
|
||||||
|
|
||||||
|
# If this is a git tag, use the tag name as a docker tag
|
||||||
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/tags/v}
|
||||||
|
TAGS="${DOCKER_IMAGE}:${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If this is a git branch, use the branch name as a docker tag
|
||||||
|
if [[ $GITHUB_REF == refs/heads/* ]]; then
|
||||||
|
VERSION=${GITHUB_REF#refs/heads/}
|
||||||
|
TAGS="${DOCKER_IMAGE}:${VERSION}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the VERSION looks like a version number, also tag as 'latest'
|
||||||
|
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
|
||||||
|
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set output parameters
|
||||||
|
echo ::set-output name=tags::${TAGS}
|
||||||
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
platforms: all
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to DockerHub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
builder: ${{ steps.buildx.outputs.name }}
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/ppc64le
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.prep.outputs.tags }}
|
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
|
@ -23,8 +23,9 @@ jobs:
|
||||||
package-name: webssh2
|
package-name: webssh2
|
||||||
path: app
|
path: app
|
||||||
default-branch: main
|
default-branch: main
|
||||||
|
release-type: node
|
||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
needs: release
|
needs: release
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
14
README.md
14
README.md
|
@ -45,7 +45,19 @@ 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
|
||||||
|
|
||||||
|
## NOTICE
|
||||||
|
Docker versions differ from what is in `main` and are release dependant.
|
||||||
|
|
||||||
|
Meaning billchurch/webssh2:latest is the latest official release. This does NOT sync with what is in `main` on this repo. `main` is development and will change until it gets a release tag.
|
||||||
|
|
||||||
|
On occasion, examples or instructions on `main` will drift from what is released. You should refer to the tag of the version you're using to ensure you are following the proper guidance.
|
||||||
|
|
||||||
|
That being said the most current release version is [0.4.6](https://github.com/billchurch/webssh2/tree/0.4.6), see that tag for details.
|
||||||
|
|
||||||
|
## 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).
|
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).
|
||||||
|
|
BIN
app/bun.lockb
Executable file
BIN
app/bun.lockb
Executable file
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,5 +0,0 @@
|
||||||
/*!
|
|
||||||
* 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)
|
|
||||||
* Copyright 2022 Fonticons, Inc.
|
|
||||||
*/
|
|
|
@ -140,7 +140,7 @@
|
||||||
cursor: crosshair;
|
cursor: crosshair;
|
||||||
}
|
}
|
||||||
|
|
||||||
.xterm .xterm-accessibility,
|
.xterm .xterm-accessibility:not(.debug),
|
||||||
.xterm .xterm-message {
|
.xterm .xterm-message {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -149,6 +149,16 @@
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xterm .xterm-accessibility-tree:not(.debug) *::selection {
|
||||||
|
color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.xterm .xterm-accessibility-tree {
|
||||||
|
user-select: text;
|
||||||
|
white-space: pre;
|
||||||
}
|
}
|
||||||
|
|
||||||
.xterm .live-region {
|
.xterm .live-region {
|
||||||
|
@ -160,13 +170,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.xterm-dim {
|
.xterm-dim {
|
||||||
opacity: 0.5;
|
/* Dim should not apply to background, so the opacity of the foreground color is applied
|
||||||
|
* explicitly in the generated class and reset to 1 here */
|
||||||
|
opacity: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.xterm-underline {
|
.xterm-underline-1 { text-decoration: underline; }
|
||||||
text-decoration: underline;
|
.xterm-underline-2 { text-decoration: double underline; }
|
||||||
|
.xterm-underline-3 { text-decoration: wavy underline; }
|
||||||
|
.xterm-underline-4 { text-decoration: dotted underline; }
|
||||||
|
.xterm-underline-5 { text-decoration: dashed underline; }
|
||||||
|
|
||||||
|
.xterm-overline {
|
||||||
|
text-decoration: overline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
|
||||||
|
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
|
||||||
|
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
|
||||||
|
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
|
||||||
|
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
|
||||||
|
|
||||||
.xterm-strikethrough {
|
.xterm-strikethrough {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
}
|
}
|
||||||
|
@ -176,8 +200,12 @@
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
|
||||||
|
z-index: 7;
|
||||||
|
}
|
||||||
|
|
||||||
.xterm-decoration-overview-ruler {
|
.xterm-decoration-overview-ruler {
|
||||||
z-index: 7;
|
z-index: 8;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* eslint-disable import/no-extraneous-dependencies */
|
/* eslint-disable import/no-extraneous-dependencies */
|
||||||
import { io } from 'socket.io-client';
|
import { io } from 'socket.io-client';
|
||||||
import { Terminal } from 'xterm';
|
import { Terminal } from '@xterm/xterm';
|
||||||
import { FitAddon } from 'xterm-addon-fit';
|
import { FitAddon } from '@xterm/addon-fit';
|
||||||
import { library, dom } from '@fortawesome/fontawesome-svg-core';
|
import { library, dom } from '@fortawesome/fontawesome-svg-core';
|
||||||
import { faBars, faClipboard, faDownload, faKey, faCog } from '@fortawesome/free-solid-svg-icons';
|
import { faBars, faClipboard, faDownload, faKey, faCog } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ library.add(faBars, faClipboard, faDownload, faKey, faCog);
|
||||||
dom.watch();
|
dom.watch();
|
||||||
|
|
||||||
const debug = require('debug')('WebSSH2');
|
const debug = require('debug')('WebSSH2');
|
||||||
require('xterm/css/xterm.css');
|
require('@xterm/xterm/css/xterm.css');
|
||||||
require('../css/style.css');
|
require('../css/style.css');
|
||||||
|
|
||||||
/* global Blob, logBtn, credentialsBtn, reauthBtn, downloadLogBtn */ // eslint-disable-line
|
/* global Blob, logBtn, credentialsBtn, reauthBtn, downloadLogBtn */ // eslint-disable-line
|
||||||
|
|
11814
app/package-lock.json
generated
11814
app/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "webssh2",
|
"name": "webssh2",
|
||||||
"version": "0.5.0-pre-4",
|
"version": "0.6.0-pre-1",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
".gitignore"
|
".gitignore"
|
||||||
],
|
],
|
||||||
|
@ -35,15 +35,15 @@
|
||||||
"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",
|
||||||
"express": "^4.18.1",
|
"express": "^4.19.2",
|
||||||
"express-session": "^1.17.3",
|
"express-session": "^1.18.0",
|
||||||
"json-merger": "^1.1.9",
|
|
||||||
"morgan": "~1.10.0",
|
"morgan": "~1.10.0",
|
||||||
"read-config-ng": "^3.0.5",
|
"read-config-ng": "^3.0.7",
|
||||||
"serve-favicon": "^2.5.0",
|
"serve-favicon": "^2.5.0",
|
||||||
"socket.io": "^4.5.1",
|
"socket.io": "^4.7.5",
|
||||||
"ssh2": "^1.11.0",
|
"ssh2": "^1.15.0",
|
||||||
"validator": "^13.7.0"
|
"validator": "^13.11.0",
|
||||||
|
"winston": "^3.13.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node index.js",
|
"start": "node index.js",
|
||||||
|
@ -56,33 +56,34 @@
|
||||||
"release": "standard-version"
|
"release": "standard-version"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.1.2",
|
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.1.2",
|
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
||||||
"@typescript-eslint/parser": "^5.32.0",
|
"@typescript-eslint/parser": "^7.7.1",
|
||||||
|
"@xterm/addon-fit": "^0.10.0",
|
||||||
|
"@xterm/xterm": "^5.5.0",
|
||||||
"clean-webpack-plugin": "^4.0.0",
|
"clean-webpack-plugin": "^4.0.0",
|
||||||
"copy-webpack-plugin": "^11.0.0",
|
"copy-webpack-plugin": "^12.0.2",
|
||||||
"css-loader": "^6.7.1",
|
"css-loader": "^7.1.1",
|
||||||
"eslint": "^8.21.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-config-airbnb-base": "^15.0.0",
|
"eslint-config-airbnb-base": "^15.0.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-import": "^2.26.0",
|
"eslint-plugin-import": "^2.29.1",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"mini-css-extract-plugin": "^2.6.1",
|
"mini-css-extract-plugin": "^2.9.0",
|
||||||
"nodaemon": "0.0.5",
|
"nodaemon": "0.0.5",
|
||||||
"prettier": "^2.7.1",
|
"npm-check-updates": "^16.14.20",
|
||||||
|
"prettier": "^3.2.5",
|
||||||
"snazzy": "^9.0.0",
|
"snazzy": "^9.0.0",
|
||||||
"snyk": "^1.982.0",
|
"snyk": "^1.1290.0",
|
||||||
"socket.io-client": "^4.5.1",
|
"socket.io-client": "^4.7.5",
|
||||||
"source-map-loader": "^4.0.0",
|
"source-map-loader": "^5.0.0",
|
||||||
"standard-version": "^9.5.0",
|
"standard-version": "^9.5.0",
|
||||||
"terser-webpack-plugin": "^5.3.3",
|
"terser-webpack-plugin": "^5.3.10",
|
||||||
"ts-loader": "^9.3.1",
|
"ts-loader": "^9.5.1",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^5.4.5",
|
||||||
"webpack": "^5.74.0",
|
"webpack": "^5.91.0",
|
||||||
"webpack-cli": "^4.10.0",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-merge": "^5.8.0",
|
"webpack-merge": "^5.10.0"
|
||||||
"xterm": "^4.19.0",
|
|
||||||
"xterm-addon-fit": "^0.5.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ const express = require('express');
|
||||||
const logger = require('morgan');
|
const logger = require('morgan');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const server = require('http').Server(app);
|
const server = require('http').createServer(app);
|
||||||
const favicon = require('serve-favicon');
|
const favicon = require('serve-favicon');
|
||||||
const io = require('socket.io')(server, config.socketio);
|
const io = require('socket.io')(server, config.socketio);
|
||||||
const session = require('express-session')(config.express);
|
const session = require('express-session')(config.express);
|
||||||
|
@ -102,7 +102,8 @@ const onConnection = (socket) => {
|
||||||
});
|
});
|
||||||
socket.on('geometry', (cols, rows) => {
|
socket.on('geometry', (cols, rows) => {
|
||||||
// TODO need to rework how we pass settings to ssh2, this is less than ideal
|
// TODO need to rework how we pass settings to ssh2, this is less than ideal
|
||||||
socket.request.session.ssh.terminfo = { cols, rows };
|
socket.request.session.ssh.cols = cols;
|
||||||
|
socket.request.session.ssh.rows = rows;
|
||||||
webssh2debug(socket, `SOCKET GEOMETRY: termCols = ${cols}, termRows = ${rows}`);
|
webssh2debug(socket, `SOCKET GEOMETRY: termCols = ${cols}, termRows = ${rows}`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
no-console: ["error", { allow: ["warn", "error", "info"] }] */
|
no-console: ["error", { allow: ["warn", "error", "info"] }] */
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const merger = require('json-merger');
|
|
||||||
const debugWebSSH2 = require('debug')('WebSSH2');
|
const debugWebSSH2 = require('debug')('WebSSH2');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
|
@ -110,7 +109,8 @@ try {
|
||||||
}
|
}
|
||||||
console.info(`WebSSH2 service reading config from: ${configPath}`);
|
console.info(`WebSSH2 service reading config from: ${configPath}`);
|
||||||
const configFile = readconfig(configPath, { override: true });
|
const configFile = readconfig(configPath, { override: true });
|
||||||
myConfig = merger.mergeObjects([configDefault, configFile]);
|
// myConfig = merger.mergeObjects([configDefault, configFile]);
|
||||||
|
myConfig = { ...configDefault, ...configFile };
|
||||||
debugWebSSH2(`\nCurrent config: ${util.inspect(myConfig)}`);
|
debugWebSSH2(`\nCurrent config: ${util.inspect(myConfig)}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
myConfig = configDefault;
|
myConfig = configDefault;
|
||||||
|
|
|
@ -171,6 +171,8 @@ exports.connect = function connect(req, res) {
|
||||||
letterSpacing,
|
letterSpacing,
|
||||||
lineHeight,
|
lineHeight,
|
||||||
},
|
},
|
||||||
|
cols: null,
|
||||||
|
rows: null,
|
||||||
allowreplay:
|
allowreplay:
|
||||||
config.options.challengeButton ||
|
config.options.challengeButton ||
|
||||||
(validator.isBoolean(`${req.headers.allowreplay}`)
|
(validator.isBoolean(`${req.headers.allowreplay}`)
|
||||||
|
|
|
@ -105,7 +105,7 @@ module.exports = function appSocket(socket) {
|
||||||
socket.emit('data', data.replace(/\r?\n/g, '\r\n').toString('utf-8'));
|
socket.emit('data', data.replace(/\r?\n/g, '\r\n').toString('utf-8'));
|
||||||
});
|
});
|
||||||
|
|
||||||
conn.on('handshake', (data => {
|
conn.on('handshake', () => {
|
||||||
socket.emit('setTerminalOpts', socket.request.session.ssh.terminal);
|
socket.emit('setTerminalOpts', socket.request.session.ssh.terminal);
|
||||||
socket.emit('menu');
|
socket.emit('menu');
|
||||||
socket.emit('allowreauth', socket.request.session.ssh.allowreauth);
|
socket.emit('allowreauth', socket.request.session.ssh.allowreauth);
|
||||||
|
@ -118,7 +118,7 @@ module.exports = function appSocket(socket) {
|
||||||
'footer',
|
'footer',
|
||||||
`ssh://${socket.request.session.username}@${socket.request.session.ssh.host}:${socket.request.session.ssh.port}`
|
`ssh://${socket.request.session.username}@${socket.request.session.ssh.host}:${socket.request.session.ssh.port}`
|
||||||
);
|
);
|
||||||
}));
|
});
|
||||||
|
|
||||||
conn.on('ready', () => {
|
conn.on('ready', () => {
|
||||||
webssh2debug(
|
webssh2debug(
|
||||||
|
|
BIN
bun.lockb
Executable file
BIN
bun.lockb
Executable file
Binary file not shown.
6
package.json
Normal file
6
package.json
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"bun-types": "^1.0.1"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue