如何在源代码安装上将配置数据添加到gitlab?

时间:2016-09-20 21:24:52

标签: oauth configuration gitlab mattermost

我需要遵循gitlab中的某些说明。那些gitlab指令是 -

Manually (re)authorising GitLab Mattermost with GitLab
Authorise GitLab Mattermost

To do this, using browser navigate to the admin area of GitLab, Application section. Create a new application and for the callback URL use: http://mattermost.example.com/signup/gitlab/complete and http://mattermost.example.com/login/gitlab/complete (replace http with https if you use https).

Once the application is created you will receive an Application ID and Secret. One other information needed is the URL of GitLab instance.

Now, go to the GitLab server and edit the /etc/gitlab/gitlab.rb configuration file.

In gitlab.rb use the values you've received above:

mattermost['gitlab_enable'] = true
mattermost['gitlab_id'] = "12345656"
mattermost['gitlab_secret'] = "123456789"
mattermost['gitlab_scope'] = ""
mattermost['gitlab_auth_endpoint'] = "http://gitlab.example.com/oauth/authorize"
mattermost['gitlab_token_endpoint'] = "http://gitlab.example.com/oauth/token"
mattermost['gitlab_user_api_endpoint'] = "http://gitlab.example.com/api/v3/user"

Save the changes and then run sudo gitlab-ctl reconfigure.

If there are no errors your GitLab and GitLab Mattermost should be configured correctly.

我目前正在运行gitlab的源代码安装,我没有/etc/gitlab/gitlab.rb文件可供我使用。

  1. 如何在源代码而非omnibus软件包安装的gitlab实例中添加mattermost的配置?

  2. 我可以编辑哪些文件以及加载这些文件的rake命令是什么?

1 个答案:

答案 0 :(得分:0)

我在mattermost / config / config.json中输入了gitlab配置,并使用适当的端点以及机密和ID更新了我的设置。所需的正确信息来自gitlab gui。我在gitlab中创建了令牌,并将信息插入到mattermost中。由于我们的网络方式,我还必须编辑我的/ etc / hosts,但对大多数用户来说这不是必需的。

"GitLabSettings": {
    "Enable": true,
    "Secret": "abc123",
    "Id": "abc123",
    "Scope": "",
    "AuthEndpoint": "http://gitlab/oauth/authorize",
    "TokenEndpoint": "http://gitlab/oauth/token",
    "UserApiEndpoint": "http://gitlab/api/v3/user"
},

要获取令牌,请在gitlab内部 -

  1. 以管理员身份登录
  2. 转到个人资料设置
  3. 转到应用程序
  4. 在此处添加mattermost应用程序的令牌,并使用此数据填写mattermost中的配置文件。