-
-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS notifications not working on 5G, but works on Wi-Fi #888
Comments
Hi, I have a very similar setup. Everything works for me. Although I did have issues setting it up so maybe I can help. A) did you setup a server.yml file in /etc/ntfy ? if not do that and when running the docker image you have to pass it like this docker run -v /var/cache/ntfy:/var/cache/ntfy -v /etc/ntfy:/etc/ntfy -p 80:80 -itd binwiederhier/ntfy serve --cache-file /var/cache/ntfy/cache.db |
@Haitham-ghaida Thank for the response. A) I used a docker compose file, only difference is I mapped the cache and etc to a permanent folder for saving information between instances B) Yes I created the server.yml file and edited the base url to the local host IP address. C) I tried both local IP and the cloudflare url http://ntfy.mydomain.com, but I got the same effect. I wonder if there is a setting I am missing in cloudflare. The tunnel is a CNAME and the docker image locally says its healthy in cloudflare. Are there any additional settings in cloudflare? |
Having similar issues ~ Everything was just fine for 4-5 days. Also setup on a Docker Container w/ CF Tunnel. Edit: Just changed my server IP to ntfy.sh instead of my self hosted server and now the messages are coming through just fine. Something must be messed up on NTFY backend side for the upstream? |
I doubt it's a Cloudflare issue. like I found that having tiny mistakes in the config file can miss the whole thing for me I added HTTP:ntfy.website.com/ instead of HTTP:ntfy.website.com so just the "/" was enough to mess things up. Make sure the upstream server for IOS is configured correctly. Mine has been working fine for one week now. But I did notice a small lag for IOS. Sorry, I couldn't help further. |
Without changing ANYTHING - it just started to work ~1 hour ago. |
All, thank you for the responses. I am still troubleshooting.
Tests:
From Cloudflare Tunnel Logs: 2023-09-27T13:13:14Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 192.XXX.XX.XX:81: i/o timeout" connIndex=0 dest=https://ntfy.mydomain.com/test01 event=0 ip=198.XX.XX.XX type=http
Docker-compose file
I wonder if there is a mismatch with the routing between the cloudflare container and the internal configuration of ntfy container? As it seems I have followed all of the documentation and tutorials. Did I miss something? |
First, change your base-url to include "https" instead of just "http". Next, I'm not very familiar with Cloudflare, but if it and ntfy are running in docker containers, I'm pretty sure you need to make sure they are on the same docker network so that they can communicate. I also think that docker containers on the same network communicate using internal ports (80 in this case), instead of the exposed port (81). |
Sigh... Yea... This is frustrating. Probably just going back to Twilio SMS. This is too inconsistent on iOS. Just randomly broke again. |
Have any of you tried the PWA on iOS instead of the native app? People have much more success with the PWA |
I have not yet due to having too many devices that we use these notifications for.
I just don't get why this works for a few hours and then breaks without any config changes. |
The native iOS app is known to be buggy. The iOS PWA works much better With your specific example, sending messages with priority headers has been known to cause problems with iOS, particularly with Cloudflare. A fix for this specific issue has been made and should be released in the next version |
Hi Everyone, I really appreciate the conversation and feedback! I believe I have figure it out! It has to do with cloudflare tunnel docker container hitting the ntfy docker container. Steps to configure
Notes for why to setup this wayBased on the cloudflare error, stating it cannot resolve the ntfy docker IP address; it actually cannot because they were run on different docker networks. By setting the url in cloudflare, we are using the container dynamic IP of ntfy, docker will automatically resolve the local docker container IP of ntfy. By doing this setup I am able to run ntfy in a container on my home server with instant notifications: Tests:
Both instances generate an automatic notification on my iOS phone which is NOT connected to my home WiFi, using 5G RepoIn order to share my code more easily I created a simple repo with my docker-compose setup Please feel free to clone the repo to setup your ntfy on your home server! For those that just want the file
|
Yay! I'm glad you got it working! And thank you for the thorough instructions. Hopefully they are helpful to others By the way, you should be able to use https://ntfy.mydomain.com everywhere; you shouldn't ever have to use ntfy server IP |
@wunter8 Thank you for the follow up. Correct the url of https://ntfy.mydomain.com will work outside the network. I was suggesting the serverip/topic as a test example to ensure the topics were actually showing up on the local server before going external. Thanks again! |
@davidamacey I have the exact same setup, but notifications are not working for me. |
Folks, apologies that you are having issues. iOS selfhosted is a bit tricky, and there are still a few issues. I have not read through the entire thread, but here are some pointers.
In general, troubleshooting like this is best done via Discord/Matrix. I am closing this for now, because OP got their issues resolved, but I am happy to chat about other issues in chat or in other tickets. |
馃悶 Describe the bug
iOS App has different results between WiFi and Cell network (5G) connections.
Setup: Locally hosted docker image, routed through cloudflare tunnel with my domain name (as described by networkChuck)
Unable to subscribe to new topics unless I enter the locally hosted server IP address on local Wi-Fi then subscribe to topic. Then I change the server URL to my ntfy..com, and it works with the subscribed topic (on Wi-Fi). When using my personal URL the iOS app waits and then says "Request timed out"
When subscribed to channels on my ntfy..com server I do not get notifications over 5G, but when I am connected to the local Wi-Fi notifications are instant. When switching back to Wi-Fi I instantly receive all my test messages pushed at once, otherwise nothing happens on 5G.
馃捇 Components impacted
iOS Application
馃挕 Screenshots and/or logs
No error logs at this time.
馃敭 Additional context
The text was updated successfully, but these errors were encountered: