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

Is there some sort of spam protection? #1286

Open
makedir opened this issue Mar 4, 2025 · 9 comments
Open

Is there some sort of spam protection? #1286

makedir opened this issue Mar 4, 2025 · 9 comments
Labels
question This is a question

Comments

@makedir
Copy link

makedir commented Mar 4, 2025

Hello,

I have a problem using the NTFY service, that randomly messages wont give any JSON response, mostly after rending multiple messages in a short pteriod of time, like every x seconds or so one message, randomly it happens after a while, that it stops working.

@makedir makedir added the question This is a question label Mar 4, 2025
@wunter8
Copy link
Contributor

wunter8 commented Mar 5, 2025

Are you using the public ntfy.sh instance? Are you hitting the rate limits and getting a 429 HTTP error?

@makedir
Copy link
Author

makedir commented Mar 5, 2025

Yes, it was the rate limit. I was debugging with a Tasmota ESP32 device sending messages to it, but there was no Json feedback from the server after a while. When I then used curl, I got a error json back notfying about a rate limit. Do you maybe know why this is the case? It seems the error Json is somehow different than the normal Json the server sends. Not sure if that is optimal.

@wunter8
Copy link
Contributor

wunter8 commented Mar 5, 2025

You should get an error JSON body initially. If you keep sending messages and ignore the 429, your IP address will be (temporarily) banned. Then the connection would timeout, and you would get no response. Maybe that's what you saw?

@makedir
Copy link
Author

makedir commented Mar 5, 2025

Thank you for the information. That was mostly what I was seeing because of temporary IP bans. Would you be alo affected by this if you used a VPN that the IP might randomly be blocked by the NTFY server?

@wunter8
Copy link
Contributor

wunter8 commented Mar 5, 2025

The VPN's IP wouldn't be "randomly blocked," but if you or others using the VPN send requests to ntfy.sh and ignore 429 responses, the VPN's IP address could be blocked.

@makedir
Copy link
Author

makedir commented Mar 8, 2025

@wunter8 I sometimes get a weird respons from the server in the form:

01:24:39.005 ntfy.sh status=1 response=

or

1:27:55.391 ntfy.sh status=2 response=

what are status code 1 and 2?

@wunter8
Copy link
Contributor

wunter8 commented Mar 8, 2025

Where are you seeing that? What is it in response to?

@makedir
Copy link
Author

makedir commented Mar 8, 2025

I tried to do it on a ESP32 with Tasmota and Berry in the form:

tasmota.add_rule('SSerialReceived#Message',
def (value,trigger,data)
var wc = webclient()
wc.begin('https://ntfy.sh/MYTOPIC')
var status = wc.POST(f'{value}')
var response = wc.get_string()
print(f'ntfy.sh {status=} {response=}')
wc.close()
if status == 200
tasmota.cmd('SSerialSend2 WebQuerySent')
else
tasmota.cmd('SSerialSend2 WebQueryError')
end
end, 'SSerialReceivedRule1')

It most of the time works, but sometimes I get status code 1 or 2 back with no message from the NTFY server.

@wunter8
Copy link
Contributor

wunter8 commented Mar 8, 2025

I'm not sure what that is. I don't think ntfy ever returns 1 or 2 as an HTTP code. Is it possible that is an error/exit code from the wc.POST command?

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