roundcubemail-plugins-kolab/plugins/kolab_chat/config.inc.php.dist

39 lines
1.5 KiB
Text
Raw Normal View History

2018-07-03 10:44:27 +00:00
<?php
/*
Mattermost integration.
-----------------------
0. Current implementation requires user credentials to be the same
as in the Kolab server. Thanks to this we can auto-login users.
1. It has to use the same domain, if it's using different we have to use a proxy:
Following Apache config worked for me with kolab_chat_url=https://kolab.example.com/mattermost
Note: This should be simpler with Mattermost 5.1 (to be released soon).
2018-07-03 10:44:27 +00:00
ProxyPreserveHost Off
RewriteEngine On
RewriteCond %{REQUEST_URI} (/mattermost)?/api/v[0-9]+/(users/)?websocket [NC,OR]
2018-07-03 10:44:27 +00:00
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule (/mattermost)?(/api/v[0-9]+/(users/)?websocket) ws://mattermost.example.com:8065$2 [P,QSA,L]
ProxyPass /mattermost http://mattermost.example.com:8065
ProxyPass /static http://mattermost.example.com:8065/static
ProxyPass /help http://mattermost.example.com:8065/help
ProxyPass /api http://mattermost.example.com:8065/api
2018-07-03 10:44:27 +00:00
2. Enabling CORS connections in Mattermost config: AllowCorsFrom:"*"
*/
// Chat application name. For now only 'mattermost' is supported.
$config['kolab_chat_driver'] = 'mattermost';
// Chat application URL
$config['kolab_chat_url'] = 'https://mattermost.example.com';
// Enables opening chat in a new window (or tab)
$config['kolab_chat_extwin'] = false;
// Default channel to select when opening the chat app.
// Note: This has to be a channel ID.
$config['kolab_chat_channel'] = null;