Skip to content

Commit 457e3aa

Browse files
author
mead
committed
default
1 parent d46059a commit 457e3aa

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

README.md

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
1-
# /gogs-webhook
1+
# Gogs-Lravel-webhook
22

3+
## 简介
34

5+
- 本项目是 Laravel 的一个扩展包,主要用与 Gogs 版本库的 webhook。
46

5-
## Installing
7+
## 安装步骤
68

7-
```shell
8-
$ composer require zh-mead//gogs-webhook -vvv
9-
```
9+
* 安装扩展包
1010

11-
## Usage
11+
~~~bash
12+
$ composer require zh-mead//gogs-webhook
13+
~~~
1214

13-
TODO
15+
* 发布配置文件
1416

15-
## License
17+
~~~bash
18+
$ php artisan vendor:publish --provider="ZhMead\GogsWebhook\GogsServiceProvider"
19+
~~~
1620

17-
MIT
21+
> 默认秘钥为 APP_KEY
22+
23+
* 配置 gogs webhook 钩子
24+
25+
## 注意事项
26+
* 部署服务器的秘钥应为 项目执行的用户和用户组(这里以 用户:www 用户组:www 为例)
27+
28+
* 目录下的 .git 文件 www 有访问的权限
29+
~~~bash
30+
$ chown -R www:www .git
31+
~~~
32+
33+
* 第一次需要手动克隆下来
34+
~~~bash
35+
$ sudo -Hu www git clone [仓库地址]
36+
~~~

src/GogsWebhook/Http/Controllers/WebHookController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function handle(Request $request)
3030

3131
protected function verify_webhook($hmac_header)
3232
{
33-
$token = config('gogs-webhook.webhook.app_secret', false);
33+
$token = config('gogs-webhook.webhook.app_secret', '');
3434
$data = file_get_contents('php://input');
3535
if (!$token) {
3636
exit('token is not null!');

src/config/gogs-webhook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
return [
1010
'webhook' => [
11-
'app_secret' => env('WEBHOOK_APP_SECRET', ''),
11+
'app_secret' => env('APP_KEY'),
1212
]
1313
];

0 commit comments

Comments
 (0)