fmartinou / whats-up-docker

What's up Docker ( aka WUD ) gets you notified when a new version of your Docker Container is available.
https://fmartinou.github.io/whats-up-docker
MIT License
1.1k stars 35 forks source link

Feature request: Native intergration with gotify and ntfy #357

Open ScrumpyJack opened 7 months ago

ScrumpyJack commented 7 months ago

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.

Manuki-San commented 5 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

underwooda commented 5 months ago

Are there options for authentication with the HTTP trigger? Username/password or token.

fmartinou commented 5 months ago

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).

joost471 commented 2 months ago

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.

Tuxdude commented 1 month ago

+1 to this request. I would like to avoid building an extra translator in between WUD and Gotify to receive my notifications using Gotify.

OneWeekNotice commented 1 month ago

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

Goal: Using ntfy publish as JSON with WUD HTTP trigger

Docker compose sample

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}"
        }

Error Log

whatsupdocker | WARN whats-up-docker/trigger.http.release: Error (400 - {"code":40009,"http":400,"error":"invalid request: topic invalid"})

Questions

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!

mztiq commented 2 weeks ago

+1 from me too, ntfy is a must :-P