Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker-compose webhooks issue #50

Closed
VadzimTarasiuk opened this issue Sep 5, 2019 · 3 comments
Closed

Docker-compose webhooks issue #50

VadzimTarasiuk opened this issue Sep 5, 2019 · 3 comments

Comments

@VadzimTarasiuk
Copy link

Describe the bug
I don't get any notifications from TG webhooks set as env variables in docker-compose.yml

CIAO_WEBHOOK_ENDPOINT_TELEGRAM="https://api.telegram.org/bot<TG-bot-auth-tocken>/sendMessage"
CIAO_WEBHOOK_PAYLOAD_TELEGRAM='{"chat_id":<chat-room-id>,"disable_web_page_preview":1,"text": "[__name__] Status changed from (__status_before__) to (__status_after__)"}'

When checked with curl I found

{"ok":false,"error_code":400,"description":"Bad Request: message text is empty"} response.

The command was pretty plain:

curl -X POST https://api.telegram.org/bot<TG-bot-auth-tocken>/sendMessage"  -d '{"chat_id":<chat-room-id>,"disable_web_page_preview":1,"text": "[__name__] Status changed from (__status_before__) to (__status_after__)"}'

The messages are sending correctly when specify the json-content Header:

curl -X POST https://api.telegram.org/bot<TG-bot-auth-tocken>/sendMessage"  -d '{"chat_id":<chat-room-id>,"disable_web_page_preview":1,"text": "[__name__] Status changed from (__status_before__) to (__status_after__)"}' -H 'Content-Type: application/json'

Could it be that I was needed to specify more params in docker-compose file to make notifications working?

@vumdao
Copy link

vumdao commented Sep 5, 2019

Check this #40
Inside the docker-compose.yml, it should be ...

- 'CIAO_WEBHOOK_ENDPOINT_TELEGRAM=https://api.telegram.org/bot<TG-bot-auth-tocken>/sendMessage'
- 'CIAO_WEBHOOK_PAYLOAD_TELEGRAM={"chat_id":<chat-room-id>,"disable_web_page_preview":1,"text": "[__name__] Status changed from (__status_before__) to (__status_after__)"}'

@VadzimTarasiuk
Copy link
Author

Great, thanks @Finneon!
To be more precise I removed quotes at all as below and it worked.

CIAO_WEBHOOK_ENDPOINT_TELEGRAM=https://api.telegram.org/bot<TG-bot-auth-tocken>/sendMessage
CIAO_WEBHOOK_PAYLOAD_TELEGRAM={"chat_id":<chat-room-id>,"disable_web_page_preview":1,"text": "[__name__] Status changed from (__status_before__) to (__status_after__)"}

Confusingly simple. Sorry for any troubles caused and have a nice day :)

@brotandgames brotandgames changed the title Telegram webhooks issue Docker-compose webhooks issue Sep 5, 2019
@brotandgames
Copy link
Owner

brotandgames commented Sep 5, 2019

@VadzimTarasiuk @Finneon Both solutions are working with docker-compose.
FYI There is also a note in the docs: https://github.com/brotandgames/ciao/blob/master/webhook_configuration.md#notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants