diff --git a/Readme.md b/Readme.md index aa94376..2835031 100644 --- a/Readme.md +++ b/Readme.md @@ -2,6 +2,11 @@ An ElectronJS + Photonkit application to ease certain application tunneling via [Meshcentral 2](https://github.com/Ylianst/MeshCentral). ## Dependencies +Client software: +- Putty +- FileZilla +- Microsoft Remote Desktop Client or rdesktop on Linux + ElectronJS should be installed. ``` npm i -g electron@latest @@ -30,6 +35,7 @@ Create config.json file to store your configuration. } ``` +For Unix/Linux, please see config_template_linux.json. ## How to run ``` @@ -51,6 +57,8 @@ For more custom application tunneling, new command list JSON is added to add mul ] } ``` +For Linux, see cmds-linux.json + Each entry need to have: * label: This will be used as the title * cmdexec: The path to binary/script to execute diff --git a/app.js b/app.js index e870fd0..2f1f998 100644 --- a/app.js +++ b/app.js @@ -46,7 +46,13 @@ function setPanel(number) { function loadCmds() { try { - var temp_obj = JSON.parse(fs.readFileSync("cmds.json")); + var platform = process.platform; + var temp_obj = {} + if (fs.existsSync("cmds-"+platform+".json")) { + temp_obj = JSON.parse(fs.readFileSync("cmds-"+platform+".json")); + } else { + temp_obj = JSON.parse(fs.readFileSync("cmds.json")); + } if (temp_obj != null && temp_obj.cmds != null && temp_obj.cmds.length != null) { cmds = {}; for (var j = 0; j < temp_obj.cmds.length; j++) { @@ -840,7 +846,12 @@ function sftpClicked() { function rdpClicked() { var data = readForm(); var exepath = data['rdp']; - var args = ['/v:127.0.0.1:lport']; + var args = [] + if (process.platform == 'linux') { + args = ['127.0.0.1:lport']; + } else { + args = ['/v:127.0.0.1:lport']; + } var tunnelcfg = { nodeid: data["nodeidhex"], port: 3389 diff --git a/cmds-linux.json b/cmds-linux.json new file mode 100644 index 0000000..8fc9633 --- /dev/null +++ b/cmds-linux.json @@ -0,0 +1,9 @@ +{ + "cmds" : + [ + { "id": 1, "label": "VNC to port 5901", "cmdexec": "/usr/bin/vncviewer", "cmdargs" : "127.0.0.1::lport","cmdport":"5901"}, + { "id": 2, "label": "VNC to port 5902", "cmdexec": "/usr/bin/vncviewer", "cmdargs" : "127.0.0.1::lport","cmdport":"5902"}, + { "id": 3, "label": "VNC to port 5903", "cmdexec": "/usr/bin/vncviewer", "cmdargs" : "127.0.0.1::lport","cmdport":"5903"}, + { "id": 4, "label": "SSH to port 22", "cmdexec": "/usr/bin/putty", "cmdargs" : "-ssh 127.0.0.1 -P lport","cmdport":"22"} + ] +} \ No newline at end of file diff --git a/config_template_linux.json b/config_template_linux.json new file mode 100644 index 0000000..951f128 --- /dev/null +++ b/config_template_linux.json @@ -0,0 +1,12 @@ +{ + "mesh_url": "https://meshcentral.com/", + "mesh_username": "mesh_username", + "save_password": true, + "ssh": "/usr/bin/putty", + "sftp": "/usr/bin/filezilla", + "rdp": "/usr/bin/rdesktop", + "use_proxy": true, + "proxy_type": "socks", + "proxy_host": "10.1.192.48", + "proxy_port": "1080", + "mesh_passwordb64": "bWVzaF9wYXNzd29yZA==" \ No newline at end of file diff --git a/index.html b/index.html index 5d5b4c4..f002b65 100644 --- a/index.html +++ b/index.html @@ -94,7 +94,7 @@

Settings

- RDP (MSTSC) + RDP (MSTSC/rdesktop)