notifications icon indicating copy to clipboard operation
notifications copied to clipboard

Deploying your own push-proxy server

Open gperdomor opened this issue 7 years ago • 19 comments

Hi... I have my own server instance and a custom mobile app.

The ios app has this variable:

#define k_pushNotificationServer                @"https://push-notifications.nextcloud.com"

I need to change to

#define k_pushNotificationServer                @"https://push-notifications.my-custom-domain"

??

I enable the app but in the server i don't see any configuration params for this app

gperdomor avatar May 12 '17 15:05 gperdomor

cc @marinofaggiana @nickvergessen

MorrisJobke avatar May 12 '17 16:05 MorrisJobke

The app provides the proxy-server URL to the nextcloud-server. However the proxy code is currently not public.

nickvergessen avatar May 13 '17 10:05 nickvergessen

@gperdomor This is still in development. Can you share some more insights what you want to achieve here? Thanks

karlitschek avatar May 16 '17 21:05 karlitschek

@karlitschek i use my own instance of nextcloud server, and i have a custom ios and android app, both apps have a few modifications, including the bundle id, how get push notifications from my server?

gperdomor avatar May 16 '17 22:05 gperdomor

Is there any update on this? If there needs to be a community effort to document how to set this up as a standalone server, I volunteer.

shadoxx avatar Sep 14 '18 18:09 shadoxx

@karlitschek @nickvergessen there is more than one year passed, there are still some people who customized the nc apps (ios/android) and rely on the source of the proxy to get the push notifications to work. It would be super helpful to get this open source or at least a documentation on how to configure it on our own.

dockay avatar Nov 29 '18 10:11 dockay

We really need admin documentation for this, I swear I used to get notifications but I've been tightening up security and no longer get them. If it relies on a port I have closed or an IP range I've blacklisted I need some info to work with.

Haplo164 avatar Mar 02 '19 07:03 Haplo164

You should allow connections to https://push-notifications.nextcloud.com on default ports for notifications.

Similar you might want to allow connections to our appstore and the updater server (dont know the urls right now)

nickvergessen avatar Mar 02 '19 08:03 nickvergessen

I figured out what my issue was, It wasn't even server related as far as I can tell. Just a problem with the android apps. Turns out that if you use a device specific password for the main app and try to import accounts for the talk app, it breaks notifications. It may be more complicated but its along those lines.

Haplo164 avatar Mar 03 '19 09:03 Haplo164

@Haplo164 in one of the recent versions I added a mandatory re-login when importing an account which automatically provisions a separate app token for the Talk app, therefore push notifications should work as expected. Let me know if this is not the case.

The reason why it might NOT have worked before is that you've had one token for two apps, therefore one of them just couldn't work.

mario avatar Mar 03 '19 18:03 mario

@mario As of 2 days ago importing from the Nextcloud app to the Talk app killed push notifications on the Nextcloud app. It may have also effected the talk app but I can not confirm or deny that one as I didn't notice it happening until I tried to use the notification based 2fa.

Haplo164 avatar Mar 04 '19 05:03 Haplo164

@Haplo164 when importing the account, were you asked to relogin in the Talk app, and did you use a regular password or a token you generated yourself?

mario avatar Mar 04 '19 07:03 mario

I had the same problem, since 4 days I did not received any NC Files related push notification. This was approximately the time I added an account to NC Talk. Now I removed NC Talk (only for testing), unregistered NC Files app via microG and after a while I got push notifications again for NC Files app.

I'll test it now with a unrooted, "regular" Android device.

tobiasKaminsky avatar Mar 04 '19 08:03 tobiasKaminsky

@mario @tobiasKaminsky please open an issue in the android repos then, at least in this repo and especially in this issue it is offtopic.

nickvergessen avatar Mar 04 '19 08:03 nickvergessen

Are there any updates on this?

This issue is already more than 4 years old. Unfortunately, the documentation is rather very small on how to use push proxy servers, well it's is actually non-existent.

It is understandable that the push proxy code is not public. However, this does not mean that there should be no concrete documentation on how to implement it yourself.

@nickvergessen you don't have to make the whole code public, but you could for example share code snippets on how to exactly set up a push proxy and use it with Nextcloud and with its clients (custom iOS/Android apps).

This would be very helpful for everybody concerned and I'm sure everybody would be very thankful for it.

ElectrifyPowr avatar Jul 03 '21 15:07 ElectrifyPowr

I'm guessing https://github.com/nextcloud/server/pull/29363 will require this issue being solved?

tcitworld avatar Oct 22 '21 07:10 tcitworld

I'm guessing nextcloud/server#29363 will require this issue being solved?

Not really. It is simply low priority at the company - there are loads of things that we prefer to do because they will help many more Nextcloud users. Of course, anyone is free to work on this.

jospoortvliet avatar Oct 22 '21 16:10 jospoortvliet

@jospoortvliet

We would like to add Huawei push notifications. If you can open source the push proxy would be great so we can contribute. Otherwise we will develop one from scratch and share with the community. Don't worry about pretty-ing up docs etc. Of course, you will need to hide your Firebase and other API keys.

Thanks

ramezrafla avatar Nov 10 '21 16:11 ramezrafla

Hi, I implemented my own push proxy here: https://github.com/jld3103/nextcloud-harbour/blob/978f483f025d0cb0626af970bf1bd5f3f70e8856/packages/nextcloud_push_proxy/lib/nextcloud_push_proxy.dart
It's based on an older push proxy I wrote a few years ago. Back then I reverse engineered what the proxy communication looks like.
It's only a library, so the logic to send the received notifications to e.g. FCM needs to implemented by developers. It should be possible to write push proxies in other languages based on my code. Cheers :tada:

provokateurin avatar Jul 14 '22 15:07 provokateurin

Hi, I implemented my own push proxy here: https://github.com/jld3103/nextcloud-harbour/blob/978f483f025d0cb0626af970bf1bd5f3f70e8856/packages/nextcloud_push_proxy/lib/nextcloud_push_proxy.dart It's based on an older push proxy I wrote a few years ago. Back then I reverse engineered what the proxy communication looks like. It's only a library, so the logic to send the received notifications to e.g. FCM needs to implemented by developers. It should be possible to write push proxies in other languages based on my code. Cheers 🎉

So can we use this to bypass push-notification.nextcloud.com or can we use this to create our own push-notification.my.domain.com?

@jld3103

markkhanippbx avatar Aug 11 '22 19:08 markkhanippbx

With the fair-use feature (wich is absolutely understandable) it seems to be more and more important to become deplyoing your own push-proxy real. Nextcloud wants to reduce their server-load as it costs free. Also they want to provide Nextcloud Hub as fully indipendent, it's your control. But with the limits of fair push and no alternative, it's a very little bit loosing control over your instance.

I would use my own push proxy with own certificates for my instances, even if they are small and does fall under "fair-use". Probably that will do more people and the server load of Nextcloud's push proxy will be less.

My idea for how the setup could looks like: The push proxy could be setted up via some certificates. In your cloud's config.php you enter a https url for the push proxy. All mobile apps will then listen to the instances push-proxy of the account(s) setted up (hopefully it would work like this, otherwise they need to build and provide their own apps like Nextcloud and Talk too).

Pilzinsel64 avatar Oct 27 '22 07:10 Pilzinsel64