Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

Cant subscribe to Channel when hosting a server #2

Closed
chrmey opened this issue Jan 14, 2020 · 6 comments
Closed

Cant subscribe to Channel when hosting a server #2

chrmey opened this issue Jan 14, 2020 · 6 comments

Comments

@chrmey
Copy link

chrmey commented Jan 14, 2020

Hi,
i tried several things and did not have any success. When hosting a server myself (on Debian) i cant subscribe to a channel. When i try it on your server everything works fine.
I've already checked on owners, permissions etc. but i dont know what to try else. I dont get any error messages.

I can reach the Website in the browser and also push messages, they then appear on the website instantly. But when i click on the "subscribe on this device" button nothing happens. I also checked the device settings, but since subscribing on your page works, i dont see the problem there.

Hope you got any advice.

@paulgb
Copy link
Collaborator

paulgb commented Jan 14, 2020

Hi,

What type of phone and browser are you using? I haven't encountered this before but I might be able to give you some pointers on debugging it.

@chrmey
Copy link
Author

chrmey commented Jan 14, 2020

Hi,

Samsung Galaxy S9 with latest Android. Tried several browsers (Firefox Nightly, Firefox, Chrome, Standard browser). Wont work on PC too.
Same Phone works perfectly on your server. So i guess the issue isnt with the phone.

Can you pass on your configuration for gunicorn, your directory structure you used and the users and permissions you have set?

@paulgb
Copy link
Collaborator

paulgb commented Jan 14, 2020

Thanks. Is the server by chance publicly accessible? If so and if you're willing to share the link (feel free to send it privately to the email on my GitHub profile) I would be happy to have a look.

The public instance is served via dokku with the default dokku server image provided by Digital Ocean. The exact command run is in the procfile in this repo:

https://github.com/notify-run/notify-run-deployment?files=1

(That's the repo that I deploy to dokku. The public instance installs the notify server directly from pypi via the requirements file)

@chrmey
Copy link
Author

chrmey commented Jan 15, 2020

Hi,

i cleared everything up and reinstalled notify_run_server, gunicorn and alle the requirements from the deployment repo and used excatly the same command to start the server (except for a bind). Doesnt work still.

The Server Starts up, but the subscribe button wont work. Possible permission issue on the files?

@chrmey
Copy link
Author

chrmey commented Jan 15, 2020

Ok, found the problem.

Service Workers get blocked, when you serve them via http. You need a valid SSL-Certificate. Even with a self-made certificate, every browser i tried (Firefox, Chrome, Edge) refuses the registration. Did notice that when trying with a selfbuild service worker.

If you have a self-made certificate, Firefox will simply block the registration, Chrome throws an javascript error, so does Edge.

On Firefox Mobile, registering works. (No Idea why)

If i now try to push a message i gotta use curl --insecure bc of the self signed certificate.

Edit: Works on Firefox Desktop too.

@paulgb
Copy link
Collaborator

paulgb commented Jan 17, 2020

Thanks for digging into this, Chris. I've added an issue in the main repo (notify-run/notify.run#22) to document this so that others don't run into it. Glad you got it working.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants