{"id":37865014,"url":"https://github.com/lixianmin/gonsole","last_synced_at":"2026-01-16T16:36:31.534Z","repository":{"id":64942100,"uuid":"268935213","full_name":"lixianmin/gonsole","owner":"lixianmin","description":"基于websocket的golang游戏框架和在线控制台系统","archived":false,"fork":false,"pushed_at":"2025-12-31T03:02:35.000Z","size":2764,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-04T04:20:15.789Z","etag":null,"topics":["command","console","golang","websocket"],"latest_commit_sha":null,"homepage":"","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/lixianmin.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,"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":"2020-06-03T00:10:00.000Z","updated_at":"2025-08-23T14:36:46.000Z","dependencies_parsed_at":"2023-02-17T13:31:10.822Z","dependency_job_id":"ade1a444-5450-40a3-8770-5e5aef40eb6c","html_url":"https://github.com/lixianmin/gonsole","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lixianmin/gonsole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixianmin%2Fgonsole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixianmin%2Fgonsole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixianmin%2Fgonsole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixianmin%2Fgonsole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lixianmin","download_url":"https://codeload.github.com/lixianmin/gonsole/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lixianmin%2Fgonsole/sbom","scorecard":{"id":594504,"data":{"date":"2025-08-11","repo":{"name":"github.com/lixianmin/gonsole","commit":"e2d8c844e9311e42feece238c67714b7e052ab4c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T22:48:32.409Z","repository_id":64942100,"created_at":"2025-08-20T22:48:32.415Z","updated_at":"2025-08-20T22:48:32.415Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479969,"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":["command","console","golang","websocket"],"created_at":"2026-01-16T16:36:30.820Z","updated_at":"2026-01-16T16:36:31.522Z","avatar_url":"https://github.com/lixianmin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## gonsole\n基于websocket的远程控制台系统\n\n\n\n-----\n#### 0x1 简述\n\n历数各类软件系统，你会发现每一个牛B的系统都会自带一个控制台，用于观察系统状态和调整系统参数，比如Linux, MySQL等。\n\n1. 支持自定义command：`server.RegisterCommand(cmd)`\n1. 支持自定义topic，订阅后可周期性推送数据到控制台：`server.RegisterTopic(topic)`\n1. 安全验证：对于关键的系统命令，可以设置`cmd.IsPublic=false`，这一类命令只能使用`auth`验证后才能使用\n1. 历史命令：输入history查看历史命令，输入 !98 执行历史命令列表中的第98命令\n1. Tab键命令补全\n\n\n\n----\n\n#### 0x2 基本命令图示\n\n##### 01 帮助中心 help\n\n\u003cimg src=\"https://raw.githubusercontent.com/lixianmin/gonsole/master/res/images/help.png?raw=true\"  style=\"zoom:50%\" /\u003e\n\n\n\n##### 02 日志列表 log.list\n\n\u003cimg src=\"https://raw.githubusercontent.com/lixianmin/gonsole/master/res/images/log.list.png?raw=true\"  style=\"zoom:50%\" /\u003e\n\n\n\n##### 03 命令输入框\n\n\u003cimg src=\"https://raw.githubusercontent.com/lixianmin/gonsole/master/res/images/inputbox.png?raw=true\"  style=\"zoom:50%\" /\u003e\n\n\n\n\n----\n#### 0x3 Demo\n1. 直接运行examples/demo/main.go\n1. 在浏览器中输入 http://127.0.0.1:8888/console\n1. 按提示在文件框中输入help命令，查看帮助信息\n1. 可以通过查看main.go的源代码，学习如何注册command和topic\n\n\n\n部分代码如下：\n\n```go\nfunc main() {\n\tvar webPort = 8888\n\tvar mux = http.NewServeMux()\n\tvar server = gonsole.NewServer(mux,\n\t\tgonsole.WithPort(webPort),                                      // webserver端口\n\t\tgonsole.WithPageTemplate(\"console.html\"),                       // 页面文件模板\n\t\tgonsole.WithUserPasswords(map[string]string{\"xmli\": \"123456\"}), // 认证使用的用户名密码\n\t\tgonsole.WithEnablePProf(true),                                  // 开启pprof\n\t)\n\n\tserver.RegisterCommand(\u0026gonsole.Command{\n\t\tName:     \"hi\",\n\t\tNote:     \"打印 hi console\",\n\t\tIsPublic: false,\n\t\tHandler: func(client *gonsole.Client, texts [] string) {\n\t\t\tvar bean struct {\n\t\t\t\tText string\n\t\t\t}\n\n\t\t\tbean.Text = \"hello world\"\n\t\t\tclient.SendBean(bean)\n\t\t},\n\t})\n}\n```\n\n\n\n----\n\n#### 0x4 Road Map\n\n1. 引入完整的登录验证方式\n2. ~~将项目中的js逐步过渡为Vue框架, 目标是梳理代码框架, 通过import减小代码单元的大小~~\n3. ~~逐步使用typescript代替javascript, 引入编译机制~~\n4. 升级golang以引入泛型机制. 但这件事情在centos的yum默认支持到1.18+之前不能考虑. 目前(2022-09-03) 最新版本是golang 1.19。(centos目前官方不再更新)\n5. ~~逐步移除gaio这个库, 在golang 1.17+的centos上编译会报错, 它升级太慢了. [相关issue](https://github.com/xtaci/gaio/issues/21)~~\n6. 引入对https的支持, 或者至少设计出完整的支持方案. 在golang库中直接支持可能比在nginx上支持要更下简单一些, 毕竟会减少对nginx的依赖. ~~另外, gaio这个库似乎不支持https~~\n\n\n---\n#### 0x5 感谢JetBrains的免费License支持\n\n\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png\" style=\"zoom:20%\" /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixianmin%2Fgonsole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flixianmin%2Fgonsole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flixianmin%2Fgonsole/lists"}