The following procedure shows how to install this project using Docker. It describes how to configure Mattermost and run the Docker image of this integration.
To install this project using Docker, you will need Docker Engine installed on your machine. Procedure to install Docker can be found here.
Here's how to start:
-
Set up your Mattermost slash command
-
Log in to your Mattermost account. Click the three dot menu at the top of the left-hand side and go to Integrations > Slash Commands
-
Under Add a new command, enter
gif
into Command Trigger Word -
Paste your Web Server domain into Callback URLs, making sure to add
http://
to the beginning and/new_post
to the end so it looks similar tohttp://<your-web-server-domain>:<MATTERMOST_GIPHY_PORT>/new_post
and click Add -
Select
POST
method -
(optional) Choose a username and icon url (more details here)
-
(optional) Check the autocomplete checkbox, add
[KEYWORD]
as the hint,Returns a GIF from Giphy based on the keyword
as the description andGet a GIF from Giphy
as the descriptive label -
Copy the Token from your newly created slash command that appears under the Existing commands section
-
Run the integration with Docker
On your server, you only need to run the Docker image, with some environnement variablesMATTERMOST_GIPHY_TOKEN=<your-token-here>
: this is the token you copied in the last section (you can specify multiple tokens which are separated by a colon)MATTERMOST_GIPHY_HOST=<your-host>
: the host you want the integration (defaults to 0.0.0.0)MATTERMOST_GIPHY_PORT=<your-port-number>
: the port number you want the integration to listen on (defaults to 5000)GIPHY_API_KEY=<giphy-api-key>
: key to use for Giphy API. Default public one isdc6zaTOxFJmzC
If defaults are good enough for you, simply run this command:
docker run -d \
--name mattermost-giphy \
-p 5000:5000 \
-e MATTERMOST_GIPHY_TOKEN=<your-token-here> \
numberly/mattermost-integration-giphy
That's it! You should be able to type gif: hello
or /gif hello
into any channel and see a GIF from Giphy's translate service.