{"id":13416378,"url":"https://github.com/wrfly/container-web-tty","last_synced_at":"2026-01-16T15:32:56.714Z","repository":{"id":37333763,"uuid":"122944084","full_name":"wrfly/container-web-tty","owner":"wrfly","description":"Connect your containers via a web-tty","archived":false,"fork":false,"pushed_at":"2024-06-13T06:34:20.000Z","size":4184,"stargazers_count":242,"open_issues_count":8,"forks_count":45,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-07-31T21:56:29.489Z","etag":null,"topics":["containers","docker","terminal","tty","web-terminal","web-tty"],"latest_commit_sha":null,"homepage":"https://container-web-tty.kfd.me/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wrfly.png","metadata":{"files":{"readme":"README.ZH.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit/audit.go","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-26T09:15:35.000Z","updated_at":"2024-07-31T21:31:52.000Z","dependencies_parsed_at":"2023-01-24T13:15:55.536Z","dependency_job_id":"b5123d8c-a27a-4e05-97ec-cc127c7979a0","html_url":"https://github.com/wrfly/container-web-tty","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/wrfly/container-web-tty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fcontainer-web-tty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fcontainer-web-tty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fcontainer-web-tty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fcontainer-web-tty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wrfly","download_url":"https://codeload.github.com/wrfly/container-web-tty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wrfly%2Fcontainer-web-tty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["containers","docker","terminal","tty","web-terminal","web-tty"],"created_at":"2024-07-30T21:00:57.867Z","updated_at":"2026-01-16T15:32:56.682Z","avatar_url":"https://github.com/wrfly.png","language":"Go","readme":"# Container web TTY\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/wrfly/container-web-tty)](https://goreportcard.com/report/github.com/wrfly/container-web-tty)\n[![Master Build Status](https://travis-ci.org/wrfly/container-web-tty.svg?branch=master)](https://travis-ci.org/wrfly/container-web-tty)\n[![GoDoc](https://godoc.org/github.com/wrfly/container-web-tty?status.svg)](https://godoc.org/github.com/wrfly/container-web-tty)\n[![license](https://img.shields.io/github/license/wrfly/container-web-tty.svg)](https://github.com/wrfly/container-web-tty/blob/master/LICENSE)\n[![Docker Pulls](https://img.shields.io/docker/pulls/wrfly/container-web-tty.svg)](https://hub.docker.com/r/wrfly/container-web-tty)\n[![MicroBadger Size](https://img.shields.io/microbadger/image-size/wrfly/container-web-tty.svg)](https://hub.docker.com/r/wrfly/container-web-tty)\n[![GitHub release](https://img.shields.io/github/release/wrfly/container-web-tty.svg)](https://github.com/wrfly/container-web-tty/releases)\n[![Github All Releases](https://img.shields.io/github/downloads/wrfly/container-web-tty/total.svg)](https://github.com/wrfly/container-web-tty/releases)\n\n[English](README.md)\n\n当我们想进入某个容器内部的时候，通常会执行这个命令组合 `docker ps | grep xxx` \u0026\u0026 `docker exec -ti xxxx sh`，\n但老这样敲也是很烦，也许你可以试一下这个项目。\n\n虽然我很喜欢终端，但是我仍然希望有一个更好的工具来进入容器内部去做一些检查或者debug。所以我写了这个项目，它能够帮助你通过点击网页的方式\n进到容器里执行命令。初版的代码是基于[yudai/gotty](https://github.com/yudai/gotty)这个项目的，感谢yudai。\n\n后端可以对接docker或者kubectl。\n\n## 使用\n\n你可以从release页面下载二进制运行这个程序，但这里有一些“复制粘贴”的方法。\n\n### 通过 docker\n\n把`docker.sock`挂在到容器里就完事儿了\n\n```bash\ndocker run --rm -ti --name web-tty \\\n    -p 8080:8080 \\\n    -v /var/run/docker.sock:/var/run/docker.sock \\\n    wrfly/container-web-tty\n```\n\n### 通过 kubernetes\n\n你需要把kubernetes的配置文件挂进去，默认是在 `$HOME/.kube/config`，然后指定一下backed的类型，也就是`kube`\n\n```bash\ndocker run --rm -ti --name web-tty \\\n    -p 8080:8080 \\\n    -e WEB_TTY_BACKEND=kube \\\n    -e WEB_TTY_KUBE_CONFIG=/kube.config \\\n    -v ~/.kube/config:/kube.config \\\n    wrfly/container-web-tty\n```\n\n### 通过 gRPC （代理模式）\n\n当我们有很多server需要接入的时候，就可以使用这种模式把远程的`container-web-tty`们\n**merge** 到一起，典型的CS模式，通过gRPC通信。\n\n在一个界面上查看多台机器上的容器。\n\n#### 远程配置\n\n假如有两台机器 `192.168.66.1` 和 `192.168.66.2`，他们可以用如下的命令来启动`container-web-tty`\n\n```bash\ndocker run --rm -ti --name web-tty \\\n    -p 8080:8080 \\\n    -p 8090:8090 \\\n    -e WEB_TTY_GRPC_PORT=8090 \\\n    -e WEB_TTY_GRPC_AUTH=96ssW0rd \\\n    -v /var/run/docker.sock:/var/run/docker.sock \\\n    wrfly/container-web-tty\n```\n\n注意:\n\n- 你可以通过设置 `WEB_TTY_PORT=-1` 的方式来关闭HTTPserver，拒绝一般接入\n- 这个 `WEB_TTY_GRPC_AUTH` key 在所有机器上必须要相同（目前）\n\n#### 本地配置\n\n```bash\ndocker run --rm -ti --name web-tty \\\n    -p 8080:8080 \\\n    -e WEB_TTY_BACKEND=grpc \\\n    -e WEB_TTY_GRPC_AUTH=96ssW0rd \\\n    -e WEB_TTY_GRPC_SERVERS=192.168.66.1:8090,192.168.66.2:8090 \\\n    wrfly/container-web-tty\n```\n\n现在你就可以通过访问 *\u003chttp://localhost:8080\u003e* 来获取两台机器上所有的容器\n\n## 快捷键 (Linux)\n\n- Cut the word before the cursor `Ctrl+w` =\u003e **You cannot do it for now** (I'll working on it for `Ctrl+Backspace`, but I know little about js)\n- Copy:  `Ctrl+Shift+c` =\u003e `Ctrl+Insert`\n- Paste: `Ctrl+Shift+v` =\u003e `Shift+Insert`\n\n## 特性\n\n- [x] 能用了\n- [x] 对接 docker 后端\n- [x] 对接 kubectl 的后端\n- [x] 比较好看的前端界面\n- [x] start|stop|restart container(docker backend only)\n- [x] 代理模式 (本地连接到远程机器上的容器)\n- [x] 认证（仅限代理模式）\n- [x] 超时自动断开\n- [x] 历史记录审计\n- [x] 实时共享输入输出\n- [x] 容器日志\n- [x] 自定义执行命令\n- [x] 通过代理连接gRPC服务器\n\n## 效果展示\n\n列出所有容器:\n\n![list](images/list.png)\n\n在选择shell的时候，优选选择bash，如果没有，就依次选择ash，sh，再没有就退出了。\n\n`/bin/sh`:\n\n\u003cimg src=\"images/sh.png\" width=\"400\" height=\"150\"\u003e\n\n`/bin/bash`:\n\n\u003cimg src=\"images/bash.png\" width=\"400\" height=\"150\"\u003e\n\n运行指定命令:\n\n\u003cimg src=\"images/cmd.png\" width=\"400\" height=\"150\"\u003e\n\n查看容器日志:\n\n![logs](images/logs.png)","funding_links":[],"categories":["Container Operations","Go","terminal"],"sub_categories":["User Interface"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrfly%2Fcontainer-web-tty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwrfly%2Fcontainer-web-tty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwrfly%2Fcontainer-web-tty/lists"}