-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
[BUG] generic:// notifications parameter does not work correctly (attempting to get Signal-CLI to work) #623
Comments
Can you confirm the version of shoutrrr you tested with? I'm guessing we're on an older version. |
I pulled the latest tag from docker, so it appears to be v0.8.0 |
I did it simpler, add script to the notify:
urls:
- "script:///opt/scrutiny/bin/signal-notifications.sh" Mount it in compose file volumes:
- ${WORKINGDIR}/docker/scrutiny/signal-notifications.sh:/opt/scrutiny/bin/signal-notifications.sh
... And create this script as #!/bin/bash
# By Georgiy Sitnikov.
# https://github.com/GAS85
# AS-IS without any warranty
signalHost="signal-cli:8080"
signalRegisteredNubmer="+123456789"
signalRecipients="+987654321"
# Replace new lines with \n
signalMessage=$(echo "$SCRUTINY_MESSAGE" | sed ':a;N;$!ba;s/\n/\\n/g')
curl -fsS -m 10 --retry 2 -X POST -H "Content-Type: application/json" "http://$signalHost/v2/send" \
-d "{\"message\": \"$signalMessage\", \"number\": \"$signalRegisteredNubmer\", \"recipients\": [ \"$signalRecipients\" ]}" && exit 0 || exit 1 |
Thank you, I want to send msg to telegram, But I'm in china with poor network, I tested more than 10 times, all of them failed via Shoutrrr, I checked network, domain, dns, port, It's all right. and waste much time, finnally find the reason until write my own script that copy from answer above. thanks for your idea. Shoutrrr's timeout is about 10 seconds, maybe it's too short in some case. in my script, It's 40s worked finnally.
BTW, the cli tool cloud not work docker run --rm -it containrrr/shoutrrr generate telegram
|
@smilence86 did you check documentation? Telegram should be supported out of the box. |
Describe the bug
When trying to use the generic:// notification option from Shoutrrr, it fails to pass along JSON keys. I am trying to get the Signal CLI working as a means of receiving notifications. At first, it appeared to fail to due Shoutrrr not supporting arrays, but the signal-cli recently allowed for a single
recipient
parameter to be used, which should allow me to send a message. Running the below setup and testing the notifications withpodman exec -it scrutiny-web curl -X POST http://localhost:8080/api/health/notify
gives me this result from Webhook (which is incorrect, thenumber
andrecipient
fields are not respected). This should work, as Shoutrrr supports custom data fields with the$key=value
parameter as shown in the documentation:But, when running the shoutrrr container itself with the exact same parameters:
podman run --rm docker.io/containrrr/shoutrrr send -u 'generic://webhook.site/random-webhook-generated-id-here?template=json&disabletls=yes&$number=%2b12223334444&$recipient=%2b16667779999' --message "MESSAGE"
it does work, and also works when swapping the URL for my local signal API instance as the correct JSON keys are preserved (number and recipient):Expected behavior
I expect to be able to send a proper notification to my locally running Signal CLI, testing with Webhook.site.
Config files
$HOME/config/scrutiny.yaml
I am running all of this in Podman with the hub-spoke method, the collector is running with sudo permissions while everything else (the influx database and the web interface) are running rootless. All of that works fine, SMART status, dashboard etc... it's only notifications I am struggling with:
The text was updated successfully, but these errors were encountered: