# tunneltop
A tunnel manager in the familiar top style written with ncurses and asyncio.
![Image](tunneltop.png)
## Install
```sh
pip install tunneltop
```
## what it is
* a simple tunnel manager written in python that uses the standard library only(standard library only in python 3.11)
* it starts and manages the tunnels for you
* lets the user interactively manage the tunnels as well
* will reload the config file if it receives a `SIGHUP`
* it is intentionally written as simple and tunnel-agnostic
* may or may not work on windows(let me know if you test it on windows)
## toml file
tunneltop expects its config file to be at at `$HOME/.tunneltoprc`.
You can see an example config file below:</br>
```toml
[color]
header_fg = 4
header_bg = 0
active_fg = 23
active_bg = 0
disabled_fg = 8
disabled_bg = 0
timeout_fg = 63
timeout_bg = 0
unknown_fg = 38
unknown_bg = 0
down_fg = 208
down_bg = 0
box_fg = 22
box_bg = 0
[tunnel.socks5ir]
address = "127.0.0.1"
port = 9997
command = "autossh -M 0 -N -D 9997 -o ServerAliveInterval=180 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -l debian -p 22 100.100.100.101"
test_command = 'curl -s -o /dev/null -s -w "%{http_code}" -k -I -4 --socks5 socks5h://127.0.0.1:9997 https://icanhazip.com'
test_command_result = "200"
test_interval = 300
test_timeout = 10
auto_start = false
[tunnel.socks5_3]
address = "127.0.0.1"
port = 9995
command = "autossh -M 0 -N -D 0.0.0.0:9995 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no -o ServerAliveInterval=180 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -l debian -p 2022 100.100.100.100"
test_command = 'curl -s -o /dev/null -s -w "%{http_code}" -k -I -4 --socks5 socks5h://127.0.0.1:9995 https://icanhazip.com'
test_command_result = "200"
test_interval = 300
test_timeout = 10
auto_start = true
```
The tunnel names must be unique.</br>
### address
Displays the address at which the tunnel is available at. It is a display-only option.</br>
### port
Displays the port at which the tunnel is available at. It is a display-only option.</br>
### command
The command used to start the tunnel.</br>
### test_command
The command used to test the state of the tunnel.</br>
### test_command_result
The expected result of the test command.</br>
### test_interval
How often should the `test_command` be run.</br>
### test_timeout
How long before the test is considered to have timed out.</br>
### auto_start
Whether to automatically start this tunnel on startup.</br>
## keybindings
`j` and `k` move you up and down.</br>
`g` and `G`move you to the first or last tunnel.</br>
`s` toggles a tunnel from enabled to disabled or vice versa.</br>
`r` restarts a tunnel.</br>
`t` runs the test right now.</br>
To quit send a `SIGINT` or a `SIGTERM`. I'm working on improving this of course.</br>
tunneltop will reload its config file upon receiving a `SIGHUP` and apply the changes immediately if there are any.</br>
Raw data
{
"_id": null,
"home_page": "https://github.com/terminaldweller/tunneltop",
"name": "tunneltop",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.11,<4.0",
"maintainer_email": "",
"keywords": "tunnel,top,ssh",
"author": "terminaldweller",
"author_email": "devi@terminaldweller.com",
"download_url": "https://files.pythonhosted.org/packages/21/74/59e2e7c04d4cabbc722f7b0ebcfc19c3322a3c714340ec0900a010446cd4/tunneltop-0.4.4.tar.gz",
"platform": null,
"description": "# tunneltop\nA tunnel manager in the familiar top style written with ncurses and asyncio.\n\n![Image](tunneltop.png)\n\n## Install\n```sh\npip install tunneltop\n```\n\n## what it is\n* a simple tunnel manager written in python that uses the standard library only(standard library only in python 3.11)\n* it starts and manages the tunnels for you\n* lets the user interactively manage the tunnels as well\n* will reload the config file if it receives a `SIGHUP`\n* it is intentionally written as simple and tunnel-agnostic\n* may or may not work on windows(let me know if you test it on windows)\n\n## toml file\n\ntunneltop expects its config file to be at at `$HOME/.tunneltoprc`.\n\nYou can see an example config file below:</br>\n```toml\n[color]\nheader_fg = 4\nheader_bg = 0\nactive_fg = 23\nactive_bg = 0\ndisabled_fg = 8\ndisabled_bg = 0\ntimeout_fg = 63\ntimeout_bg = 0\nunknown_fg = 38\nunknown_bg = 0\ndown_fg = 208\ndown_bg = 0\nbox_fg = 22\nbox_bg = 0\n\n[tunnel.socks5ir]\naddress = \"127.0.0.1\"\nport = 9997\ncommand = \"autossh -M 0 -N -D 9997 -o ServerAliveInterval=180 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -l debian -p 22 100.100.100.101\"\ntest_command = 'curl -s -o /dev/null -s -w \"%{http_code}\" -k -I -4 --socks5 socks5h://127.0.0.1:9997 https://icanhazip.com'\ntest_command_result = \"200\"\ntest_interval = 300\ntest_timeout = 10\nauto_start = false\n\n[tunnel.socks5_3]\naddress = \"127.0.0.1\"\nport = 9995\ncommand = \"autossh -M 0 -N -D 0.0.0.0:9995 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=no -o ServerAliveInterval=180 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -l debian -p 2022 100.100.100.100\"\ntest_command = 'curl -s -o /dev/null -s -w \"%{http_code}\" -k -I -4 --socks5 socks5h://127.0.0.1:9995 https://icanhazip.com'\ntest_command_result = \"200\"\ntest_interval = 300\ntest_timeout = 10\nauto_start = true\n```\n\nThe tunnel names must be unique.</br>\n\n### address\nDisplays the address at which the tunnel is available at. It is a display-only option.</br>\n\n### port\nDisplays the port at which the tunnel is available at. It is a display-only option.</br>\n\n### command\nThe command used to start the tunnel.</br>\n\n### test_command\nThe command used to test the state of the tunnel.</br>\n\n### test_command_result\nThe expected result of the test command.</br>\n\n### test_interval\nHow often should the `test_command` be run.</br>\n\n### test_timeout\nHow long before the test is considered to have timed out.</br>\n\n### auto_start\nWhether to automatically start this tunnel on startup.</br>\n\n## keybindings\n`j` and `k` move you up and down.</br>\n\n`g` and `G`move you to the first or last tunnel.</br>\n\n`s` toggles a tunnel from enabled to disabled or vice versa.</br>\n\n`r` restarts a tunnel.</br>\n\n`t` runs the test right now.</br>\n\nTo quit send a `SIGINT` or a `SIGTERM`. I'm working on improving this of course.</br>\n\ntunneltop will reload its config file upon receiving a `SIGHUP` and apply the changes immediately if there are any.</br>\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "A top-like tunnel manager",
"version": "0.4.4",
"project_urls": {
"Homepage": "https://github.com/terminaldweller/tunneltop",
"Repository": "https://github.com/terminaldweller/tunneltop"
},
"split_keywords": [
"tunnel",
"top",
"ssh"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31fe90eb81366bef46d93d3137ddfc1b91f487881412fb0d4bd5ab45094d5e10",
"md5": "eb097dd1b5908eaa3572b059485546a1",
"sha256": "c50fc73dd4b31bb3587897da0a9f3df9c8886d9b4fcc4190f8c183fbfc6eaa58"
},
"downloads": -1,
"filename": "tunneltop-0.4.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eb097dd1b5908eaa3572b059485546a1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11,<4.0",
"size": 33443,
"upload_time": "2023-11-09T00:53:07",
"upload_time_iso_8601": "2023-11-09T00:53:07.784354Z",
"url": "https://files.pythonhosted.org/packages/31/fe/90eb81366bef46d93d3137ddfc1b91f487881412fb0d4bd5ab45094d5e10/tunneltop-0.4.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "217459e2e7c04d4cabbc722f7b0ebcfc19c3322a3c714340ec0900a010446cd4",
"md5": "5334f4c68fbea11ccd13085ee9154bb1",
"sha256": "7cf6de30830a490b6dbaafad2b02d3adb516a518dd79a4291a0241a2ceafbf97"
},
"downloads": -1,
"filename": "tunneltop-0.4.4.tar.gz",
"has_sig": false,
"md5_digest": "5334f4c68fbea11ccd13085ee9154bb1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11,<4.0",
"size": 21621,
"upload_time": "2023-11-09T00:53:09",
"upload_time_iso_8601": "2023-11-09T00:53:09.293793Z",
"url": "https://files.pythonhosted.org/packages/21/74/59e2e7c04d4cabbc722f7b0ebcfc19c3322a3c714340ec0900a010446cd4/tunneltop-0.4.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-09 00:53:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "terminaldweller",
"github_project": "tunneltop",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "tunneltop"
}