mattermost
mattermost hat den Anspruch eine opensource-Alternativen zu dem bekannten Diensten slack und microsoft teams zu bieten. Es kann in Eigenregie betrieben werden. Es stehen zahlreiche Clients für Mobil- und Desktopbetriebssyteme zur Verfügung.
Wichtige Features (z.B. push aufs Handy bzw. Kanalbenachrichtigungen ohne Erwähnung, LDAP-Anbindung) erfordern eine enterprise-Version. Alternativ kann gitlab Oauth-backen dienen bzw. Mattermost-LDAP Module.
In version v5.32 kam die freie Sortierbarkeit von Kanälen dazu und eigene Kategorien, siehe https://mattermost.com/blog/custom-collapsible-channel-categories/. Ab Version 6.x zogen die Preise an und der Hersteller fing an mattermost als eine Art Produktivitätsplattform zu positionieren.
Links
Webhooks
Nützlich sind die webhooks, damit kann mattermost auch von anderen Programmen als Nachrichtenzentrale benutzt werden. Es sind HTTP POST mit JSON-Payload.
Installation
Leider existieren keine offiziellen Pakete, eigene Pakete können mit dem mattermost-packager erzeugt werden.
detaillierte Anleitungen für verschiedene Distributionen bzw. ein paar mehr oder weniger gute rollen auf ansible-galaxy.
Kurzanleitung
Hallo, mattermost ist unser Instant messenger, damit lassen sich für kleine Absprachen so einige mails (mit CC) sparen. Die Oberfläche ist so ähnlich wie slack und damit nicht so unübersichtlich wie teams in Sachen chat. Bei direkten Ansprachen "@all" im Channel oder "@Benutzername" bekommt man auch mails falls kein Client angemeldet ist. Das lässt sich aber einstellen. Clients für Handy/PC usw. bekommt ihr hier: https://mattermost.com/download/#
Konfiguration
Datei conf/config.json
Die Konfiguration kann nicht ohne backup im laufenden Betrieb verändert werden, beim unit-neustart via systemctl werden die Änderungen resettet (u.U. auch auf die leere Standardconfig!).
Teams
löschen: /opt/mattermost/bin/mattermost team delete $NAME
(2x mit YES antworten)
Verzeichnisstruktur
Programmverzeichnis /opt/mattermost: Eigentümer root, Gruppe root, nur die folgende Ordner verlinken in das Datenverzeichnis.
- config → ../mattermost-daten/config/
- data → ../mattermost-daten/data/
- logs → ../mattermost-daten/logs/
- plugins → ../mattermost-daten/plugins/
Datenverzeichnis /opt/mattermost-daten: Eigentümer mattermost, Gruppe mattermost
- config
- data
- logs
- plugins
systemd Unitfile
/lib/systemd/system/mattermost.service
[Unit] Description=Mattermost After=network.target After=mysql.service [Service] Type=notify ExecStart=/opt/mattermost/bin/mattermost TimeoutStartSec=60 Restart=always RestartSec=10 WorkingDirectory=/opt/mattermost User=mattermost Group=mattermost LimitNOFILE=49152 [Install] WantedBy=multi-user.target
Upgrade
Grundsätzlich ist durch eine Trennung von Daten und Code das upgrade relativ stressfrei und kann mit symlinks passieren:
service mattermost stop
- backup machen
- symlink mattermost wegnehmen!! (wird sonst durch neue version ersetzt)
- wget https://releases.mattermost.com/$VERSION/mattermost-$VERSION-linux-amd64.tar.gz
tar xvjf mattermost-$VERSION-linux-amd64.tar.gz
mv matermost mattermost-x.y.z
- symlink mattermost auf neue Version zeigen lassen:
ln -s mattermost-x.y.z mattermost
- symlinks für die Verzeichnisse unterhalb von mattermost-daten anlegen:
- inhaltlich:
- config → ../mattermost-daten/config/
- data → ../mattermost-daten/data/
- logs → ../mattermost-daten/logs/
- PluginSettings → Directory: Standard ist: plugins → ../mattermost-daten/plugins/
- PluginSettings → Client-Directory muss existieren, Standard ist „./client/plugins“:
mkdir mattermost/client/plugins && chown mattermost.mattermost mattermost/client/plugins
- Befehle:
cd mattermost mv config config-empty ln -s ../mattermost-daten/config ln -s ../mattermost-daten/data rmdir logs ln -s ../mattermost-daten/logs ln -s ../mattermost-daten/plugins mkdir client/plugins chown mattermost.mattermost client/plugins
setcap cap_net_bind_service=+ep /opt/mattermost/bin/mattermost
systemctl start mattermost
Features
Wunschliste:
- Guest Accounts (Website Bot etc.)
Problembehebung
Benutzername ändern
Geht leider nicht auf der Oberfläche, aber in der Datenbank
USE mattermost; UPDATE Users SET Username = 'NEU' WHERE Username = 'ALT';
Nachrichten bleiben im Status ungelesen
Fehlermeldung: MarkChannelsAsViewed: Unable to update the last viewed at time., failed to fetch threads: Error 1267: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '=
'
Bugreport: [SOLVED] After upgrading to 5.29 messages fail to mark as read
Lösung: Die Datenbank muss angepasst werden: mysql -u mmuser -p < changes.sql
changes.sql:
ALTER DATABASE mattermost CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; USE mattermost; ALTER TABLE Audits CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Bots CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE ChannelMemberHistory CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE ChannelMembers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Channels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE ClusterDiscovery CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE CommandWebhooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Commands CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Compliances CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Emoji CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE FileInfo CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE GroupChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE GroupMembers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE GroupTeams CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE IncomingWebhooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Jobs CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Licenses CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE LinkMetadata CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE OAuthAccessData CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE OAuthApps CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE OAuthAuthData CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE OutgoingWebhooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE PluginKeyValueStore CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Preferences CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE ProductNoticeViewState CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE PublicChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Reactions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Roles CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Schemes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Sessions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE SidebarCategories CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE SidebarChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE STATUS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Systems CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE TeamMembers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Teams CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE TermsOfService CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE ThreadMemberships CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Threads CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Tokens CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE UploadSessions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE UserAccessTokens CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE UserGroups CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE UserTermsOfService CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; ALTER TABLE Users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
MySQL 8.0
err_where":"GetAllTeamsPage","http_code":500,"err_details":"failed to find Teams: Error 1267: Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='"}
Lösung: Die Datenbank muss angepasst werden, siehe auch: https://docs.mattermost.com/install/software-hardware-requirements.html mysql -u mmuser -p < changes.sql
changes.sql:
ALTER DATABASE mattermost CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; USE mattermost; ALTER TABLE Audits CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Bots CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE ChannelMemberHistory CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE ChannelMembers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Channels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE ClusterDiscovery CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE CommandWebhooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Commands CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Compliances CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Emoji CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE FileInfo CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE GroupChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE GroupMembers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE GroupTeams CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE IncomingWebhooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Jobs CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Licenses CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE LinkMetadata CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE OAuthAccessData CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE OAuthApps CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE OAuthAuthData CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE OutgoingWebhooks CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE PluginKeyValueStore CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Posts CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Preferences CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE ProductNoticeViewState CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE PublicChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Reactions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Roles CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Schemes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Sessions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE SidebarCategories CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE SidebarChannels CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE STATUS CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Systems CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE TeamMembers CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Teams CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE TermsOfService CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE ThreadMemberships CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Threads CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Tokens CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE UploadSessions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE UserAccessTokens CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE UserGroups CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE UserTermsOfService CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci; ALTER TABLE Users CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
setcap cap_net_bind_service=+ep /opt/mattermost/bin/platform