Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Support of Mattermost plugins #7

Closed
rjferguson21 opened this issue Jan 31, 2024 · 8 comments · Fixed by #99
Closed

Native Support of Mattermost plugins #7

rjferguson21 opened this issue Jan 31, 2024 · 8 comments · Fixed by #99
Assignees
Labels
enhancement ✨ New feature or request

Comments

@rjferguson21
Copy link

rjferguson21 commented Jan 31, 2024

Is your feature request related to a problem? Please describe.

Users of Mattermost will want to use plugins. Currently, whomever is managing Mattermost deployments would need to configure plugins manually, post-deployment.

Describe the solution you'd like

A way to manage Mattermost plugins via code at the package level vs bundle or manually.

Describe alternatives you've considered

Doing it manually

Additional context

🐸

https://github.com/mattermost/mattermost-plugin-ai

@mjnagel
Copy link
Contributor

mjnagel commented Jan 31, 2024

This should be easy from a manual perspective. It does require one bundle override to enable plugin uploads:

    overrides:
        mattermost-enterprise-edition:
          values:
            - path: "mattermostApp.extraEnv"
              value:
                - name: MM_PLUGINSETTINGS_ENABLEUPLOADS
                  value: "true"

After that the plugin can be installed and enabled the same way the docs list - https://github.com/mattermost/mattermost-plugin-ai?tab=readme-ov-file#install

For an automatic approach we should be able to use https://github.com/mattermost/mattermost-helm/blob/master/charts/mattermost-enterprise-edition/values.yaml#L206-L233 which shouldn't be too difficult until we assume airgap 🤪

@mjnagel
Copy link
Contributor

mjnagel commented Feb 1, 2024

Discovered in further testing that doing the above mentioned override will cause envs to get wiped out for other config (filestorage/sso). Resolving that in the linked PR, assuming that is merged the new way to approach will be:

    overrides:
      mattermost:
        uds-mattermost-config:
          values:
            - path: "config.enablePluginUploads"
              value: "true"

@Racer159 Racer159 added the enhancement ✨ New feature or request label Feb 7, 2024
@Racer159
Copy link
Contributor

This is currently being done here and would likely be a sane default for this package: https://github.com/defenseunicorns/uds-prod-infrastructure/blob/dc5fa80ae403e376679f2b2c4e1bdca4cc0b1e05/bundles/swf/uds-bundle.yaml#L57

@oates
Copy link
Contributor

oates commented May 10, 2024

AI plugin can be the first plugin we do, but working this issue will allow us to solve a broader problem of how we handle mattermost plugins in the package vs the bundle.

@oates oates changed the title Support mattermost AI plugin Native Support of Mattermost plugins May 10, 2024
@Racer159
Copy link
Contributor

We should also check with @YrrepNoj to see how 🐸 is doing this today

@mjnagel
Copy link
Contributor

mjnagel commented May 13, 2024

In a current environment running LFAI + MM we enabled plugin upload and then manually added the plugin (i.e. this was not an automated or airgapped process).

@zachariahmiller
Copy link
Contributor

We scoped this down a bit for clarity. The expectations for this ticket will be:

  1. add ability to enable plugin uploads for mattermost to the package
  2. Create "example" zarf package under src/ that demonstrates and tests a process for programmatically including one or more plugins via that package and add it to the test bundle to test the process in ci.
  3. This process should b documented as the "blessed" method for including plugins for delivery to use if they have specific needs to include mm plugins in their specific bundle.

@marshall007
Copy link
Contributor

@Racer159: Worked locally - for follow on issues did you see anyway we could default settings inside a plugin?
(like point that url to our Gitlab?)

screenshot

image

@zachariahmiller: also curious on the config... maybe env vars or something? It didnt look like their api had anything on configuring plugins, just adding them

Yes we can enable plugins by default via MM_PLUGINSETTINGS_PLUGINSTATES and configure them via MM_PLUGINSETTINGS_PLUGINS. FYI it sounds like anything we configure via these environment variables cannot be overridden in the system console.

via: https://docs.mattermost.com/configure/environment-variables.html

  • From Mattermost v7.5, environment configuration parsing supports JSON for MM_PLUGINSETTINGS_PLUGINS and MM_PLUGINSETTINGS_PLUGINSTATES. This is especially helpful for Helm configuration files, provided all plugins are configured at the same time. For example, MM_PLUGINSETTINGS_PLUGINSTATES="{\"com.mattermost.calls\":{\"Enable\":true},\"com.mattermost.nps\":{\"Enable\":true}}".
  • When settings are configured through an environment variable, System Admins can’t modify them in the System Console. If a setting is configured through an environment variable, and any other changes are made in the System Console, the value stored of the environment variable will be written back to the config.json as that setting’s value.

marshall007 added a commit that referenced this issue Jul 16, 2024
## Description

This adds an `initContainer` used to sideload mattermost plugins. New
plugins can be added by adding additional `ADD` commands to the included
`Dockerfile`.

## Related Issue

Fixes #7 

Depends on defenseunicorns/uds-common#161 for
renovate changes.

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/uds-package-mattermost/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Co-authored-by: zamaz <71521611+zachariahmiller@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants