Skip to content

O5ten/MMM-Mattermost

Repository files navigation

MMM-Mattermost

This is a module for MagicMirror. It displays announcements from Mattermost.

Screen Shot

Installation

  1. Move to MagicMirror's modules directory and clone the repo with
    git clone https://github.com/O5ten/MMM-Mattermost.git
  2. cd into MMM-Mattermost and run npm install

Config

At a minimum, you need a Personal Access Token for Mattermost from the account settings. The mattermost server must be configure to allow this kind of token. But you can probably also use a token for a bot account or use basic auth with your base64-encoded credentials.

You also need to provide some search-terms in config/config.js and the module will search for messages that match those. The ten latest messages matching the searchTerms will be displayed unless you change the limit.

Screen Shot

Option Description
mattermostUrl REQUIRED
The url of your mattermost instances

Type: string
accesstoken REQUIRED
A personal access token for your mattermost account

Type: string
teamId REQUIRED
The teamId of the mattermost instance that you want to search messages within

Type: string
searchTerms REQUIRED
The keywords to use to select mattermost messages to display. Be advised all channels and direct messages the user have are searched.

Type: string
isOrSearch REQUIRED
If multiple searchTerms are used then this boolean governs whether it is an OR search or an AND search with those terms. default false

Type: boolean

Default config

    animationSpeed: 2000,
    updateInterval: 60000,
    rotationInterval: 15000,
    retryDelay: 5000,
    teamId: "",
    searchTerms: "",
    accesstoken: "",
    mattermostUrl: "",
    limit: 10,
    title: "Mattermost"

Here is an example of an entry in config.js. The id's and tokens are obviously jibberish, but it makes for an easy copy. Get ahold of the teamId by curling the API directly.

curl -H"Authorization: Bearer <PERSONAL_ACCESS_TOKEN>" -H"Content-Type: application/json" https://<my.mattermostserver.org>/api/v4/teams | jq .
{
        module: "MMM-Mattermost",
        position: "middle_center",
        config: {
                mattermostUrl: "https://my.mattermostserver.org",
                accesstoken: "8mggde5gztbdplskqlkmklzmlk",
                teamId: "9fpxdh4fet853ex8s98uf09sowls",
                searchTerms: "#announcement",
                isOrSearch: true,
                title: "Announcements"
        }
},

Dependencies

This package depends on the following:

About

MagicMirror module that displays the last X messages of a specific Mattermost channel in a similar way as the news feed plugin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published