{"id":16314847,"url":"https://github.com/forecho/ig11","last_synced_at":"2025-09-17T15:45:32.697Z","repository":{"id":147509577,"uuid":"230867362","full_name":"forecho/ig11","owner":"forecho","description":null,"archived":false,"fork":false,"pushed_at":"2019-12-31T10:35:10.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-25T07:22:19.487Z","etag":null,"topics":[],"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/forecho.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}},"created_at":"2019-12-30T07:14:39.000Z","updated_at":"2019-12-31T10:32:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"bd46f253-322f-42f2-b518-eb95a4fda6b3","html_url":"https://github.com/forecho/ig11","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"61d2d1333f6bf616338a6454a898f705c39ba08b"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forecho%2Fig11","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forecho%2Fig11/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forecho%2Fig11/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forecho%2Fig11/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forecho","download_url":"https://codeload.github.com/forecho/ig11/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239161778,"owners_count":19592321,"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":[],"created_at":"2024-10-10T21:55:25.924Z","updated_at":"2025-09-17T15:45:27.625Z","avatar_url":"https://github.com/forecho.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub WebHooks 部署工具\n\n## 使用\n\n使用配置文件\n\n```sh\ncp config_example.json config.json\n```\n\n修改配置文件内容，参数说明参考代码 [mian.go](https://github.com/forecho/ig11/blob/master/main.go#L12) 的代码。\n\n\n## 部署\n\n### 配置服务器\n\n本地或者此工具所放置的服务器生成 `ssh` 密钥：\n\n```sh\nssh-keygen -t rsa -b 4096 -C \"deploy\" -f ~/.ssh/deploy\n```\n\n然后把 `~/.ssh/deploy.pub` 文件内容依次拷贝到 `config` 配置的服务器的 `~/.ssh/authorized_keys` 文件中\n\n\n### 其他配置（参考）\n\n如果部署的是私有项目，可参考下面的设置：\n\n方案一：（推荐）\n\n- 去 \u003chttps://github.com/settings/tokens\u003e 生成一个只读的 token\n- 然后 `config.json` 文件中的 `git_url` 设置为 `https://\u003ctoken\u003e@github.com/forecho/blog.git` 类似格式地址\n\n\n方案二：\n\n- 给 GitHub 项目配置 `Deploy keys`，找到具体项目的 Settings 页面，然后找到 Deploy keys，然后可以把上面生成的公钥添加上去。（建议不要勾选 `Allow write access`，不勾选只具备拉取权限)\n- 然后还要执行以下命令：\n\n```\nssh-add ~/.ssh/deploy\nssh-add -l\n```\n\n### 部署\n\n去 [Releases](https://github.com/forecho/ig11/releases) 页面下载已经打包好的 Linux 版本，然后在服务器上执行下面命令即可部署。\n\n```shell\nmkdir -p /var/log/app/ig11/ \u0026\u0026 touch /var/log/app/ig11/script.log\n/usr/bin/nohup $PWD/ig11 \u003e /var/log/app/ig11/script.log 2\u003e\u00261 \u0026\n```\n\n检查确认命令：\n\n```shell\nlsof -i:8090\nps -ax | grep ig11\n```\n\n注：\n\n- 默认是 8090 端口，目前只能通过修改代码来修改\n- 每次修改配置文件之后，要 kill 掉进程，然后再开启\n\n\n## 使用\n\n### 基于 GitHub WebHooks\n\n部署完了之后就去 GitHub 对应的项目配置 WebHooks，找到具体项目的 Settings 页面，然后找到 Webhooks，然后添加就可以了.\n\n- `Payload URL`：如果你没有使用 nginx 配置反向代理的话，这里写 `你服务器的ip:8090`\n- `Content type`：默认就可以\n- `Secret`：自己随机生成，与你第一步配置文件一致就可以\n- `events`：选 `Send me everything.` 或者自定义事件中的 `Releases` (本项目只有收到 `Releases` 事件才触发部署)\n\n### 单独使用\n\n使用 curl 命令发送请求\n\n```sh\ncurl --request POST \\\n  --url http://127.0.0.1:8090/update \\\n  --header 'Content-Type: application/x-www-form-urlencoded' \\\n  --data secret=xxxxxxxxx\n```\n\n`url` 和 `secret` 改成你自己的配置","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforecho%2Fig11","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforecho%2Fig11","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforecho%2Fig11/lists"}