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

Slack Notifications (to RocketChat) are no longer working #11642

Open
LeeThompson opened this issue Mar 1, 2024 · 5 comments
Open

Slack Notifications (to RocketChat) are no longer working #11642

LeeThompson opened this issue Mar 1, 2024 · 5 comments

Comments

@LeeThompson
Copy link

Describe the bug
I have been using RocketChat for a few years with Medusa sending notifications to it via the "Slack" notification service (the webhooks are interchangeable) but recently, Medusa puts this in the log (and nothing else):

2024-02-29 17:13:31 WARNING Thread :: [e094759] The webhook URL (REDACTED) you provided is not valid

To Reproduce
Steps to reproduce the behavior:

  1. Create an incoming webhook in RocketChat, ensure it's Enabled
  2. In Medusa under notifications/social add Slack notifications using the webhook from step 1.
  3. Save and click "Test Slack"

Expected behavior
It used to work, it would be nice if it worked again; or at least gave an error or something I could troubleshoot with.

Medusa (please complete the following information):

  • OS: Debian (Synology) via Docker (Linux 3.10.105) (container: linuxserver/medusa:latest)
  • Branch: master
  • Commit: e094759640ca61c5c033bf1ff9d33bc7fc1ba857
  • Python version: 3.11.8
  • Database version: 1.0.19 (not sure if this is the right number)

Debug logs (at least 50 lines):

`2024-02-29 17:22:06 WARNING Thread :: [e094759] The webhook URL (REDACTED) you provided is not valid`

Additional context
I've tried generating a new webhook, changing the URL to refer to the rocketchat host by IP address, etc, no changes.
Slack webhooks with RocketChat continue to work with Mylar, Radarr and other applications.
If only Medusa would actually indicate what the issue is...

@medariox
Copy link
Contributor

medariox commented Mar 1, 2024

What does the webhook URL look like (remove the sensitive parts)?

@LeeThompson
Copy link
Author

LeeThompson commented Mar 1, 2024

I've randomized the sensitive bits. NOTE: I've tried with and without a trailing /

http://rocketchat.abc.defg.hij:3000/hooks/56305c4ab173e84efb916e6c/jRpTnrtGnBErdTmbkMwMbbyoSMknGiy4JyqcSxWBR373Z2R4

@medariox
Copy link
Contributor

medariox commented Mar 1, 2024

Webhook URLs need to be validated for security reasons, see: #11565
What is the Webhook pattern we need to support for Rocketchat?

@LeeThompson
Copy link
Author

(from the PR) WEBHOOK_PATTERN = r'https://hooks\.slack\.com/services/.*'
This definitely isn't going to work with RocketChat since it can be self-hosted (as it is in my case) so it will never be on slack.com

I'm not familiar with the Python RegEx syntax but it's basically http or https:// with a host.domain (with optional port) and then /hooks/' and the token which is generated, here is one I generated for an example (it's a real one that I'm deleting right away) 65e1f75c00ab53363395d0aa/2yXaxN6k566kPLAvmsKxeSE4L6mxLfzgi6GKovaSC2kE7GJk`

https://rocketchat.domain/hooks/65e1f75c00ab53363395d0aa/2yXaxN6k566kPLAvmsKxeSE4L6mxLfzgi6GKovaSC2kE7GJk
http://rocketchat.domain:port/hooks/65e1f75c00ab53363395d0aa/2yXaxN6k566kPLAvmsKxeSE4L6mxLfzgi6GKovaSC2kE7GJk

Docs on RocketChat integrations, message syntax can be identical to Slack's but it also supports additional features.
https://docs.rocket.chat/use-rocket.chat/workspace-administration/integrations

@medariox
Copy link
Contributor

I think the best solution is to add a domain whitelist for the webhook requests. I will get to it when I have some time or maybe someone else can pick this up and submit a PR.

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

2 participants