Sentry开启 Github sso 配置(self-hosted)

东方谦
2023-12-01

开始

一旦 sso 被激活,所有已存在的用户将会收到一封邮件去连接他们的 sentry 账号(这个将会在 sso 配置好后自动发送
新用户将会通过 sso 创建一个默认角色为member的默认账号。

步骤

为 Sentry 开启 Github SSO,需要在 Github 和 Sentry 上配置。

Github 配置

创建一个新 Github App :

  • Create Github App: https://docs.github.com/en/developers/apps/building-github-apps/creating-a-github-app

  • Github App requires permissions and information to be filled in:https://develop.sentry.dev/self-hosted/sso/#create-github-app-for-sso–integration

  • Insatll Github App: https://docs.github.com/en/developers/apps/managing-github-apps/installing-github-apps#installing-your-private-github-app-on-your-repository

  • After installation,you need save the following information:

App ID
GitHub App name
Webhook secret
Client ID
Client Secret
private-key

Sentry 步骤

  • Update configuration with Github App infomation

in sentry/config.yaml(其中有两个配置与官方配置不同,因为官方要求最新版本python 版本最低为 python3 ,但是我本地是 python2)

github-app.id: <App ID>
github-app.name: '<GitHub App name>'
github-app.webhook-secret: '<Webhook secret>' # Use only if configured in GitHub
github-app.client-id: '<Client ID>'
github-app.client-secret: '<Client secret>'
github-login.client-secre: '<Client secret>' # 这个配置和官方文档有所不同
github-login.client-id: '<Client secret>' # 这个配置和官方文档有所不同
github-app.private-key: |
  -----BEGIN RSA PRIVATE KEY-----
  privatekeyprivatekeyprivatekeyprivatekey
  privatekeyprivatekeyprivatekeyprivatekey
  privatekeyprivatekeyprivatekeyprivatekey
  privatekeyprivatekeyprivatekeyprivatekey
  privatekeyprivatekeyprivatekeyprivatekey
  -----END RSA PRIVATE KEY-----
  • 重启生效
docker-compose restart
 类似资料: