Integrate Mattermost as a Nextcloud app

Greetings!

Since Nextcloud is a great solution for collaborative work with files, calendar and tasks but misses means for well structured communication and Mattermost is a great solution for well structured communication but misses well structured files, calendar and task management, I’d like to integrate Mattermost as a Nextcloud app as can be seen in the screenshot below and I’m looking for developers to join me.

This, combined with some wiki app to document structures and processes in an organization, would probably make the bestest intranet/collaboration software evor!

Mattermost should be embedded in an iframe and Nextcloud should automatically synchronize its users and groups to Mattermost, such that every group corresponds to one Mattermost team. Which group should be synchronized could be specified via the “Limit to groups” app setting in Nextcloud. Users should automatically become signed in to Mattermost when opening the app.

Tighter integration of calendar events, deck cards and file sharing into Mattermost could be added later.

I have taken a look at the Mattermosts API and plugin reference and the Nextclouds app dev documentation and wrote a first Version of a Mattermost Plugin that allows automatically signing in users to Mattermost. This Bash script demonstrates the part of the Nextcloud server. I’ve already built a first hacky version of a Nextcloud app that embeds the Mattermost instance and signs the current user in, but I’ll need to polish it a little and replace hard coded values with app settings before pushing it to GitHub. The synchronization and session management will take more effort though.

Here is some discussion in the Mattermost community.

This would solve this feature request.

3 Likes

This GitHub issue is related.

Here are the Mattermost API, the PHP driver and the Plugin reference.

The free edition of Mattermost does not support limiting users ability to leave teams, change their name, user ID etc. but the plugin can hide those options from the web interface by adding some css rules and a reverse proxy could limit the allowed API calls. These solutions are slightly hackish but bearable IMO. A docker-compose setup could be developed to put everything together. Otherwise the synchronization with Nextcloud should be able to periodically reverse such changes too.

1 Like

That sounds intersting, you would then be able to connect nextcloud to any instance of mattermost on any server?

While there seem to be some parallells with nextcloud talk, this seems to me like a worthy addition…

I forgot one more step that is required: Two security headers need to be stripped/changed from responses of the Mattermost server to allow embedding. I believe the Mattermost community provides an example NGINX configuration for that. Other than that, Nextcloud and Mattermost could be on any two servers. In case this integration becomes popular, maybe the Mattermost devs will allow to change these headers in the system console.

Here is the first version of the Nextcloud app. It now has an admin settings section where the Mattermost site URL, admin token and shared secret can be configured. It does not support user synchronization or proper management of Mattermost sessions yet though and should most certainly not be used in any production environment.

2 Likes

For the record, see Introducing the Nextcloud and Mattermost Integration! and GitHub - julien-nc/integration_mattermost: Mattermost integration in Nextcloud

1 Like