Send message within slack or telegram channels
- Environment variable
- ENV_HTTP_X_API_KEY=xXXXxx
- ENV_TG_CHATID=xXXXxx
- Slack Incoming Webhooks 2.1. See https://api.slack.com/incoming-webhooks#enable_webhooks 2.2. Enter the token in the file config.json in the slack section.
- Telegram token bot 3.1. See https://core.telegram.org/bots 3.2. Enter the token in the file config.json in the tg section.
$ git clone https://gitlab.com/luisra51/tell-me.git
$ cd tell-me
$ bundle install
- Environment variable
- ENV_HTTP_X_API_KEY=xXXXxx
- ENV_TG_CHATID=xXXXxx
- Slack Incoming Webhooks 2.1. See https://api.slack.com/incoming-webhooks#enable_webhooks 2.2. Enter the token in the file config.json in the slack section.
- Telegram token bot 3.1. See https://core.telegram.org/bots 3.2. Enter the token in the file config.json in the tg section.
$ gitlab clone https://gitlab.com/luisra51/tell-me.git
$ cd tell-me
Edit file docker-compose.yml and change environment section
$ docker-compose build
$ docker-compose up -d
# scripts
# notifications or alarms
$ curl -X POST -H 'Content-Type: application/json' -H 'X-Api-Key: secre' -d '{"app": "ETL sql to csv", "msg": "Finish"} 'http(s)://<services-ip>:<port>/to-tg'
$ curl -X POST -H 'Content-Type: application/json' -H 'X-Api-Key: secre' -d '{"channel": "@user or #channel", "username": "Tittle msg "," msg ":" End "} 'http(s)://<services-ip>:<port>/to-slack'
This api is protected by an API-Key defined in the header of the request X-Api-Key
. Remember to lift the service by HTTPS for greater security and prevent seeing API-Key through traffic.
This repo is a mirror of https://gitlab.com/luisra51/tell-me.git
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request in Gitlab Repo