UP-NextPush / server-app

UnifiedPush provider for Nextcloud - server application - Moved to https://codeberg.org/NextPush/uppush
GNU Affero General Public License v3.0
67 stars 8 forks source link

HTTP Pusher on Element Android still shows unifiedpush.org URL instead of my own #30

Closed dinosmm closed 1 year ago

dinosmm commented 1 year ago

I have a Synapse server separate from my Nextcloud one. I have installed the NC UnifiedPush server app, and NextPush on my phone. All is configured correctly, phone and app show up on NextPush and UP NC app.

I want to also get Element/Synapse to use the NC server app as a matrix gateway. I have set the nginx configuration as per the instructions, and the GET result from the URL I have put on proxy_pass is the correct one: {"unifiedpush":{"gateway":"matrix"}}

The problem is, Element still shows matrix.gateway.unifiedpush.org as the gateway. Whatever I do, I cannot get it to change that.

Should Element show my own domain as a gateway if the NC server app is correctly set up as a gateway, and if so, what might I be doing wrong - or is there a known issue with the gateway functionality?

I am using the nginx config sample found here: https://github.com/UP-NextPush/server-app/blob/main/reverse_proxy_examples/nginx.conf

However it is not very clear to me (by far not an expert in nginx configs); what should the '127.0.0.1:1234' references be replaced with? I replaced the one under the /_matrix/push/v1/notify endpoint with my Nextcloud domain... is that right? But I cannot understand what the / endpoint should point to.

Any help will be appreciated.

dinosmm commented 1 year ago

With the help of kind people over at the Matrix room, I figured out that the sample nginx configuration you have included in the guides is stuff that has to go inside the main Nextcloud nginx config file, and not a separate nginx config specific to the Nextcloud UP server app (which the guide had lead me to believe).

I would suggest adding a comment to your sample nginx.conf saying "This configuration should be integrated into the existing Nextcloud nginx configuration".

Furthermore, as the typical Nextcloud configuration differs in many places (for example I have a manual install so I don't proxy_pass, I just host to /var/www/nextcloud, so my configuration is very very different to your sample), I would suggest perhaps pointing out the two important sections to add to an existing Nextcloud config:

a) proxy timeouts should be increased to 10m

b) /_matrix/push/v1/notify endpoint should be set to proxy_pass https://your.nextcloud.domain/apps/uppush/gateway/matrix;

I believe this will help others who may get stuck as I did.

Thank you for this project, it all works brilliantly well now.

xmgz commented 1 year ago

please @dinosmm would you share your config here?

I'm also struggling to make it work without timeouts

in /etc/nginx/conf.d/domain.tld.d/nextcloud.conf , server (443( section added

 proxy_connect_timeout   10m;
    proxy_send_timeout      10m;
    proxy_read_timeout      10m;        

    proxy_buffering off;

it does not make any diference (that I noticed). Thank you