Add web SSH feature

master
KaKi87 1 year ago
parent 2e6ce727ff
commit b5acab8d86
  1. 3
      config.example.json
  2. 9
      index-web.js
  3. 4
      package.json
  4. 1103
      yarn.lock

@ -1,3 +1,4 @@
{
"sshPort": 1234
"sshPort": 1234,
"webPort": 4321
}

@ -0,0 +1,9 @@
const
childProcess = require('child_process'),
path = require('path'),
{ sshPort, webPort } = require('./config.json');
childProcess.spawn(
path.join(__dirname, './node_modules/.bin/wetty'),
[`--ssh-host=localhost`, `--ssh-port=${sshPort}`, `--port=${webPort}`],
{ stdio: 'inherit', stdin: 'inherit' }
);

@ -19,7 +19,8 @@
"cryptr": "^6.0.2",
"hibp": "^9.0.0",
"qrcode-terminal": "^0.12.0",
"ssh2": "^0.8.9"
"ssh2": "^0.8.9",
"wetty": "^2.1.1"
},
"devDependencies": {
"chai": "^4.2.0",
@ -30,6 +31,7 @@
"scripts": {
"keygen": "ssh-keygen -f host -N '' && mv host host.key",
"start": "node index.js",
"start-web": "node index-web.js",
"test": "./node_modules/.bin/mocha"
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save