Open ScrumpyJack opened 8 months ago
My solution is to use the HTTP trigger targeting a nodered instance
- WUD_TRIGGER_HTTP_NTFY_URL=http://nodered.home.lan/to_ntfy
- WUD_TRIGGER_HTTP_NTFY_METHOD=POST
- WUD_TRIGGER_HTTP_NTFY_MODE=simple
- WUD_TRIGGER_HTTP_NTFY_ONCE=true
that parses the JSON, and posts a formatted message to ntfy
Are there options for authentication with the HTTP trigger? Username/password or token.
Hi,
HTTP auth options have not been yet implemented (it should not be hard to add).
Though, regarding basic auth credentials, passing them from the URL itself should work (https://user:pass@my-host
).
I'd love a ntfy-integration! Or perhaps the option to specify the placeholders in the url. At the moment I get an error when specifying them in the querystring-parameters.
Ex: WUD_TRIGGER_HTTP_NTFY_METHOD: GET WUD_TRIGGER_HTTP_NTFY_URL: https://ntfy.${BASE_DOMAIN}/whatsupdocker/publish?title=$${name}+has+an+update!&message=Container+$${name}+has+a+$${kind}+update+to+version+$${semver}
Gives this warning: WARN whats-up-docker/registry: Some triggers failed to register (Error when registering component http ("url" must be a valid uri with a scheme matching the http|https pattern))
Using a awfully generic title and message works, but that's not very helpful. https://ntfy.${BASE_DOMAIN}/whatsupdocker/publish?title=Updates+await!&message=One+or+more+containers+can+be+updated.
+1 to this request. I would like to avoid building an extra translator in between WUD and Gotify to receive my notifications using Gotify.
Been trying to get ntfy working with the HTTP trigger. But unfortunately I'm stuck. Will paste my summary below.
I do have a question at the end for anyone on this topic/ any developer that knows JS
Note: of course native integration would be nice but I understand that developers can be busy and I am not skilled enough in JS to make a PR
Note: the YAML syntax for including a json. This is utilized in WUD_TRIGGER_HTTP_release_SIMPLEBODY
Note: putting all env vars even if its default values to show the thought process
Reference ntfy documentation on HTTP JSON body with post request Reference ntfy documentation on auth with bearer token
services:
whatsupdocker:
image: ghcr.io/fmartinou/whats-up-docker
container_name: whatsupdocker
environment:
WUD_TRIGGER_HTTP_release_URL: ${NTFY_URL}
WUD_TRIGGER_HTTP_release_METHOD: POST
WUD_TRIGGER_HTTP_release_AUTH_TYPE: BEARER
WUD_TRIGGER_HTTP_release_AUTH_BEARER: ${NTFY_TOKEN}
WUD_TRIGGER_HTTP_release_MODE: simple
WUD_TRIGGER_HTTP_release_ONCE: false
WUD_TRIGGER_HTTP_release_THRESHOLD: all
WUD_TRIGGER_HTTP_release_SIMPLEBODY: >-
{
"topic": "mytopic",
"message": "$${name} can be updated from version $${local} to version $${remote}",
"title": "New $${kind} found for container $${name}"
}
whatsupdocker | WARN whats-up-docker/trigger.http.release: Error (400 - {"code":40009,"http":400,"error":"invalid request: topic invalid"})
WUD_TRIGGER_HTTP_release_SIMPLEBOD
work? Does it pass in a direct http body like a JSON/ String?
Of course would appreciate if anyone knows the answer to my question (can read JS) and understands how I am trying to achieve full ntfy integration with WUD HTTP trigger
Thanks for the read!
+1 from me too, ntfy is a must :-P
I realise that it's possible to use the HTTP trigger for these services (or even apprise, MQTT or SMTP if you're feelig adventureous) but native support would for these notification services would be highly appreciated.