{"id":26990463,"url":"https://github.com/tanishq-dubey/harbormaster","last_synced_at":"2025-04-03T21:38:08.751Z","repository":{"id":50387476,"uuid":"221613925","full_name":"tanishq-dubey/harbormaster","owner":"tanishq-dubey","description":"A simple python script automating docker remote host forwarding","archived":false,"fork":false,"pushed_at":"2020-01-30T23:55:55.000Z","size":24,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-14T14:04:11.296Z","etag":null,"topics":["docker","python","socket","ssh"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tanishq-dubey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-14T04:48:22.000Z","updated_at":"2022-07-28T16:52:03.000Z","dependencies_parsed_at":"2022-09-02T10:11:32.627Z","dependency_job_id":null,"html_url":"https://github.com/tanishq-dubey/harbormaster","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanishq-dubey%2Fharbormaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanishq-dubey%2Fharbormaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanishq-dubey%2Fharbormaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tanishq-dubey%2Fharbormaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tanishq-dubey","download_url":"https://codeload.github.com/tanishq-dubey/harbormaster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247085972,"owners_count":20881157,"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":["docker","python","socket","ssh"],"created_at":"2025-04-03T21:38:08.199Z","updated_at":"2025-04-03T21:38:08.739Z","avatar_url":"https://github.com/tanishq-dubey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Harbor Master\n\n![](https://i.imgur.com/Q44BIZN.jpeg)\n\nHarbor Master is a simple script to help manage Docker remote socket forwarding.\n\nSpecifically, this script uses SSH forwarding to forward the Docker socket of a remote machine to your local environment. This is quite useful when running heavy Dockerized applications, which can be run on some remote/cloud server, while being treated as a local container.\n\nThe benefit Harbor Master provides is that not only does it maintain the SSH tunnel for the remote socket, but it _also port forwards exposed container ports_. This is a severe\noversight in the current Docker implementation, and Harbor Master just makes your life that much easier :^).\n\n## Pre-Installation\n\nHarbor Master requires Python3\n\nBefore you can use Harbor Master, you must have a trusted host that is already running docker. In addition you _must_ be using passwordless SSH to connect to this host and have\nalready done the key transfer. Harbor Master does not, and (probably) will not, manage/accept passwords for SSH connections. These are insecure and add unnecessary complexity. In\naddition, please read the SSH Configuration notes below to ensure your remote host has the proper configuration.\n\n## Installation\n\nHarbor Master is available on PiPY and can be installed via a `pip install harbormaster`, or `pip3 install harbormaster` if you have multiple python versions.\n\nAlternatively, you may clone this repository, install the docker python package as specified in the `requirements.txt`, and then copy `harbormaster.py` into your path.\n\n## Usage\n\n```\nusage: harbormaster.py [-h] [-p P] [-l P] [-v] user host\n\nAutomatically port forward the docker socket and container\n\npositional arguments:\n  user        User to SSH as\n  host        Host to SSH to\n\noptional arguments:\n  -h, --help  show this help message and exit\n  -p P        Local port for forwarded socket, default 2377\n  -l P        Legacy TCP port to use instead of socket for Docker API\n  -v          Verbose output\n```\n\nFor example:\n\n```\nharbormaster.py dubey 192.168.1.111\n```\n\nThis would connect to a machine on the IP `192.168.1.111` as user `dubey`, establishing a Docker socket tunnel on port 2377. Once this command is run, you can let the Harbor Master manage all the SSH tunnels necessary as containers go up and down.\n\n### Important Notes\n\n#### SSH Configuration\n\nMost \\*Nix distros come with sane defaults for the number of SSH connections allowed to a host, usually 10 concurrent connections. If you plan to have more than 10 ports forwarded,\nthen you must change the `sshd` config located at `/etc/ssh/sshd_config` and change the parameters:\n\n```\nMaxSessions 100\nMaxStartups 100\n```\n\nIn the above example, the host will accept 100 concurrent connections, allowing you to port forward 100 ports.\n\nIn addition it is highly recommended to disallow password SSH login, and only use SSH key files.\n\n### Version Notes\n\nAs of `v0.1`, Harbor Master assumes that you are using `zsh` and will modify your `~/.zshrc` file by appending a `export` statement that lets any new shell sessions use the forwarded Docker socket. Harbor Master does cleanup on shutdown: all SSH tunnels that are open, and any changes to the `.zshrc` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanishq-dubey%2Fharbormaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftanishq-dubey%2Fharbormaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftanishq-dubey%2Fharbormaster/lists"}