stonith404 / pingvin-share

A self-hosted file sharing platform that combines lightness and beauty, perfect for seamless and efficient file sharing.
https://stonith404.github.io/pingvin-share/
BSD 2-Clause "Simplified" License
3.07k stars 223 forks source link

🚀 Feature: Notifications (webhook?) #88

Open Hukuma1 opened 1 year ago

Hukuma1 commented 1 year ago

🔖 Feature description

The ability to send a notification of certain events. On link open, maybe on download of a file, view, etc. Apprise is the gold-standard since it houses basically any notification system you could possibly have/run/want. FOSS as well. https://github.com/caronc/apprise

🎤 Pitch

When X share is opened and/or downloaded, I could receive a notification to my Home Assistant which in turn sends me a push notification to my iPhone. Or you might want a message in Discord sent to you. Or Telegram. Endless possibilities. Apprise also has e-mail notifications so in theory could simplify the current e-mail notification code? (not sure)

stonith404 commented 1 year ago

Nice idea but Apprise hasn't a package for node.js, has it? The backend is written in typescript so we would have to create a micro service only for Apprise and that's in my opinion too much work only for notifications.

Or did I miss something?

sebastian-b1 commented 1 year ago

Yes, currently there is no stable nodejs package available. I think this could work, but it may take more work than you would like to use in developing a feature.

Hukuma1 commented 1 year ago

Yeah, apologies in advance. I wasn't sure what underlying technologies both use and wasn't aware they were incompatible.

Is it possible to just implement Webhooks? Would that be a much smaller ask? Seems most other services (e.g. Telegram, Home Assistant) would still have support for receiving Webhooks.

stonith404 commented 1 year ago

Yeah webhooks would be easier to implement I think. Which events should trigger the webhook?

stonith404 commented 1 year ago

@Hukuma1 Just to understand, would you mind to share why you think it would be nice that you can get notifications in e.g Telegram or Discord? Do you have a specific use case?

Hukuma1 commented 1 year ago

Oh I just grabbed a popular chat program as an example where to send a notification (channel/DM). For my personal use case I would just like to get a push notification to my phone that someone interacted with my share. Since I already use Home Assistant it can be received by a webhook implementation. I just suggested other services to not only make it about my use case. :P

There's a few core events I would say: open and download. Separate, in case someone only clicked the link but didn't actually download? (not sure if each file in the share needs its own event, that's your call)

Future/bonus: If a share is about to expire, can send an alert? New file uploaded alert to your reverse share? Bad password/failed login alert? (notify you of someone trying to crack into your private share)

stonith404 commented 1 year ago

@Hukuma1 Okay, thanks for your explanation. I'm looking into it, but currently I want to prioritize other issues if someone can't wait for this feature, feel free to create a PR :)

Hukuma1 commented 1 year ago

Absolutely! No rush. Keep up the great work!

Zixim commented 1 year ago

+1 for webhook implementation

stonith404 commented 1 year ago

Could you guys suggest me a list of events that would be nice to have for webhooks? E.g share.create

Zixim commented 1 year ago

when a file is uploaded or downloaded or deleted to/from a (reverse)share. Basically all events related to file movements. For me, the file upload to any reverse share would be the most interesting one to have.

Hukuma1 commented 1 year ago

share.view = entered share but did not download anything share.download = downloaded share.accessfail = failed pw login (maybe can be invoked if failed X amount of times, eg 3 wrong password attempts)

CrazyWolf13 commented 5 months ago

@stonith404

Could you guys suggest me a list of events that would be nice to have for webhooks? E.g share.create

+1 For some sort of notification service, at best ntfy.sh integration.

For me the following things would be nice:

Greetings from Switzerland :)

maurxce commented 4 months ago

+1