Open LeeThompson opened 4 months ago
What does the webhook URL look like (remove the sensitive parts)?
I've randomized the sensitive bits. NOTE: I've tried with and without a trailing /
http://rocketchat.abc.defg.hij:3000/hooks/56305c4ab173e84efb916e6c/jRpTnrtGnBErdTmbkMwMbbyoSMknGiy4JyqcSxWBR373Z2R4
Webhook URLs need to be validated for security reasons, see: https://github.com/pymedusa/Medusa/pull/11565 What is the Webhook pattern we need to support for Rocketchat?
(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
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.
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:
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):
Debug logs (at least 50 lines):
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...