{"id":21405367,"url":"https://github.com/karimsa/tnl","last_synced_at":"2025-03-16T16:51:03.945Z","repository":{"id":149731103,"uuid":"82753417","full_name":"karimsa/tnl","owner":"karimsa","description":"Reverse-tcp (over TLS) serial tunnel for remote serial administration.","archived":false,"fork":false,"pushed_at":"2017-02-25T07:45:24.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T21:03:58.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karimsa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-22T02:54:21.000Z","updated_at":"2017-02-23T23:44:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"6c1eaa9b-f398-4fd7-91dd-5d2c1be58e9d","html_url":"https://github.com/karimsa/tnl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Ftnl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Ftnl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Ftnl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karimsa%2Ftnl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karimsa","download_url":"https://codeload.github.com/karimsa/tnl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902293,"owners_count":20366259,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T16:24:47.614Z","updated_at":"2025-03-16T16:51:03.899Z","avatar_url":"https://github.com/karimsa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🕳️ tnl\n\nReverse-tcp (over TLS) serial tunnel for remote serial administration.\n\n - [Client setup](#client-setup)\n - [Server setup](#server-setup)\n - [License](#license)\n\n## Usage\n\nThe tunnel requires a reverse-tcp client and a server on a personal\nnetwork.\n\n### Client setup\n\nYou'll need:\n\n - Some sort of *nix OS\n - Latest stable node.js (developed on 6.10)\n - Serial to USB adapter\n\nTo setup the client, plop this repository onto your client device (I\nuse a raspberry pi 3). Now adjust the configuration by editing 'config.json'.\nIf you are using this remotely, I recommend get a [keymetrics](http://keymetrics.io)\naccount and [linking your client device](http://docs.keymetrics.io/docs/usage/setup/).\n\nIf you don't know the vendor ID and product ID of your serial adapter off by heart,\nyou should plug the device in, and run `npm run devices` and you will see a list of\ndevices that looks something like this:\n\n```sh\n$ npm run devices\n[vid:pid] My Serial Adapter (/dev/cu.adapter)\n```\n\nOnce you figure out which one is yours, save the 'vid' and 'pid' as the `DEV_VID`\nand `DEV_PID` in `config.json`.\n\nNext, you're going to want to generate SSH key \u0026 certificate pair that is unique to\nyour setup. To do this, go to the `ssl/` folder in this repo and run `./gen.sh`. You\nwill need to put your server behind some domain for the code to work and for proper SSL\nverification (configure this as your `SERVER_HOST` above). It also saves you money on buying\na static IP for your network since you can just change your IP on the domain. Once you have\nyour keypair, keep it safe. It'll be your only means of authentication.\n\nOnce you are satisfied with your config, run `npm install \u0026\u0026 npm start` which\nshould install your dependencies and get the client running via pm2. You can confirm\nthat the client started successfully by running `npm run monit` and your script should\nbe visible. Don't worry aboutt the errors that show up in the log, they're expected.\n\n*Once you spin up the client, you may wish to configure it to run on startup. This can\nbe done via pm2. Simply run `npm run startup`.*\n\n### Server setup\n\nYou'll need:\n\n - Any OS should do (though why would you want to use Windows?)\n - Latest stable node.js (developed on 6.10)\n - Network access\n - Control over your network (i.e. admin access to your router)\n\nFirst, setup your network so that port `8093` (or whatever port you configured above)\nis accessible publicly. If you have no idea what this means, you need to setup port\nforwarding on your router. If you know what you're doing, DMZ zones and connecting to\nyour modem are fine too (I'm not responsible for what other ports you leave open).\n\nNext, grab your public IP and setup the DNS of your domain to resolve properly.\n\nYou can now clone the repo locally, as long as you copy `ssl/client.crt` from your client\ndevice to your server. Grab the dependencies by running `npm install`. Whenever you'd like\nto connect to your serial device, simply run `node server`.\n\n*Note: Before each run of `node server`, you can edit the local `config.json` file to change\nyour serial settings like baud rate and parity. These options are not read from file on the client,\nthey're sent when you connect. So don't worry if you have to make changes on the fly.*\n\n## License\n\nLicensed under [MIT license](LICENSE).\nCopyright \u0026copy; 2017 Karim Alibhai.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Ftnl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarimsa%2Ftnl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarimsa%2Ftnl/lists"}