0

使用gitea登陆grafana

 1 year ago
source link: https://www.bboy.app/2022/08/11/%E4%BD%BF%E7%94%A8gitea%E7%99%BB%E9%99%86grafana/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

使用gitea登陆grafana

2022-08-11linux

20220811-3.webp

gitea是支持oauth2的,所以就想着grafana对接gitea,然后直接使用gitea登陆。

首先你要在gitea上创建一个应用

设置->应用->创建新的 OAuth2 应用程序

应用名称可以写grafana

重定向url写

https://你的grafana地址/login/generic_oauth

然后拿到客户端id和客户端密钥

之后配置grafana编辑grafana.ini

[auth.generic_oauth]
enabled = true
name = gitea
client_id = 客户端id
client_secret = 客户端密钥
scopes = user:email,read:org
auth_url = https://gitea地址/login/oauth/authorize
token_url = https://gitea地址/login/oauth/access_token
api_url = https://gitea地址/login/oauth/userinfo

然后重启grafana

这样就可以了

注意如果你在grafana已经有用户了,比如默认的admin,那么使用gitea登陆的时候,你的gitea用户的邮箱和grafana已经存在的用户的邮箱要保持一致这样才可以把用户对应上

欢迎关注我的博客www.bboy.app

Have Fun


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK