Giter Site home page Giter Site logo

binwiederhier / ntfy Goto Github PK

View Code? Open in Web Editor NEW
16.6K 87.0 615.0 34.41 MB

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

Home Page: https://ntfy.sh

License: Apache License 2.0

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

ntfy's Introduction

ntfy

ntfy.sh | Send push notifications to your phone or desktop via PUT/POST

Release Go Reference Tests Go Report Card codecov Discord Matrix Matrix space Healthcheck Gitpod

ntfy (pronounced "notify") is a simple HTTP-based pub-sub notification service. With ntfy, you can send notifications to your phone or desktop via scripts from any computer, without having to sign up or pay any fees. If you'd like to run your own instance of the service, you can easily do so since ntfy is open source.

You can access the free version of ntfy at ntfy.sh. There is also an open-source Android app available on Google Play or F-Droid, as well as an open source iOS app available on the App Store.

ntfy Pro 💸 🎉

I now offer paid plans for ntfy.sh if you don't want to self-host, or you want to support the development of ntfy (→ Purchase via web app). You can buy a plan for as low as $5/month. You can also donate via GitHub Sponsors, and Liberapay. I would be very humbled by your sponsorship. ❤️

Getting started | Android/iOS | API | Install / Self-hosting | Building

Chat/forum

There are a few ways to get in touch with me and/or the rest of the community. Feel free to use any of these methods. Whatever works best for you:

Announcements/beta testers

For announcements of new releases and cutting-edge beta versions, please subscribe to the ntfy.sh/announcements topic. If you'd like to test the iOS app, join TestFlight. For Android betas, join Discord/Matrix (I'll eventually make a testing channel in Google Play).

Contributing

I welcome any contributions. Just create a PR or an issue. For larger features/ideas, please reach out on Discord/Matrix first to see if I'd accept them. To contribute code, check out the build instructions for the server and the Android app. Or, if you'd like to help translate 🇩🇪 🇺🇸 🇧🇬, you can start immediately in Hosted Weblate.

Translation status

Sponsors

I have just very recently started accepting donations via GitHub Sponsors, and Liberapay. I would be humbled if you helped me carry the server and developer account costs. Even small donations are very much appreciated. A big fat Thank You to the folks who have sponsored ntfy in the past, or are still sponsoring ntfy:

I'd also like to thank JetBrains for their awesome IntelliJ IDEA, and DigitalOcean (referral link) for supporting the project:

Code of Conduct

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Please be sure to read the complete Code of Conduct.

License

Made with ❤️ by Philipp C. Heckel.
The project is dual licensed under the Apache License 2.0 and the GPLv2 License.

Third-party libraries and resources:

ntfy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ntfy's Issues

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

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

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.

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

`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

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

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.

Delete messages

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

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.

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"

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.

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.

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

ARM Support

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

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

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.

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.

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"

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.

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.