@wwkit/sshproxy 1.0.16 → 1.0.18

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.
Files changed (2) hide show
  1. package/bin/index.js +12 -0
  2. package/package.json +2 -2
package/bin/index.js CHANGED
@@ -1,9 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import { execSync } from 'node:child_process'
4
+ import { readFileSync } from 'node:fs'
3
5
  import { ProxyManager } from '../src/ProxyManager.js'
4
6
  import { SshCommands } from '../src/SshCommands.js'
5
7
  import { clientAddr, loadConfig } from '../src/config.js'
6
8
 
9
+ const pkgVersion = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version
10
+
7
11
  const args = process.argv.slice(2)
8
12
  const cmd = args[0] ?? 'help'
9
13
  const sub = args[1] ?? ''
@@ -28,6 +32,12 @@ async function main() {
28
32
  return handleDebug()
29
33
  case 'web':
30
34
  return handleWeb(sub)
35
+ case 'upgrade':
36
+ execSync('npm install -g @wwkit/sshproxy@latest', { stdio: 'inherit' })
37
+ return
38
+ case 'version':
39
+ console.log(pkgVersion)
40
+ return
31
41
  case 'help':
32
42
  default:
33
43
  printHelp()
@@ -300,6 +310,8 @@ function printHelp() {
300
310
  sshproxy web 启动 Web 管理页(后台,默认 http://127.0.0.1:1081)
301
311
  sshproxy web on 启动 Web 管理页
302
312
  sshproxy web off 关闭 Web 管理页
313
+ sshproxy upgrade 升级 sshproxy 自身(npm install -g @wwkit/sshproxy@latest)
314
+ sshproxy version 显示版本号
303
315
  sshproxy help 显示本帮助
304
316
 
305
317
  配置: ~/.config/sshproxy/config.json5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wwkit/sshproxy",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "author": "bluesliu <langcai163@163.com>",
5
5
  "description": "SOCKS5 proxy manager (client SSH tunnel / server remote), CLI + web UI",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "dotenv": "^16.4.5",
38
38
  "json5": "^2.2.3",
39
39
  "ssh2": "^1.16.0",
40
- "@wwkit/shared": "1.0.15"
40
+ "@wwkit/shared": "1.0.17"
41
41
  },
42
42
  "devDependencies": {
43
43
  "jest": "^29.7.0"