petio-team / petio

Petio Request, Discover, Review
https://petio.tv
MIT License
251 stars 28 forks source link

Mattermost/Slack Webhook #244

Closed dannyhanes closed 3 years ago

dannyhanes commented 3 years ago

Describe the solution you'd like I would like to see support for Mattermost & Slack webhooks added.

Describe alternatives you've considered Currently Discord is only supported, but I am unable to self host that application.

Additional context Ideally I would love to feed all alerts from Petio into a single Mattermost/Slack channel.

Side Note: Just got Petio installed once I saw it was live. This thing is beautiful! Found a few bugs here and there, but so far this is a great first release. Look's like I will be retiring my Ombi server.

RyleaStark commented 3 years ago

There is a very good chance that Slack will accept the webhook from Discord as their formatting is very similar. Can you give this a try and confirm?

dannyhanes commented 3 years ago

@RyleaStark - I just tried copy / pasting my incoming webhook into the discord webhook section of the admin settings and get a failure message when testing. Same for Mattermost. Looking in the console section it just says "DSCRD: Test Failed"

Is there additional logging I can check?

RyleaStark commented 3 years ago

Nope, this is what it should return as designed in api/discord.js

https://github.com/petio-team/petio/blob/d1ecf5813a12860160f2bb1ebce2d70fe8e810a1/api/notifications/discord.js#L59-L82 The test is simply checking to see if the webhook was successfully sent.

https://github.com/petio-team/petio/blob/d1ecf5813a12860160f2bb1ebce2d70fe8e810a1/api/notifications/discord.js#L102-L113 This function is what sends the webhook asynchronously.

Formatting is probably just slightly off as to what Slack/Mattermost are expecting. It is worth noting that Slack does intend to discontinue the use of Incoming/Outgoing webhooks; Mattermost requires a bit more information to post out such as the channel.

I'd expect that when @AshDyson moves onto building a more robust notification system, these things will be discussed and evaluated.

AshDyson commented 3 years ago

Yeah we want to build out a more feature rich notification system in the coming updates and Slack is definitely on there / generic web hook

angrycuban13 commented 3 years ago

As part of our Phase 2 we'll be revamping our notifications which we hope to cover more services.

Thanks for your feature request!