LoginSignup
3
5

More than 5 years have passed since last update.

GitLab Mattermostを有効化してみた

Last updated at Posted at 2017-09-27

環境

CentOS 7.4
GitLab Community Edition 9.5.5

作業開始

公式ドキュメントはこちら
https://docs.gitlab.com/omnibus/gitlab-mattermost/

GitLabはインストール済み。

Mattermost用のURLを用意する

以下のようにgitLabと同ドメインでポートで分けたい。
gitLabのURL: http://gitlab.example.com/
MattermostのURL: http://gitlab.example.com:999/

ポートを開ける。

$ firewall-cmd --zone=public --add-port=999/tcp --permanent
$ firewall-cmd –-reload

確認

$ firewall-cmd --list-all

ports: 999/tcp が追加されてたのでOK

Mattermostを有効化

コメントを外してURL指定→reconfigure

/etc/gitlab/gitlab.rb
mattermost_external_url 'http://gitlab.example.com:999/'
$ gitlab-ctl reconfigure

これだけで http://gitlab.example.com:999/ にアクセスするとサインイン画面が表示されました

サインインしようと思ったら…

エラー
Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.

このあたりを参考にして設定を見てみる

/etc/gitlab/gitlab-secrets.json
    "mattermost": {
    # 省略
        "gitlab_secret": "xxxxx",
        "gitlab_id": "xxxxxx",
    # 省略
      }

管理画面(http://gitlab.example.com/admin/applications) を見ると、
「GitLab Mattermost」という名前で自動的にapplicationが作成されていたのですが、
gitlab_secretとgitlab_idの値が違っている。

どうやら、そのまえにいろいろいじくって設定していたgitlab_idとgitlab_secretが
gitlab-secrets.json にそのまま残っちゃってたみたいです。

/etc/gitlab/gitlab-secrets.json の方を直接編集し、再度reconfigure

$ vi /etc/gitlab/gitlab-secrets.json
$ gitlab-ctl reconfigure

無事にサインインできました:v:

gitlab-secrets.json を直接編集せずに、gitlab.rbmattermost['gitlab_id']mattermost['gitlab_secret']
設定してもうまくいきそうなかんじですが(未確認)、
gitlab.rb をできるだけデフォ状態にしておきたかったので直接編集しました。

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5