Jenkins和GitHub webhook:HTTP 403 [英] Jenkins and GitHub webhook: HTTP 403

查看:1037
本文介绍了Jenkins和GitHub webhook:HTTP 403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个GitHub仓库,我希望通过post-receive钩子通知Jenkins新的提交。我已将GitHub插件安装到Jenkins中,并允许Jenkins管理它自己的挂钩网址。该项目具有正确的git存储库URL,并被指示在将更改推送到GitHub时进行构建。当我有GitHub发送一个测试有效载荷时,我在nginx网络服务器的前面Jenkins找到了这个:

I have a GitHub repository which I would like to have notify Jenkins of new commits via a post-receive hook. I've installed the GitHub plugin into Jenkins and have allowed for Jenkins to manage it's own hook URLs. The project has the correct git repository URL and is instructed to "Build when a change is pushed to GitHub". When I have GitHub send a test payload I find this in the nginx webserver that front's Jenkins:

207.97.227.233 - - [15/Sep/2011:07:36:51 +0000] "POST /github-webhook/ HTTP/1.1" 403 561 "-" "-"

我正在运行SSL,因此我将其禁用至无效。我需要为权限矩阵中的匿名用户提供特殊权限吗?

I was running SSL so I disabled it to no effect. Do I need to provide special permissions to an anonymous user in the permissions matrix?

请原谅缺少配置文件:我很乐意分享那些可能存在的我不知道什么可能是有用的共享。

Please forgive the lack of configuration files: I'm happy to share those that might exist but I don't know what might be useful to share.

推荐答案

因为我不允许匿名访问,事实证明我需要为GitHub推送创建一个特定的用户并授予它全面阅读,作业创建和作业阅读。还有必要将身份验证绑定到webhook URL中,如下所示:

As I don't allow anonymous access, it turns out I needed to create a specific user for GitHub pushes and to grant it Overall read, Job create and Job read. It was also necessary to bundle the authentication into the webhook URL, like so:

https://foo:password@jenkins.example.com/github-webhook/

这篇关于Jenkins和GitHub webhook:HTTP 403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆