binwiederhier / ntfy Goto Github PK
View Code? Open in Web Editor NEWSend push notifications to your phone or desktop using PUT/POST
Home Page: https://ntfy.sh
License: Apache License 2.0
Send push notifications to your phone or desktop using PUT/POST
Home Page: https://ntfy.sh
License: Apache License 2.0
See healthchecks/healthchecks#590
This should be pretty simple, see https://github.com/healthchecks/healthchecks/blob/master/hc/api/transports.py#L384
Also we'd have to write docs and such; but there are enough examples.
The Web and curl allow for subscribing to multiple topics, like this:
Subscribing to multiple topics (topic1,topic2,...)
It's possible to subscribe to multiple topics in one HTTP call by providing a comma-separated list of topics in the URL. This allows you to reduce the number of connections you have to maintain:
That does not work in the app currently, but would make "following" multiple topics easier.
Is there a way to delete all messages (or all messages since )?
"I used a similar push notification service (Pushover) on my iPhone to send URLs in messages (to open a browser page on my phone). It could be neat to see a similar functionality for ntfy"
"Similarly to URLs, maybe attachments (like images) - imagine an App with push notifications, that sends an embedded image of the failed screenshot"
The CLI could consist of 3 features:
Just like today, possibly rename command to ntfy serve
Just like curl:
$ ntfy subscribe mytopic1,mytopic2
{"id":"UiLWPRJAi1","time":1639044609,"event":"message","topic":"mytopic1","message":"It is Thu Dec 09 2021 17:10:09 GMT+0700 (Western Indonesia Time). This is a test."}
{"id":"idFle3ak4S","time":1639074191,"event":"message","topic":"mytopic2","message":"Test"}
...
With a hook:
$ ntfy subscribe mytopic1,mytopic2 --hook 'notify-send "{{.Message}}'
As part of the daemon
$ cat config.yml
subscribe:
-
- topic: ntfy.sh/mytopic
- hook: 'notify-send "{{.Message}}'
$ ntfy serve # runs daemon
Send messages
ntfy send mytopic "This is a message"
...
Hi! I am the guy from Reddit!
Android automation apps are tools that helps you automate your android smartphone. They are like simple automation programming. There's a lot of them. Most known is Tasker, but also MacroDroid and Auomate too and there's also lot of other.
I see big potential in communicating between devices throught ntfy.sh. Of course many of these apps have their own solution, for example MacroDroid runs its own webhook server and there's a lot of other solutions for Tasker, but one more option is always good and your service seems to have a lot of more options. SO NOW TO THE POINT.
HOW TO INTEGRATE NFTY WITH AUTOMATIZATION APPS
As I mentioned before MacroDroid is able to use curl, but I don't know Tasker or any else, but they propably should also be able to.
There are 2 best ways how to integrate nfty with automatization apps
Here is official video on how to create a Tasker pugin
https://piped.kavin.rocks/watch?v=48IVJgDtu6Y
However in this case I think intent solution would be much more simple and also more could make use of it. Tasker plugin is good for advanced triggers and actions, with a lot of data, but for something simple like messages it's not propably needed. Also more apps that doesn't work with Tasker plugins could make use of it.
let me give an EXAMPLE OF BROADCAST intent after message is received. I am an amateur so forgive me any mistakes. I am not writing in code, just showing what should intent contain.
Action: io.heckel.ntfy.messageReceived
Extra 'topic': my_custom_topic
Extra 'title': my_custom_title
Extra 'priority': 3
Extra 'tags': warning,skull
Extra 'message': my_custom_message
One note. There should be a ability to turn this intent broadcasting on and off, so any unwanted apps couldn't catch or send intents and misuse the ability.
I would like to schedule a summary notification, daily at 8am with minimal content something like:
Last 24 hours:
New: 24 messages
Unread: 3 messages (2 /topic1, 1 /topic2)
This would let me see at a glance if any hot topics had come in overnight on say, a chatty release/testing night and be more comfortable turning off my notifications.
"I am trying integration, but I found out, that if I want to send message throught intent that contains only numbers it will fail. If I use curl it won't fail. For example '5555' will fail, but '5555t' won't fail, because there's a letter.
Topic is no problem, but message containing only numbers will fail."
Make delivery mode configurable in the app:
See https://discord.com/channels/874398661709295626/874398661709295629/919114373992165437
I picture this very simple:
curl ntfy.sh/mytopic/json?id=device1
And then:
curl -d "Hi" "Targets: device1,device2" ntfy.sh/mytopic
I would like to require authentication to pub/sub to topics at least on private servers.
I think Google Identity would be a good provider here since authenticating to it is a familiar part of the types of workflows I would like to incorporate this into.
Looks great and very suitable for raspis. Any chance of arm (docker) builds?
Does it using flutter? What if I want a flutter as client?
So that we can cross platform get notifications.
If you're interested in making an iOS app, I'm more than happy to help out. Unfortunately I don't have an iPhone or a Mac so it's a little tricky for me.
Significant work has been done here (https://github.com/Copephobia/ntfy-ios), but it's stale now, sadly.
I have picked up the work in https://github.com/binwiederhier/ntfy-ios and will hopefully be able to release soon.
A scenario may be:
If I click on the ntfy.sh link, it will attempt to open the app and subscribe to the topic, so that I can view it from there.
If I do not have the ntfy.sh link, it will display the web page for that topic.
$ curl -Timage.jpg ntfy.sh/mytopic
{"message": "Attached file", "attachment":{"url":"https://ntfy.sh/mytopic/file/JxAebdF.jpg","type":"image/jpeg","size":1234,"expires":12345,"url":"https://ntfy.sh/mytopic/file/JxAebdF.jpg"}}
$ curl -Timage.jpg -H "Filename: ntfy.sh/mytopic
{"message": "Attached file", "attachment":{"name":"image.jpg","type":"image/jpeg","size":1234,"expires":12345,"url":"https://ntfy.sh/mytopic/file/JxAebdF.jpg"}]
"I had subscribed to mytopic and left my tablet off to the side for some of the weekend. When I unsubscribed from it this morning, it did take a bit to remove itself from the UI. Would like to see if that can be replicated"
As requested per beta user feedback.
Currently ntfy.sh runs on a server in Germany, with a rather high latency. I'd like to move it to an EC2 instance with an nginx frontend.
I can successfully push a message to, but I can't get it in a GET request with curl -s
Hey @ntfy, if you're reading this, would you be willing to give up your username, so I can create a GitHub org for this project. Looks like you're not using the GitHub account anyway. I'd be willing to buy you a coffee or the like for your troubles.
I think it'd be super cool to be able to show a progress bar in the Android app for something that's running remotely, like a compilation, or a build process.
id=$(curl -d "Build process starting" ntfy.sh/mytopic | jq .id)
for progress in 10 20 30 40 50 60 70 80 90 100; do
curl -X PATCH -d "Build process running, currently ${progress}%" -H "Progress: $progress" ntfy.sh/mytopic/$id
sleep 10
done
This entirely relies on #43, and is pretty easy once that's implemented.
Priorities: 1-5 (5=high, 1=low)
curl -d "my message -H "X-Priority: low" ntfy.sh/mytopic
curl -d "my message -H "Priority: high" ntfy.sh/mytopic
curl -d "my message -H "prio: 5" ntfy.sh/mytopic
curl -d "my message -H p:5 ntfy.sh/mytopic
Title:
curl -d "my message -H "X-Title: This is a title" ntfy.sh/mytopic
curl -d "my message -H "Title: This is a title" ntfy.sh/mytopic
curl -d "my message -H "t: This is a title" ntfy.sh/mytopic
curl -d "my message -H "ti: This is a title" ntfy.sh/mytopic
Tags:
curl -d "my message -H "X-Tags: warning,skull" ntfy.sh/mytopic
curl -d "my message -H "Tags: warning,skull" ntfy.sh/mytopic
curl -d "my message -Hta:warning,skull ntfy.sh/mytopic
Is it possible to process utf-8 encoding? Say, I've sent russian strings and gets bad symbols. Take a look at ntfy.sh/manson_alerts channeln you'll see it.
Send messages to topics
/ntfy send mytopic This is a message
/ntfy send myserver.com/mytopic This is a message
/ntfy send --tags=warning,skull mytopic This is a message
...
Subscribe to messages (much cooler) to forward messages to channel
/ntfy subscribe ntfy.sh/mytopic
I've been working hard on this: binwiederhier/ntfy-android#5
This is annoying if your self-hosted instance is in your LAN and not always reachable.
Return token on publish
Or set token when publishing
I propose allowing GET requests with no parameters to send simple ping notification without message. Quicker to type in terminal when someone wants a notification but not necessarily a message
$ sudo dpkg -i dist/ntfy_v1.5.2-next_linux_amd64.deb
(Reading database ... 406444 files and directories currently installed.)
Preparing to unpack .../ntfy_v1.5.2-next_linux_amd64.deb ...
Unpacking ntfy (1.5.2~next) over (1.5.2~next) ...
Setting up ntfy (1.5.2~next) ...
chown: cannot access '"/var/cache/ntfy/cache.db"': No such file or directory
Options:
Cache: 10m/yes/no/max/default
Right now:
$ curl -v -d "This was a little delayed" -H "Delay: 1s" ntfy.sh/abc
> POST /abc HTTP/1.1
> Host: ntfy.sh
> Delay: 1s
...
< HTTP/1.1 400 Bad Request
< Server: nginx
...
Bad Request
Should be:
$ curl -v -d "This was a little delayed" -H "Delay: 1s" ntfy.sh/abc
> POST /abc HTTP/1.1
> Host: ntfy.sh
> Delay: 1s
...
< HTTP/1.1 400 Bad Request
< Server: nginx
< Content-Type: application/json
...
{"error":192,"http":400,"message":"delay must be between 10s and 3 days"}
This is due to Android's limited way of specifying which links should be handled by the app. I am thinking maybe we should just handle
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.