{"id":38283482,"url":"https://github.com/webx-top/tower","last_synced_at":"2026-01-17T02:01:07.611Z","repository":{"id":47728485,"uuid":"64107149","full_name":"webx-top/tower","owner":"webx-top","description":"基于反向代理的Golang即时编译工具，可在生产环境下无缝切换到新版本","archived":false,"fork":false,"pushed_at":"2025-12-28T04:37:02.000Z","size":13445,"stargazers_count":23,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-30T10:54:44.604Z","etag":null,"topics":["auto-compile","file-watcher","golang","live-reload","tower"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/webx-top.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-07-25T05:51:59.000Z","updated_at":"2025-12-28T04:36:02.000Z","dependencies_parsed_at":"2023-12-06T12:34:18.125Z","dependency_job_id":"fb8c4ac3-160f-4a5f-9e6a-02cc7d1a3d8e","html_url":"https://github.com/webx-top/tower","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/webx-top/tower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webx-top%2Ftower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webx-top%2Ftower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webx-top%2Ftower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webx-top%2Ftower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webx-top","download_url":"https://codeload.github.com/webx-top/tower/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webx-top%2Ftower/sbom","scorecard":{"id":278770,"data":{"date":"2025-07-07","repo":{"name":"github.com/webx-top/tower","commit":"f7adc5537f5836a5685f19958c51b0af84c9fc83"},"scorecard":{"version":"v5.2.1-18-gbb9c347d","commit":"bb9c347dff6349d986baab6578a46d68a5524c62"},"score":2.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#fuzzing"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#binary-artifacts"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: goCommand not pinned by hash: vendor/github.com/json-iterator/go/build.sh:10","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T15:11:27.195Z","repository_id":47728485,"created_at":"2025-08-17T15:11:27.196Z","updated_at":"2025-08-17T15:11:27.196Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28492047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"online","status_checked_at":"2026-01-17T02:00:07.808Z","response_time":85,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["auto-compile","file-watcher","golang","live-reload","tower"],"created_at":"2026-01-17T02:00:51.565Z","updated_at":"2026-01-17T02:01:07.507Z","avatar_url":"https://github.com/webx-top.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tower\r\n\r\nTower 是一个为golang的web开发者提供的工具。它会动态监控文件更改并自动重新编译运行您的golang源码。\r\n它采用了反向代理的方式，自动将用户的访问代理到新的程序，然后关闭并删除旧程序，这样就可以最大限度的做到零下线升级您的golang应用。\r\n\r\n如果编译失败或出现异常，Tower会通过一个整洁的页面显示这些信息：\r\n[![](https://github.com/webx-top/tower/blob/master/test/trace.png?raw=true)](https://github.com/webx-top/tower/blob/master/test/trace.png)\r\n\r\n## 安装\r\n```bash\r\ngo get github.com/webx-top/tower\r\n```\r\n\r\n## 使用方法\r\n\r\n```bash\r\ncd your/project\r\ntower # 现在访问 localhost:8080\r\n```\r\n\r\nTower 在默认情况下假设你golang应用的端口为 _5001-5050_。你可以按如下方式更改它:\r\n\r\n```bash\r\ntower -p 3000-4000\r\n```\r\n\r\n\r\n当需要编译单个go文件时，您可以通过`-m`来指定:\r\n\r\n```bash\r\ntower -m app.go -p 3000-4000\r\n```\r\n\r\n或把它们放入配置文件:\r\n\r\n```bash\r\ntower init\r\nvim tower.yml\r\ntower\r\n```\r\n\r\n## 常见问题\r\n\r\n#### 'Too many open files'\r\n\r\n运行下面的命令提高进程可打开的文件数量:\r\n\r\n```bash\r\nulimit -S -n 2048 # OSX\r\n```\r\n\r\n## 工作原理\r\n\r\n```\r\n浏览器访问: http://localhost:8080\r\n      \\/\r\ntower (监听 8080 端口)\r\n      \\/ (反向代理)\r\n你的golang应用 (监听 5001 至 5050 中的任意一个端口)\r\n```\r\n\r\n所有来自localhost:8080的提交Tower都会转发给你的应用。\r\n转发使用的是 _[httputil.ReverseProxy](http://golang.org/pkg/net/http/httputil/#ReverseProxy)_。\r\n在转发之前，如果您的应用没有运行或文件被更改，Tower将在其它进程中自动编译并运行你的应用; \r\nTower 使用了 _[howeyc/fsnotify](https://github.com/howeyc/fsnotify)_ 来监控文件更改。\r\n\r\n## 管理接口\r\n通过管理接口您可以临时关闭自动编译功能。\r\n\r\n      默认情况下，只有本地可以访问管理接口，您可以通过在配置文件中设置`admin_pwd`(指定访问密码，通过在网址中增加“?pwd=\u003c你的密码\u003e”来访问)或`admin_ip`(指定允许访问的IP地址，多个用半角逗号隔开)来灵活设置。\r\n\r\n要临时关闭自动编译功能只需要访问：http://localhost:8080/tower-proxy/watch/pause\r\n\r\n重新开启自动编译：http://localhost:8080/tower-proxy/watch/begin\r\n\r\n查看是否开启自动编译：http://localhost:8080/tower-proxy/watch\r\n\r\n## Tower在生产环境中的应用\r\n在生产环境中，我们一般都是放一个编译好的可执行文件上去，并执行此文件来启动web服务。\r\n\r\n当需要更新此程序时，我们就需要停止服务，这样就会导致web服务中断，体验不佳。\r\n\r\n而这时，使用Tower就可以避免这个问题，只要可执行文件名称符合这样的格式`tower-app-\u003c纯数字版本编号\u003e.exe`或`tower-app-\u003c纯数字版本编号\u003e`，\r\n并且将该文件放到被监控的目录中，Tower就会自动发现它，并自动提取出`\u003c纯数字版本编号\u003e`来和已经运行的版本编号进行比较，\r\n当前者大于后者时，Tower会自动启动大版本程序，并将所有访问转发给它，\r\n然后关闭并删除小版本程序，在此过程中服务不会中断。\r\n\r\n## License\r\n\r\nTower is released under the [MIT License](http://www.opensource.org/licenses/MIT).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebx-top%2Ftower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebx-top%2Ftower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebx-top%2Ftower/lists"}