0

I need to follow certain instructions in gitlab. Those gitlab instructions are -

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.

I am currently running a source install of gitlab and I do NOT have the /etc/gitlab/gitlab.rb file available to me.

  1. How would I add the configuration for mattermost in a gitlab instance that is installed from source and not by the omnibus package?

  2. What files do I edit and what is the rake command to load those files?

ILikeTurtles
  • 1,012
  • 4
  • 16
  • 47
  • If you install from source your config should be `gitlab.yml`. On that note tough, I don't think the mattermost integration is available for non omnibus installations. – Fairy Sep 21 '16 at 09:15
  • @Fairy Thanks a bunch. I was wondering why there weren't instructions for GitLab source users. – ILikeTurtles Sep 21 '16 at 12:45
  • I think they want everybody to use the omnibus packages because a source installation is error prone. – Fairy Sep 21 '16 at 13:05
  • @Fairy I was able to solve my issue after deleting the token inside of Gitlab and rebuilding it twice. It decided to work. Answer down below. – ILikeTurtles Oct 03 '16 at 13:16

1 Answers1

0

I entered the gitlab config at mattermost/config/config.json and updated my settings with the appropriate endpoints as well as secret and ID. The correct information needed came from the gitlab gui. I created the tokens within gitlab proper and plugged the information into mattermost. I also had to edit my /etc/hosts due to the way our network is but this should not be necessary for most users.

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

To get to the token, inside gitlab -

  1. Login as an admin
  2. Go to profile settings
  3. Go to applications
  4. Add the token for the mattermost application here and use this data to fill out the config file in mattermost.
ILikeTurtles
  • 1,012
  • 4
  • 16
  • 47