{"id":18129226,"url":"https://github.com/jkawamoto/ambassadors","last_synced_at":"2025-04-15T12:19:49.447Z","repository":{"id":25863649,"uuid":"29303552","full_name":"jkawamoto/ambassadors","owner":"jkawamoto","description":"Yet another Ambassador pattern over SSH","archived":false,"fork":false,"pushed_at":"2017-10-28T18:56:07.000Z","size":228,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T12:19:19.467Z","etag":null,"topics":["ambassador","connection","docker","secure","security"],"latest_commit_sha":null,"homepage":"https://jkawamoto.github.io/ambassadors/","language":"Shell","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/jkawamoto.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}},"created_at":"2015-01-15T15:26:31.000Z","updated_at":"2021-12-22T07:46:26.000Z","dependencies_parsed_at":"2022-07-16T23:07:13.038Z","dependency_job_id":null,"html_url":"https://github.com/jkawamoto/ambassadors","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fambassadors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fambassadors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fambassadors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fambassadors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkawamoto","download_url":"https://codeload.github.com/jkawamoto/ambassadors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249067788,"owners_count":21207397,"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":["ambassador","connection","docker","secure","security"],"created_at":"2024-11-01T10:07:42.734Z","updated_at":"2025-04-15T12:19:49.420Z","avatar_url":"https://github.com/jkawamoto.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"AmbassadorS\n============\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n[![Dockerhub](https://img.shields.io/badge/dockerhub-jkawamoto%2Fambassadors-blue.svg)](https://hub.docker.com/r/jkawamoto/ambassadors/)\n[![Image information](https://images.microbadger.com/badges/image/jkawamoto/ambassadors.svg)](http://microbadger.com/images/jkawamoto/ambassadors)\n[![Release](https://img.shields.io/badge/release-1.0.1-brightgreen.svg)](https://github.com/jkawamoto/ambassadors/releases/tag/v1.0.1)\n[![Japanese](https://img.shields.io/badge/qiita-%E6%97%A5%E6%9C%AC%E8%AA%9E-brightgreen.svg)](http://qiita.com/jkawamoto/items/4b87d0f61ab3fbbd2897)\n\n![Logo](https://jkawamoto.github.io/ambassadors/img/secure-link.png)\n\nYet another [Ambassador pattern](https://docs.docker.com/engine/admin/ambassador_pattern_linking/) over SSH.\n\n\nInstall\n--------\nYou can pull a built container.\n\n```sh\n$ docker pull jkawamoto/ambassadors\n```\n\nIf you are running on Raspberry Pi, you can pull it instead.\n\n```sh\n$ docker pull jkawamoto/rpi-ambassadors\n```\n\n\nUsage\n-------\n~~~\n$ docker run -dt jkawamoto/ambassadors (server|client|tunnel) [-v]\n\nOptions:\n  -v           Verbose mode for debugging.\n~~~\n\nAmbassadorS has three modes; server, client, and tunnel.\nThose modes are associated as follows.\n\n~~~\n(a container) ---\u003e (AmbassadorS client) ---\u003e (AmbassadorS tunnel)\n              == ssh ==\u003e (AmbassadorS server) ---\u003e (service containers)\n~~~\n\nYou need one server-mode container on a host which has containers to be linked, i.e. *service containers*,\nand one tunnel-mode container on each \"client\" host.\nYou also need client-mode containers for every linking container.\n\n\nExample\n--------\nSuppose you have MySQL and MongoDB containers on host *A*, and a container on host *B* wants to link them,\nyou firstly need to run a server-mode container linking the MySQL and MongoDB containers on host *A*.\n\n```sh\n$ docker run -d --name ambassadors_server \\\n             -v ~/.ssh/:/data/ -p 10022:22 \\\n             --link mongo:mongo --link mysql:mysql \\\n             jkawamoto/ambassadors server\n```\n\nThe server-mode container requires `authorized_keys` in `/data/` and to expose port `22` for sshd.\nIn this example, `authorized_keys` of host *A* will be used from the server-mode container.\nThe server-mode container also needs to link service containers.\nIn this case, it links to containers named mongo and mysql.\n\nOn host *B*, you need to run a tunnel-mode container.\n\n```sh\n$ docker run -dt --name ambassadors_tunnel \\\n            -v ~/.ssh:/root/.ssh -e PORT=10022 -e HOST=\u003chost a\u003e \\\n            jkawamoto/ambassadors tunnel\n```\n\nThe environment variable `HOST` is the address for host *A* and `PORT` is specified the port number of sshd.\nThe tunnel-mode container requires a private key of which the related public key `id_rsa` is included in the `authorized_keys` put on the server-mode container.\nThe private key needs to be put in `/root/.ssh`.\nIn this example, `id_rsa` of host *B* will be used from the tunnel-mode container.\n\nYou also need to run client-mode containers for MySQL and MongoDB.\n\n```sh\n$ docker run -d --name mysql_ambassadors \\\n             --link ambassadors_tunnel:tunnel --expose 3306 -e PORT=3306 \\\n             jkawamoto/ambassadors client\n$ docker run -d --name mongo_ambassadors \\\n             --link ambassadors_tunnel:tunnel --expose 27017 -e PORT=27017 \\\n             jkawamoto/ambassadors client\n```\n\nThose client-mode containers must link the tunnel-mode container with name `tunnel` and expose as same port as service containers expose.\nIn this case, the client-mode container for MySQL exposes `3306` while the mysql container exposes `3306`.\nThose client-mode containers also need to set environment variable `PORT` as the exposed port number.\n\nFinally, you can use MySQL and MongoDB running on host *A* from host *B*.\n\n```sh\n$ docker run -d --link mysql_ambassadors:mysql --link mongo_ambassadors:mongo some-app\n```\n\nLicense\n=======\nThis software is released under the MIT License, see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkawamoto%2Fambassadors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkawamoto%2Fambassadors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkawamoto%2Fambassadors/lists"}