News for hackers. Stuff that matters.
Re:Show HN: A tool to send push notifications to your phone,... by rsync on Tuesday December 28, 2021 @06:35PM (#29719670)
What is the advantage of sending a push notification as opposed to a SMS alert ?

My alerting regime is also built on 'curl' commands that generate SMS via twilio.

For example:

  curl -s -X POST -d "Body=$msg" -d "From=$from" -d "To=$to" "https://api.twilio.com/2010-04-01/Accounts/$accountsid/Messages" -u "$accountsid:$authtoken"
... and I am very happy with the ability to send SMS with both a configurable from and to number.

However I am interested and open-minded - what are the benefits of using a push notification ?

Re:Show HN: A tool to send push notifications to your phone,... by binwiederhier on Tuesday December 28, 2021 @06:43PM (#29719738)
First of all, I love your username. Are you affiliated with the rsync tool or just an rsync lover like me? If you are, I bow my head to you and thank you. :-D

If you are happy with SMS and twilio, then use it. Having many options is generally always awesome.

The main reason I made ntfy was because I mumbo jumbo (that's a technically term) on all sorts of servers for work and for fun, and I often do things in a tmux or screen that take forever, like rsync something (ha!) or reseed a MySQL replica. On many of those servers, I cannot or should not install anything, and I certainly don't want to leave an auth token in the bash history.

For those use cases, having a short command to ping me when something is done is FREAKING AWESOME. This has become muscle memory to me by now:

   rsync -av bla root@myserver:/bla; curl -d "rsync done" ntfy.sh/philalerts
No auth token. No looong string of things. Just a simple curl.

But again. If you're happy with SMS+twilio, then there's no reason to switch. Though I would love it if you could give it a shot.

Re:Show HN: A tool to send push notifications to your phone,... by rsync on Tuesday December 28, 2021 @09:00PM (#29720856)
"First of all, I love your username. Are you affiliated with the rsync tool or just an rsync lover like me?"

I am merely an rsync lover like you.

In 2005 I named my company rsync.net because I thought it was descriptive of the service.

Prior to naming it that, I explicitly asked permission from both the original author of 'rsync' and the maintainers at the time. They said they had no problem with it.

I have not authored any piece of the rsync tool.

Re:Show HN: A tool to send push notifications to your phone,... by anaganisk on Wednesday December 29, 2021 @11:40AM (#29726478)
Just yesterday was checkout out rsync.net Anyways, notifications means no cost. I can run this server along with my existing vps. Twilio is quickly pricy in some countries. Also unencrypted if you want to keep your alerts private. Top of my head these are things I can think of.
Re:Show HN: A tool to send push notifications to your phone,... by nine_k on Wednesday December 29, 2021 @04:14AM (#29723212)
Will you be flooded with spam messages now that you have published the magic URL?

Some twisted soul could even put sending a message to you via cronrab every minute, and you don't seem to have any way to block it, or filter it from the rest.

I'd say that it's infinitely better to have an opaque an otherwise useless API token in your bash history than to have a URL of a bare and uncontrolled web service in the same bash history, and now on the open internet.

If I were to design a service like that, I'd have an URL like domain.api/username/${token}, where the token can be changed and / or retited, should it become a target of a spam attack. Exporting this token once in the beginning of a shell session should not be hard; SSH even allows you do it with SendEnv.

Re:Show HN: A tool to send push notifications to your phone,... by binwiederhier on Wednesday December 29, 2021 @04:49AM (#29723361)
I responded here: https://news.ycombinator.com/item?id=29723347

As for the retirable token, you are right. In the current approach this cannot be done. I have an open ticket for auth (optional) that I'll soon implement. I want to get it right, so if you have thoughts, I'd love input on it: https://github.com/binwiederhier/ntfy/issues/19

Re:Show HN: A tool to send push notifications to your phone,... by NotEvil on Wednesday December 29, 2021 @04:29AM (#29723261)
That url is the demo one. I think the author have his own magic url for personal use
Re:Show HN: A tool to send push notifications to your phone,... by binwiederhier on Wednesday December 29, 2021 @04:46AM (#29723347)
Yes that's correct. You control your own destiny. If you choose any of the demo topic names, you may be getting spam. If you choose your username, likely not. If you choose "phil-likes-dogs" then there's almost no chance someone will guess that.

It's just like with passwords.

Re:Show HN: A tool to send push notifications to your phone,... by icelancer on Tuesday December 28, 2021 @07:42PM (#29720254)
He is the rsync.
Re:Show HN: A tool to send push notifications to your phone,... by binwiederhier on Tuesday December 28, 2021 @07:50PM (#29720327)
Oh my, I'm star struck. I've used rsync, written a about rsync (in my master thesis) and looked at rsync code a long time ago. Amazing :-D
Re:Show HN: A tool to send push notifications to your phone,... by stavros on Tuesday December 28, 2021 @08:41PM (#29720724)
To clarify, the user rsync runs the service rsync.net, AFAIK he didn't write the tool rsync (that was Andrew Tridgell, who now writes Ardupilot).
Re:Show HN: A tool to send push notifications to your phone,... by boomskats on Tuesday December 28, 2021 @07:51PM (#29720332)
Yeah, just go ahead and assume rsync's gender pronoun.
Re:Show HN: A tool to send push notifications to your phone,... by stavros on Tuesday December 28, 2021 @08:43PM (#29720745)
Who's assuming? That's John Kozubik.
Re:Show HN: A tool to send push notifications to your phone,... by boomskats on Wednesday December 29, 2021 @05:58AM (#29723742)
I guess it was me doing the assuming here.
Re:Show HN: A tool to send push notifications to your phone,... by syntaxing on Tuesday December 28, 2021 @07:00PM (#29719866)
This is super awesome, definitely borrowing this to send a text push notification

Edit: isn’t this super costly for personal use?

Re:Show HN: A tool to send push notifications to your phone,... by rsync on Tuesday December 28, 2021 @09:04PM (#29720884)
"Edit: isn’t this super costly for personal use?"

Not really ... I notice twilio deducting USD $9 every 10 or 12 days ? It's a business expense.

I also 'lookup' numbers to check if they are mobile or not:

  curl -s -X GET "https://lookups.twilio.com/v1/PhoneNumbers/$number?Type=carrier&Type=caller-name" -u $accountsid:$authtoken | /usr/local/bin/jq '.'
... which is handy. Usually shows their name and carrier ID as well.

As you can see, I pipe it through 'jq' because that's what all the cool kids do.

Re:Show HN: A tool to send push notifications to your phone,... by scgtrp on Wednesday December 29, 2021 @04:32AM (#29723279)
If (you're into microoptimizing things and) all you care about is whether they're mobile, you can leave out `Type=caller-name` to save a whole one cent per lookup :)

And if you're doing this before you try to SMS them, you can skip the lookup entirely, if it's a landline you'll just get an error back.

(I work at a company that uses Twilio heavily and it's full of this sort of microoptimization)

Re:Show HN: A tool to send push notifications to your phone,... by sgarland on Thursday December 30, 2021 @10:49AM (#29737687)
How is `/usr/local/bin` not in your PATH?
Re:Show HN: A tool to send push notifications to your phone,... by binwiederhier on Thursday December 30, 2021 @06:11PM (#29742679)
Maybe it's a custom jq version?
Re:Show HN: A tool to send push notifications to your phone,... by eknkc on Wednesday December 29, 2021 @12:08AM (#29722110)
I think SMS is an American thing at this point? Your approach definitely would work fine but I’d not have thought about SMS if you gave me a year on this issue. It is an obsolete, half forgotten thing here.
Re:Show HN: A tool to send push notifications to your phone,... by tluyben2 on Wednesday December 29, 2021 @01:20AM (#29722444)
Where are you from? Here in west eu it's plenty used by companies for 2fa and notifications.
Re:Show HN: A tool to send push notifications to your phone,... by pmontra on Wednesday December 29, 2021 @02:10AM (#29722653)
I confirm this. It's also true that they seem to be the only users of SMSes now. People are using WhatsApp or Telegram or Messenger, roughly 90-9-1 in my experience (Italy.) Cost is not the issue because plans include at least hundreds of SMS if they are not unlimited. It's functionality: pictures, vocals, videos, multi user chats, etc.
Re:Show HN: A tool to send push notifications to your phone,... by hiptobecubic on Thursday December 30, 2021 @11:37PM (#29744942)
I was never a huge SMS user, but as far as I can tell, it seems pretty on par with chat services these days. I guess technically it's MMS, but who cares (or knows)?

I have a group SMS with family where people are constantly sharing pictures etc and it is working fine.