deskssh 0.0.2 → 0.1.1
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 +28 -2
- package/bin/deskssh.js +32 -8
- package/dist/server.js +851 -0
- package/dist/web/assets/index-Bf6XF_tt.css +32 -0
- package/dist/web/assets/index-D9Q_w5Jw.js +258 -0
- package/dist/web/index.html +13 -0
- package/package.json +13 -3
package/README.md
CHANGED
|
@@ -4,8 +4,34 @@
|
|
|
4
4
|
every action is translated into commands executed on the remote host. _Not remote
|
|
5
5
|
desktop. Agentless._
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
## Run it
|
|
8
|
+
|
|
9
|
+
DeskSSH runs on **your** machine and connects to **your** servers. No install:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx deskssh
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
…or install it globally:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g deskssh
|
|
19
|
+
deskssh
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This starts DeskSSH on `http://127.0.0.1:8717` and opens your browser. Enter a
|
|
23
|
+
server's host, port, user and a password or private key, and you get a familiar
|
|
24
|
+
desktop — file manager, terminal, text editor (Stallman), system monitor — all
|
|
25
|
+
over plain SSH.
|
|
26
|
+
|
|
27
|
+
> It binds to `127.0.0.1` by default (it is an SSH gateway and should not be
|
|
28
|
+
> exposed by accident). Override with `HOST` / `PORT` env vars if you know what
|
|
29
|
+
> you're doing.
|
|
30
|
+
|
|
31
|
+
Requirements: **Node.js >= 20**. Remote host: a Linux server with SSH
|
|
32
|
+
(Debian/Ubuntu/Mint in v1).
|
|
33
|
+
|
|
34
|
+
## Links
|
|
9
35
|
|
|
10
36
|
- Repository & docs: https://github.com/nestorrguez/DeskSSH
|
|
11
37
|
- License: **AGPL-3.0-or-later**
|
package/bin/deskssh.js
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// DeskSSH
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// DeskSSH launcher. Starts the gateway (which also serves the web UI) on
|
|
3
|
+
// 127.0.0.1 and opens the browser. DeskSSH runs on *your* machine and connects to
|
|
4
|
+
// *your* servers; it binds to localhost so it is never exposed by accident.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { spawn } from 'node:child_process';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { dirname, join } from 'node:path';
|
|
9
|
+
import { startGateway } from '../dist/server.js';
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const staticDir = join(here, '..', 'dist', 'web');
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
const port = Number(process.env.PORT ?? 8717);
|
|
15
|
+
const host = process.env.HOST ?? '127.0.0.1';
|
|
16
|
+
const url = `http://${host}:${port}`;
|
|
17
|
+
|
|
18
|
+
startGateway({ port, host, staticDir });
|
|
19
|
+
|
|
20
|
+
console.log(`\n DeskSSH is running at ${url}\n Press Ctrl+C to stop.\n`);
|
|
21
|
+
|
|
22
|
+
if (process.env.DESKSSH_NO_OPEN !== '1') openBrowser(url);
|
|
23
|
+
|
|
24
|
+
function openBrowser(target) {
|
|
25
|
+
const cmd =
|
|
26
|
+
process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
27
|
+
try {
|
|
28
|
+
spawn(cmd, [target], {
|
|
29
|
+
stdio: 'ignore',
|
|
30
|
+
detached: true,
|
|
31
|
+
shell: process.platform === 'win32',
|
|
32
|
+
}).unref();
|
|
33
|
+
} catch {
|
|
34
|
+
// Opening the browser is best-effort; the URL is printed above.
|
|
35
|
+
}
|
|
36
|
+
}
|