olvid-io / olvid-android

Olvid for Android
GNU Affero General Public License v3.0
151 stars 14 forks source link

Push notifications on nogoogle flavor #24

Open Albirew opened 9 months ago

Albirew commented 9 months ago

I was wondering when I saw that in readme.md but, isn't it possible, at least on the nogoogle flavor, to check presence of other UnifiedPush apps, like ntfy or NextPush, then use them to create and listen in a notification channel the same way as with firebase?

finiasz commented 9 months ago

Hello @Albirew, using these other services would require to integrate additional third party libraries in the app. Adding dependencies is something we try to avoid as much as possible, and this also represents some work on our side which we do not have time for right now. I understand this could be helpful for some of our users, but the permanent websocket option we offer at the moment works well and does not drain that much battery.

When we have time we will probably look into ntfy as several people have pinged us on this, but we currently need to focus on adding some features to the app.

Albirew commented 9 months ago

no worries, I can understand security, bugfixes and new features have higher priority over a specific build's specific use =)

For future's sake, here's UnifiedPush library documentation (usef to communicate with distributors) https://unifiedpush.org/developers/intro/

finiasz commented 9 months ago

I had a look at the docs you are pointing to and there is something I really don't like there!

https://unifiedpush.org/developers/android/#sending-push-messages

The client application of the user gives an endpoint to the server, and whenever this user received a message, our server will send a request to this endpoint.

There does not seem to be any kind of restriction on where this endpoint is located, so implementing this on server side will let any user force our server to send requests to a server of their choice. Pretty easy way of turning our server into a DDoS relay... If we implement this, we will definitely need to whitelist a few providers of unified push!

Albirew commented 9 months ago

There does not seem to be any kind of restriction on where this endpoint is located

Of course, since the user will either install it on his own server or use an existing endpoint.
In order to avoid DDoS, you can limit the number of requests per second per ip (both origin and destination), but either way, you can't push notifications on a server if android app doesn't tell distributor to listen to (locally generated by Olvid, can be randomized at creation) channel

@p1gp1g may be able to give more informations on this matter

p1gp1g commented 9 months ago

A few things :

Edit: And by the way, any application supporting webpush does it as well. If you plan to support UnifiedPush, then you should implement WebPush (the RFC, not the draft like so many apps). UnifiedPush is compatible with it, and it may be useful for other platforms/integration

Edit2: For instance, Telegram supports webpush and also the firefox's deprecated simple push API (which is shown compatible with UnifiedPush by mistake) : https://core.telegram.org/api/push-updates