Giter Site home page Giter Site logo

binwiederhier / ntfy Goto Github PK

View Code? Open in Web Editor NEW
16.7K 86.0 617.0 34.54 MB

Send push notifications to your phone or desktop using PUT/POST

Home Page: https://ntfy.sh

License: Apache License 2.0

Go 62.36% Dockerfile 0.04% Makefile 0.73% Shell 0.28% CSS 0.06% JavaScript 36.38% HTML 0.15%
rest-api pubsub notifications curl push-notifications ntfy ntfysh

ntfy's Issues

Android, Feature Request: allow subscribing to multiple topics

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.

Delete messages

Is there a way to delete all messages (or all messages since )?

Support for other media types: images, URLs, ...

"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"

ntfy CLI

The CLI could consist of 3 features:

Server

Just like today, possibly rename command to ntfy serve

Subscribe to topics

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"
...

Android automation apps integration (Tasker, MacroDroid, Automate, ...)

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

  • via Tasker plugin (which also MacroDroid and Automate suppports)
  • via broadcasting intents (which I think is better and simpler for this kind of thing)

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.

Daily Summary Notification

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.

Sending int/long extras for SEND_MESSAGE should work

"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."

Auth

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.

ARM Support

Looks great and very suitable for raspis. Any chance of arm (docker) builds?

Sending files

$ 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"}]

Unsubscribing takes long sometimes

"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"

Move to EC2 server

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.

`curl -s` doesn't work

I can successfully push a message to, but I can't get it in a GET request with curl -s

ntfy GitHub org

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.

Progress in notification via Progress: 0-100

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, title, tags

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

UTF8

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.

Discord/Slack bot

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

`chown: cannot access '"/var/cache/ntfy/cache.db"': No such file or directory`

$ 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

API errors should be JSON and be more user friendly

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"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.