Mattermost === 的开源替代品 ,使用下面命令即可启动 ,并且可以直接使用。 运行容器 上面命令直接在命令行运行,就可以使用,通常情况我们想映射配置和存储,以便删除容器数据还存在,避免数据丢失。首先我们需要通过上面运行好的容器,将里面的配置拷贝出来。 挂载配置目录数据库目录运行 设置 Gitlab 单点登陆 这个功能官方说需要购买 Mattermost Enterprise Edition 版本,文档这里: GitLab Single Sign-On。 修改 mattermost 配置 。 您可以在GitLab服务器上运行GitLab Mattermost服务。,这篇文档介绍了修改 gitlab 配置。
Slack 的开源替代品 Mattermost,使用下面命令即可启动 Mattermost,并且可以直接使用。
docker run --name mattermost-preview \ --publish 8065:8065 \ --add-host dockerhost:127.0.0.1 \ --rm \ -d mattermost/mattermost-preview:5.4.0
上面命令直接在命令行运行,就可以使用,通常情况我们想映射配置和存储,以便删除容器数据还存在,避免数据丢失。首先我们需要通过上面运行好的容器,将里面的配置拷贝出来。
docker container cp mattermost-preview:/mm/mattermost/config $HOME/_docker/mattermost/
挂载配置目录数据库目录运行
docker run --name mattermost-preview \ --publish 8065:8065 \ --add-host dockerhost:127.0.0.1 \ -v $HOME/_docker/mattermost/config:/mm/mattermost/config \ -v $HOME/_docker/mattermost/mysql:/var/lib/mysql \ -v $HOME/_docker/mattermost/data:/mm/mattermost-data \ -d mattermost/mattermost-preview:5.4.0
这个功能官方说需要购买 Mattermost Enterprise Edition 版本,文档这里: GitLab Single Sign-On。
修改 mattermost 配置 vim $HOME/_docker/mattermost/config/config.json。
"GitLabSettings": { "Enable": true, "Secret": "{mattermost-app-secret-from-gitlab}", "Id": "{mattermost-app-application-id-from-gitlab}", "Scope": "", "AuthEndpoint": "https://{gitlab-site-name}/oauth/authorize", "TokenEndpoint": "https://{gitlab-site-name}/oauth/token", "UserApiEndpoint": "https://{gitlab-site-name}/api/v4/user" }
您可以在GitLab服务器上运行GitLab Mattermost服务。,这篇文档介绍了修改 gitlab 配置。
vim /etc/gitlab/gitlab.rb mattermost_external_url 'http://mattermost.example.com' gitlab_rails['mattermost_host'] = "https://mattermost.example.com"
下面这部分配置在 gitlab.rb 中设置,之后还需要在 mattermost 系统中设置 http://mattermost.example.com/admin_console/authentication/gitlab
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/v4/user"
如果您使用的是 GitLab Mattermost,请在系统控制台或 gitlab.rb 中配置您的站点URL。
在配置 vim $HOME/_docker/mattermost/config/config.json,这个目录是你挂载出来的配置目录文件,容器中实际目录 /mm/mattermost/config,修改下面内容。
"ServiceSettings": { "SiteURL": "http://mattermost.example.com", }