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

Clarify usage of SIGNALREST_RECIPIENTS_<KEY> variables #1005

Open
phipolis opened this issue Oct 18, 2023 · 2 comments
Open

Clarify usage of SIGNALREST_RECIPIENTS_<KEY> variables #1005

phipolis opened this issue Oct 18, 2023 · 2 comments

Comments

@phipolis
Copy link

Description

The configuration of the Signal-REST notifier by environment variables specifies DIUN_NOTIF_SIGNALREST_RECIPIENTS_<KEY>, but it's unclear what the requirements are for <key>. Is that an index, like 1,2,3...? Or any unique value? And does that key need to be referenced somewhere else?

I looked for other notifiers using a similar dynamic key and tried to understand from the source how it's parsed, but I'm still unsure. Could the docs clarify how to define the recipients in environment variables?

Thank you!

@crazy-max
Copy link
Owner

but it's unclear what the requirements are for <key>.

Yes agree, <index> would be better. In your case:

  • DIUN_NOTIF_SIGNALREST_RECIPIENTS_0
  • DIUN_NOTIF_SIGNALREST_RECIPIENTS_1
  • ...

@phipolis
Copy link
Author

@crazy-max The recipients variables don't seem to be getting picked up as intended. I set the environment variable in docker compose as:

environment:
  - "DIUN_NOTIF_SIGNALREST_ENDPOINT=http://redacted/v2/send"
  - "DIUN_NOTIF_SIGNALREST_NUMBER=+redacted"
  - "DIUN_NOTIF_SIGNALREST_RECIPIENTS_0=+redacted"
  - "DIUN_NOTIF_SIGNALREST_TEMPLATEBODY=Docker tag {{ .Entry.Image }} has been released."

Signal-REST container logged a 400 response when I ran diun notif test. I initially couldn't tell what was going wrong, but tcpdump shined some light:

{"message":"Docker tag docker.io/diun/testnotif:latest has been released.",
 "number":"+redacted",
 "recipients":null}

HTTP/1.1 400 Bad Request
{"error":"Couldn't process request - please provide at least one recipient"}

I did find that using DIUN_NOTIF_SIGNALREST_RECIPIENTS=+redacted does work for a single recipient, resulting in "recipients":["+redacted"] in the request.

Also request: It would be helpful for troubleshooting if the signalrest notifier logged the body of 400 responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants