Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS Instant Notifications #1265

Open
ledahosn opened this issue Jan 25, 2025 · 5 comments
Open

IOS Instant Notifications #1265

ledahosn opened this issue Jan 25, 2025 · 5 comments
Labels
question This is a question

Comments

@ledahosn
Copy link

Question

Hello, i have a Problem - I get Rate Limited (also I dont know the exact rate limits) for pushing to IOS Apps - and I also do not find if I can pay ntfy.sh to allow for a higher Rate Limit.

I get this Log entry:
ntfy | 2025/01/25 14:05:49 WARN Unable to publish poll request, the upstream server https://ntfy.sh responded with HTTP 429 Too Many Requests; you may solve this by sending fewer daily messages, or by configuring upstream-access-token (assuming you have an account with higher rate limits) (message_body_size=93, message_event=message, ********

Can anybody tell me what a good solution is here for me?

@ledahosn ledahosn added the question This is a question label Jan 25, 2025
@wunter8
Copy link
Contributor

wunter8 commented Jan 25, 2025

There are 2 rate limits: a burst limit and a daily message limit. Both return 429 errors.

Burst limit: if you sent a lot of messages close together (e.g., 60 within a few seconds), you could get a 429.

Daily message limit: you can send up to 250 messages/day using the free tier. You can pay to get higher limits, yes. See the ntfy homepage: https://ntfy.sh/#pricing

@ledahosn
Copy link
Author

@wunter8

After I have added my access token in my docker config like this:
- NTFY_UPSTREAM_BASE_URL=https://ntfy.sh - NTFY_UPSTREAM_ACCESS_TOKEN=xxxxx

i still get:
Unable to publish poll request, the upstream server https://ntfy.sh/ responded with HTTP 429 Too Many Requests

@wunter8
Copy link
Contributor

wunter8 commented Jan 25, 2025

Check your limits by sending an authenticated request to https://ntfy.sh/v1/account

For example, curl -u ':tk_abc...' https://ntfy.sh/v1/account (the colon before the access token is important)

@ledahosn
Copy link
Author

ledahosn commented Jan 25, 2025

At https://ntfy.sh/account i see my Usage is 0

C:\Users\xxx>curl -u ':tk_xxxxxxxxxxxxx' https://ntfy.sh/v1/account {"code":40101,"http":401,"error":"unauthorized","link":"https://ntfy.sh/docs/publish/#authentication"}

I have created a Token in my Account with no expiry to test arround.

Also via my IP Based Authentication, I get this (which I can tell from I should be still able to get notifications?!)
ntfy:~/notify# curl ntfy.sh/v1/account {"username":"*","role":"anonymous","limits":{"basis":"ip","messages":17280,"messages_expiry_duration":43200,"emails":24,"calls":0,"reservations":0,"attachment_total_size":104857600,"attachment_file_size":15728640,"attachment_expiry_duration":10800,"attachment_bandwidth":524288000},"stats":{"messages":0,"messages_remaining":17280,"emails":0,"emails_remaining":24,"calls":0,"calls_remaining":0,"reservations":0,"reservations_remaining":0,"attachment_total_size":0,"attachment_total_size_remaining":104857600}}

I mean I must be doing anything real stupid, because it doesn't make Sense for me and I am pretty sure ntfy doesn't have a real problem...

For additional Context here is my Setup:

ntfy.sh compose.yml file:

services:
  ntfy:
    image: binwiederhier/ntfy
    container_name: ntfy
    command:
      - serve
    environment:
      - TZ=Europe/Vienna
      - NTFY_BASE_URL=https://notify.mydomain.tld
      - NTFY_UPSTREAM_BASE_URL=https://ntfy.sh
      - NTFY_UPSTREAM_ACCESS_TOKEN=tk_xxxxx
    volumes:
      - /var/cache/ntfy:/var/cache/ntfy
      - /etc/ntfy:/etc/ntfy
    ports:
      - 80:80
    restart: unless-stopped

Public IP -> Reverse Proxy -> Docker Container

And currently I always get the 429 Status WARN in my Logs

@wunter8
Copy link
Contributor

wunter8 commented Jan 25, 2025

Any idea why the first curl command failed?

Do you have a server.yml in /etc/ntfy? Is it possible the upstream access token is being overwritten there? (I don't remember which of env variables and server.yml overrides the other)

Have you tried/considered the PWA for notifications on iOS? It has more features than the native app and has more reliable notifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a question
Projects
None yet
Development

No branches or pull requests

2 participants