Skip to content
Snippets Groups Projects
Commit c8e8ca74 authored by PICHOU Kyâne's avatar PICHOU Kyâne Committed by PICHOU Kyâne
Browse files

Manage mattermost giphy token at startup (and not when building docker image)

parent c110c2fb
Branches
Tags
1 merge request!5CheckMK stable image
giphy_mat_hooker.conf
# 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
# vim:set sw=4 ts=4 sts=4 ft=perl expandtab:
{ {
#################### ####################
# Hypnotoad settings # Hypnotoad settings
...@@ -6,7 +5,7 @@ ...@@ -6,7 +5,7 @@
# see http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad for a full list of settings # see http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad for a full list of settings
hypnotoad => { hypnotoad => {
# array of IP addresses and ports you want to listen to # 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 @@ ...@@ -17,7 +16,7 @@
# The default is the dev key from Giphy, which is rate-limited. # The default is the dev key from Giphy, which is rate-limited.
# See https://github.com/Giphy/GiphyAPI to know how to get # See https://github.com/Giphy/GiphyAPI to know how to get
# a production API key # a production API key
apikey => 'dc6zaTOxFJmzC', apikey => '{{%APIKEY%}}',
# Mattermost token # Mattermost token
# When you create a slash command in mattermost, you get a token. # When you create a slash command in mattermost, you get a token.
...@@ -25,5 +24,5 @@ ...@@ -25,5 +24,5 @@
# only. # only.
# If you do not provide a token, it will check for parameters that # If you do not provide a token, it will check for parameters that
# Mattermost usually send with a slash command. # Mattermost usually send with a slash command.
token => 'something' token => '{{%TOKEN%}}'
}; };
#!/bin/bash #!/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 carton exec hypnotoad script/giphy_mat_hooker
while :; do while :; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment