A Mattermost plugin to add a command for spoiler messages
Go to file
moussetc c32207f254 CI: run on all branches including master 2021-12-07 22:22:32 +01:00
.github CI: run on all branches including master 2021-12-07 22:22:32 +01:00
assets Update Mattermost plugin template (commit 6605430, compatible MM 5.26.0) 2021-04-09 22:59:54 +02:00
build Update plugin starter template manually 2021-12-07 22:16:56 +01:00
server Bump up plugin version to 3.1.0 2021-12-07 21:41:57 +01:00
webapp Make webapp tests pass again 2021-12-07 21:23:27 +01:00
.editorconfig Update Mattermost plugin template (commit 6605430, compatible MM 5.26.0) 2021-04-09 22:59:54 +02:00
.gitattributes Update Mattermost plugin template (commit 6605430, compatible MM 5.26.0) 2021-04-09 22:59:54 +02:00
.gitignore Update Mattermost plugin template (commit 6605430, compatible MM 5.26.0) 2021-04-09 22:59:54 +02:00
.golangci.yml CI: Update golangci-lint conf (from plugin starter template) 2021-12-07 20:54:00 +01:00
CHANGELOG.md Init repo with mattermost-plugin-sample 2018-11-04 00:54:27 +01:00
LICENSE Init repo with mattermost-plugin-sample 2018-11-04 00:54:27 +01:00
Makefile Update plugin starter template manually 2021-12-07 22:16:56 +01:00
README.md Upgrade to MM 3.39.2 2021-12-06 23:46:14 +01:00
codecov.yaml Attempt to customize codecov settings 2019-05-13 20:40:19 +02:00
go.mod Upgrade to MM 3.39.2 2021-12-06 23:46:14 +01:00
go.sum Upgrade to MM 3.39.2 2021-12-06 23:46:14 +01:00
plugin.go Update plugin starter template manually 2021-12-07 22:16:56 +01:00
plugin.json Bump up plugin version to 3.1.0 2021-12-07 21:41:57 +01:00

README.md

Mattermost SPOILER Plugin Build CI

Maintainer: @moussetc

This plugin creates a slash command to display spoiler messages in a non-spoiling way.

Usage

Type /spoiler followed by your spoiler, then post your message. (The spoiler can be on more than one line, it can contain emojis, URLs, images, etc. All will be hidden.)

Two display modes are available for spoiler messages:

  • Spoiler button mode:
    Spoiler button demo

  • Redacted mode:
    Redacted spoiler demo
    This mode is not available on native apps like Android. Native apps do not yet support plugin customization, so for now they will use the Spoiler button mode.

Compatibility

Use the following table to find the correct plugin version for each Mattermost server version:

Mattermost server Plugin release Incompatibility
5.39.0 and higher v3.1.x security fixes (upgrading dependencies)
5.14 to 5.25 v3.x.x relative integration URLs
5.3 to 5.13 v2.x.x
below not supported plugins can't create slash commands

Installation and configuration

  1. Download the release package and download the .tar.gz package. Supported platforms are: Linux x64, Windows x64, Darwin x64, FreeBSD x64.
  2. Use the Mattermost System Console > Plugins > Management page to upload the .tar.gz package
  3. Activate the plugin in the System Console > Plugins > Management page
  4. Choose the display mode: go to the System Console > Plugins > Spoiler Command, select the mode and save the plugin's settings.
    Plugin settings

Configuration Notes in HA

If you are running Mattermost v5.11 or earlier in High Availability mode, please review the following:

  1. To install the plugin, use these documented steps
  2. Then, modify the config.json using the standard doc steps to the following
 "PluginSettings": {
        // [...]
        "PluginStates": {
            // [...]
            "com.github.moussetc.mattermost.plugin.spoiler": {
                "Enable": true,
		        "SpoilerMode": "button"
            },
        }
    }

Development

To avoid having to manually install your plugin, build and deploy your plugin using one of the following options.

Deploying with Local Mode

If your Mattermost server is running locally, you can enable local mode to streamline deploying your plugin. Edit your server configuration as follows:

{
    "ServiceSettings": {
        ...
        "EnableLocalMode": true,
        "LocalModeSocketLocation": "/var/tmp/mattermost_local.socket"
    }
}

and then deploy your plugin:

make deploy

You may also customize the Unix socket path:

export MM_LOCALSOCKETPATH=/var/tmp/alternate_local.socket
make deploy

If developing a plugin with a webapp, watch for changes and deploy those automatically:

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_TOKEN=j44acwd8obn78cdcx7koid4jkr
make watch

Deploying with credentials

Alternatively, you can authenticate with the server's API with credentials:

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_USERNAME=admin
export MM_ADMIN_PASSWORD=password
make deploy

or with a personal access token:

export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_TOKEN=j44acwd8obn78cdcx7koid4jkr
make deploy

How do I share feedback on this plugin?

Feel free to create a GitHub issue or to contact me at @cmousset on the community Mattermost instance to discuss.