[Solved] Mattermost first run with an existing config

Hello,

Summary
In order to simplify the onboarding process on Linux computers, I added a config.json file in /etc/skel/.config/Mattermost, so the server is already defined upon first app startup.

I retrieved the file from an existing setup.

It works but sometimes I get the first-run setup form asking me for the server URL and name.

Steps to reproduce
OS is Debian 13 with KDE. Version of client is the current latest.

  • Uninstall Mattermost
  • Create a config.json file in the home directory of the current user in /home/user/.config/Mattermost with the following content
  • Install Mattermost, in my case I use the Debian repository
  • Start Mattermost
{
  "autostart": true,
  "darkMode": false,
  "enableHardwareAcceleration": false,
  "enableMetrics": false,
  "hideOnStart": false,
  "lastActiveServer": 0,
  "logLevel": "info",
  "minimizeToTray": false,
  "notifications": {
    "bounceIcon": true,
    "bounceIconType": "informational",
    "flashWindow": 0
  },
  "servers": [
    {
      "name": "REDACTED",
      "order": 0,
      "url": "https://REDACTED"
    }
  ],
  "showTrayIcon": true,
  "showUnreadBadge": true,
  "spellCheckerLocales": [],
  "startInFullscreen": false,
  "themeSyncing": true,
  "trayIconTheme": "use_system",
  "useSpellChecker": true,
  "version": 4,
  "viewLimit": 15
}

Expected behavior
Mattermost client reads the config and does not ask for the server URL and name, similar to Windows with GPOs.

Observed behavior
It asks the server URL and name. If I open the config.json, the servers key has disappeared. Sometimes it works as expected. I have the impression that it worked better before version 6, but I’m not certain. I have been doing this for years and it was working for sure.

I think I found the “issue”.

I ran watch cat ~/.config/Mattermost/config.json while starting mattermost for the first time.

The config file briefly disappear.

If Mattermost is closed too early, the config does not reappear so the next start will be without a default config, asking the server infos.

My onboarding script was guilty.

CA_LAN="/usr/local/share/ca-certificates/myca.crt"
if [ -f "/usr/bin/mattermost-desktop" ]; then
    mattermost-desktop&
    sleep 5 # 5 secs is not enough
    pkill mattermost-desk

    certutil -d "sql:${HOME}/.pki/nssdb" \
      -A -t "C,," \
      -n ca_lan \
      -i "${CA_LAN}"
fi

1 Like

Thank you for following up with the solution, @cyberm8! Glad to hear you got it figured out.