diff --git a/mattermost-giphy/.gitignore b/mattermost-giphy/.gitignore deleted file mode 100644 index 335954ca647702f828f85c7ca2e3da1b339e1c2c..0000000000000000000000000000000000000000 --- a/mattermost-giphy/.gitignore +++ /dev/null @@ -1 +0,0 @@ -giphy_mat_hooker.conf diff --git a/mattermost-giphy/README.md b/mattermost-giphy/README.md deleted file mode 100644 index bb0283eb13001cfcaffc0027df5e12fe0ffac650..0000000000000000000000000000000000000000 --- a/mattermost-giphy/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Instructions - -You should set the `giphy_mat_hooker.conf` file. -``` -cp giphy_mat_hooker.conf.template giphy_mat_hooker.conf -``` -Change the `token` value with the mattermost key diff --git a/mattermost-giphy/giphy_mat_hooker.conf.template b/mattermost-giphy/giphy_mat_hooker.conf similarity index 85% rename from mattermost-giphy/giphy_mat_hooker.conf.template rename to mattermost-giphy/giphy_mat_hooker.conf index 68bab70a99d545eb73d0d2671fb7e4e1df6799da..81375c80320fb24fe8ead36b60d83b65197fa262 100644 --- a/mattermost-giphy/giphy_mat_hooker.conf.template +++ b/mattermost-giphy/giphy_mat_hooker.conf @@ -1,4 +1,3 @@ -# vim:set sw=4 ts=4 sts=4 ft=perl expandtab: { #################### # Hypnotoad settings @@ -6,7 +5,7 @@ # 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://127.0.0.1:80'], + listen => ['http://0.0.0.0:8080'], }, ###################### @@ -17,7 +16,7 @@ # 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 => 'dc6zaTOxFJmzC', + apikey => '{{%APIKEY%}}', # Mattermost token # When you create a slash command in mattermost, you get a token. @@ -25,5 +24,5 @@ # only. # If you do not provide a token, it will check for parameters that # Mattermost usually send with a slash command. - token => 'something' + token => '{{%TOKEN%}}' }; diff --git a/mattermost-giphy/init.sh b/mattermost-giphy/init.sh index 1db579ce8bdd3a0de51ea0960b35eddea42fe2ad..77ee328fab788c2393c1a3637d2175de846f043b 100644 --- a/mattermost-giphy/init.sh +++ b/mattermost-giphy/init.sh @@ -1,5 +1,8 @@ #!/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