Skip to content
anubister edited this page Dec 11, 2022 · 7 revisions

Welcome to the mattermost_ynh wiki! Here are some tips about advanced Mattermost usage.

1. Using mmctl on a YunoHost instance

mmctl is the command-line tool to interact with a Mattermost installation. It can manage channels, teams, users, etc. (➡️ mmctl Documentation).

It can manage either:

  • a remote Mattermost server (using an admin token),
  • or a local Mattermost server (using the local mode).

Usually the easiest way to use mmctl is to enable local mode.

  1. Edit Mattermost's config.json file, and set EnableLocalMode to "true":

    sudo sed -i 's/"EnableLocalMode": false/"EnableLocalMode": true/g' /var/www/mattermost/config/config.json

    In addition as of version 7.2.0~ynh1 to solve the following error Error: socket file "/var/run/mattermost/mattermost_local.socket" doesn't exists, please check the server configuration for local mode, the parameter LocalModeSocketLocation has to be modified to "/var/run/mattermost/mattermost_local.socket".

  2. Restart the Mattermost server:

    sudo systemctl restart mattermost
  3. Tell mmctl to run using local mode, by setting two environment variables:

    export MMCTL_LOCAL=true
    export MMCTL_LOCAL_SOCKET_PATH=/var/run/mattermost/mattermost_local.socket
    
  4. Now you can run mmctl commands (with the full path). For instance, to list all registered users:

    sudo --preserve-env /var/www/mattermost/bin/mmctl user list
Clone this wiki locally