certera-io / certera

A central validation server for Let's Encrypt certificates
https://docs.certera.io
Other
69 stars 14 forks source link

Rocket chat webhook integration #25

Open gik000 opened 3 years ago

gik000 commented 3 years ago

It would be very nice to manage also rocket chat integration as it is done with slack.

certeraio commented 3 years ago

Hi @gik000,

Thanks for the suggestion. I don't know enough about rocket chat, but extending things is pretty simple. The templates exist here: https://github.com/certera-io/certera/tree/master/src/Certera.Core/Notifications/Templates

If you submit a PR for the templates for rocket chat, I can take a look at making it more extensible. Also, do you know where the webhook documentation for RC is? I'd be curious to know if there is any special authentication for the endpoint too.

gik000 commented 3 years ago

Hi

Thanks for your quickly reply, at the end, yesterday I have found a way to bypass this problem. You will find it documented on my blog https://www.unmoscerinonelweb.com/blog/certera-io-notification-via-slack-webhook-on-rocketchat/

All you need to do is to POST on another webhook in the way Rocket Chat require, as you have done for Slack. Consider this link https://docs.rocket.chat/guides/administrator-guides/administration/integrations I think that the template should be very simple.

Take a look to this POST request that works like charme.

curl -X POST -H 'Content-Type: application/json' --data '{"username":"Certera","text":"Example message","attachments":[{"title":"Rocket.Chat","title_link":"https://rocket.chat","text":"Rocket.Chat, the best open source chat","image_url":"/images/integration-attachment-example.png","color":"#764FA5"}]}' https://rocketchat-web-url.net/hooks/AsnasidjsaiiAShi10as/YohasoSasdlkaavcSHSAm2hyo

EDIT: the url given in the example POST via CURL is provided by RocketChat, when you creates a webhook to expose (in a way similar to slack).