Server: Plugin ownership gets overwritten with cli usage

Description

When using a mattermost cli command the ownership of the plugins folder gets overwritten each time the mattermost binary is being run by a different user than the mattermost user.

While this can be worked around by using su mattermost or sudo -u mattermost it can be quite annoying and does confuse some customers and users of the software because plugins then stop showing up or stop working due to change in ownership of their files.

QA Test Steps

1. spin up a mm serve as usual
2. ssh onto the server
3. run any mattermost command as root or any user that is NOT the mattermost user
4. check the file permissions in the mattermost folder with ls -la

Observed: all files have the correct ownership (mattermost:mattermost) except for the plugins (root:root). Plugins disappear from the plugins list in the system console

Expected: nothing changes in regard to the ownership of the plugins and files in the directory, plugins stay in the system console and keep working as expected.

Status

Mana

None

Assignee

Jesse Hallam

QA Assignee

Prapti Shrestha

Reporter

Sven Hüster

Epic Link

None

Fix versions

Mattermost Team

Sustained Engineering

Sprint

None

Labels

QA Testing Areas

CLI

GitHub Issue

None

Components

None
Configure