From 46e9bbfeccf994c8ca29c06053a22da991550d5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?PICHOU=20Ky=C3=A2ne?= <kyane.pichou@etu.utc.fr> Date: Thu, 30 Mar 2017 21:41:23 +0200 Subject: [PATCH] Use another giphy integration --- mattermost-giphy/Dockerfile | 28 ++++++++++++-------------- mattermost-giphy/giphy_mat_hooker.conf | 28 -------------------------- mattermost-giphy/init.sh | 10 --------- 3 files changed, 13 insertions(+), 53 deletions(-) delete mode 100644 mattermost-giphy/giphy_mat_hooker.conf delete mode 100644 mattermost-giphy/init.sh diff --git a/mattermost-giphy/Dockerfile b/mattermost-giphy/Dockerfile index 039991c9..a5dee2dd 100644 --- a/mattermost-giphy/Dockerfile +++ b/mattermost-giphy/Dockerfile @@ -1,20 +1,18 @@ -FROM perl +FROM python:2.7 -MAINTAINER Kyâne PICHOU kyane@kyane.fr +MAINTAINER Kyâne PICHOU kyane@kyane.fr -# Install CPAN and Carton -RUN apt-get update \ - && apt-get -y install build-essential libssl-dev \ - && curl -L http://cpanmin.us | perl - App::cpanminus \ - && cpanm Carton +RUN apt-get update && \ + apt-get install -y \ + python-pip \ + python-dev \ + build-essential && \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* -RUN git clone https://git.framasoft.org/framasoft/giphymathooker.git /giphymathooker -WORKDIR /giphymathooker +RUN git clone https://github.com/numberly/mattermost-integration-giphy.git /mattermost-giphy +WORKDIR /mattermost-giphy -RUN carton install -COPY giphy_mat_hooker.conf /giphymathooker/giphy_mat_hooker.conf -COPY init.sh /giphymathooker/init.sh -RUN chmod +x /giphymathooker/init.sh +RUN python setup.py install + +ENTRYPOINT python run.py -EXPOSE 8080 -ENTRYPOINT ["/giphymathooker/init.sh"] diff --git a/mattermost-giphy/giphy_mat_hooker.conf b/mattermost-giphy/giphy_mat_hooker.conf deleted file mode 100644 index 81375c80..00000000 --- a/mattermost-giphy/giphy_mat_hooker.conf +++ /dev/null @@ -1,28 +0,0 @@ -{ - #################### - # Hypnotoad settings - #################### - # see http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad for a full list of settings - hypnotoad => { - # array of IP addresses and ports you want to listen to - listen => ['http://0.0.0.0:8080'], - }, - - ###################### - # Application settings - ###################### - - # Giphy API key. - # The default is the dev key from Giphy, which is rate-limited. - # See https://github.com/Giphy/GiphyAPI to know how to get - # a production API key - apikey => '{{%APIKEY%}}', - - # Mattermost token - # When you create a slash command in mattermost, you get a token. - # Put it here if you want that service to be available to your team - # only. - # If you do not provide a token, it will check for parameters that - # Mattermost usually send with a slash command. - token => '{{%TOKEN%}}' -}; diff --git a/mattermost-giphy/init.sh b/mattermost-giphy/init.sh deleted file mode 100644 index 77ee328f..00000000 --- a/mattermost-giphy/init.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -sed -i "s/{{%TOKEN%}}/$MATTERMOST_TOKEN/g" giphy_mat_hooker.conf -sed -i "s/{{%APIKEY%}}/$GIPHY_APIKEY/g" giphy_mat_hooker.conf - -carton exec hypnotoad script/giphy_mat_hooker - -while :; do - sleep 300 -done -- GitLab