C9Glax / tranga

Docker-Container to monitor (Manga) Scanlation-Sites for download new chapters.
GNU General Public License v3.0
157 stars 15 forks source link

[Feature Request] Add Support for Ntfy for Notifications #73

Closed hash004 closed 1 year ago

hash004 commented 1 year ago

Is your feature request related to a problem? Please describe.

While Tranga currently supports Gotify for notifications, it would be beneficial for users who rely on Ntfy for their notification needs.

Describe the solution you'd like

I would love to see support added for Ntfy as a notification method in Tranga. This would allow users to receive notifications through their preferred platform, offering more flexibility and broadening the range of supported notification methods.

C9Glax commented 1 year ago

From a quick glance: Ntfy is CLI based. There is no way to use the endpoint other than running a command. Ntfy uses other backends to send notifications to.

hash004 commented 1 year ago

You can send notifications via HTTP too and since the topic name is password enough there is no auth required. https://docs.ntfy.sh/publish/

The way I would imagine this being implemented is having 2 fields, hostname and topic, on the config page. And the POST request would use those details and body would contain the notification details.

C9Glax commented 1 year ago

I really didn't take a close look... Then that's definitely easily achievable. Thanks for pointing that out.

C9Glax commented 1 year ago

Hey there, I tried to blind-implement this. Don't know how well this will work as I don't have a server set up. cuttingedge should have both the website and api implemented.

hash004 commented 1 year ago

Hey @C9Glax, So I tried testing using cuttingedge image for the api and website but couldn't see any requests being sent when I looked at the api container:

image image

I tried doing a postman request to see what it would look like and got it working with following setup: image

You can use the ntfy's demo server to play around if you want: https://ntfy.sh/tranga

C9Glax commented 1 year ago

Looking at the first picture tells me that the javascript in your browser is still cached, otherwise the Ntfyconfigured would either have a checkmark or an X. Adding works on my side, just haven't seen if it actually sends notifications.

hash004 commented 1 year ago

Looking at the first picture tells me that the javascript in your browser is still cached, otherwise the Ntfyconfigured would either have a checkmark or an X. Adding works on my side, just haven't seen if it actually sends notifications.

You're right, my bad. Cleared my cache and only had the checkmark. Downloaded a chapter and got the following notification: image

image

Looks good to me with the quick testing I did 😊

Thank you for implementing it.