{"id":19075233,"url":"https://github.com/martindai/http-shell","last_synced_at":"2025-07-27T23:33:52.164Z","repository":{"id":94738147,"uuid":"463043208","full_name":"MartinDai/http-shell","owner":"MartinDai","description":"可以通过http接口执行shell脚本","archived":false,"fork":false,"pushed_at":"2022-02-24T09:09:58.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T04:42:23.033Z","etag":null,"topics":["http","shell"],"latest_commit_sha":null,"homepage":"","language":"Go","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/MartinDai.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}},"created_at":"2022-02-24T07:02:39.000Z","updated_at":"2022-02-24T09:56:01.000Z","dependencies_parsed_at":"2023-07-29T06:15:14.921Z","dependency_job_id":null,"html_url":"https://github.com/MartinDai/http-shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MartinDai/http-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2Fhttp-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2Fhttp-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2Fhttp-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2Fhttp-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MartinDai","download_url":"https://codeload.github.com/MartinDai/http-shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MartinDai%2Fhttp-shell/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267441333,"owners_count":24087771,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"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":["http","shell"],"created_at":"2024-11-09T01:53:56.615Z","updated_at":"2025-07-27T23:33:52.123Z","avatar_url":"https://github.com/MartinDai.png","language":"Go","readme":"# http-shell\n\n提供通过http接口执行shell脚本的功能\n\n## 编译执行\n\n编译适合当前系统的可执行文件：\n```\nmake http-shell\n```\n\n编译全平台的可执行文件：\n```\nmake all\n```\n\n生成的可执行文件在bin目录下\n\n默认端口为8080，也可以通过`-p \u003cport\u003e`指定端口启动项目\n\n\n## Docker运行\n\n执行下面这行命令可以得到一个编译好的镜像\n```\ndocker build --no-cache -t http-shell:latest .\n```\n\n编译好镜像以后，执行下面的命令，可以后台启动项目\n```\ndocker run --name http-shell -p 8080:8080 -d http-shell:latest\n```\n\n## 接口介绍\n\n### /sh\n\n`/sh`接口支持使用sh命令运行指定的脚本\n\n使用示例\n```\ncurl --request POST 'http://127.0.0.1:8080/sh' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"shellPath\":\"/Users/martin/Downloads/test.sh\"\n}'\n```\n\n### /execShell\n\n`/execShell`接口支持运行指定的脚本\n\n使用示例\n```\ncurl --request POST 'http://127.0.0.1:8080/execShell' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"shellPath\":\"/Users/martin/Downloads/test.sh\"\n}'\n```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindai%2Fhttp-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartindai%2Fhttp-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartindai%2Fhttp-shell/lists"}