|
34 | 34 | {{end}}
|
35 | 35 | </head>
|
36 | 36 | <body>
|
| 37 | +<div id="header"><div id="headerBox"><img src="static/img/ntfy.png" alt="ntfy"/></div></div> |
37 | 38 | <div id="main"{{if .Topic}} style="display: none"{{end}}>
|
38 |
| - <h1><img src="static/img/ntfy.png" alt="ntfy"/><br/>ntfy.sh | simple HTTP-based pub-sub</h1> |
| 39 | + <h1>ntfy.sh | simple HTTP-based pub-sub</h1> |
39 | 40 | <p>
|
40 |
| - <b>Ntfy</b> (pronounce: <i>notify</i>) is a simple HTTP-based <a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern">pub-sub</a> notification service. |
41 |
| - It allows you to send notifications <a href="#subscribe-phone">to your phone</a> or desktop via scripts from any computer, |
42 |
| - entirely <b>without signup or cost</b>. It's also <a href="https://github.com/binwiederhier/ntfy">open source</a> if you want to run your own. |
| 41 | + <b>ntfy</b> (pronounce: <i>notify</i>) is a simple HTTP-based <a href="https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern">pub-sub</a> notification service. |
| 42 | + It allows you to send notifications to your phone or desktop via scripts from any computer, |
| 43 | + entirely <b>without signup, cost or setup</b>. It's also <a href="https://github.com/binwiederhier/ntfy">open source</a> if you want to run your own. |
43 | 44 | </p>
|
44 |
| - |
45 | 45 | <div id="screenshots">
|
46 | 46 | <a href="static/img/screenshot-curl.png"><img src="static/img/screenshot-curl.png"/></a>
|
47 | 47 | <a href="static/img/screenshot-web-detail.png"><img src="static/img/screenshot-web-detail.png"/></a>
|
|
51 | 51 | <a href="static/img/screenshot-phone-notification.jpg"><img src="static/img/screenshot-phone-notification.jpg"/></a>
|
52 | 52 | </span>
|
53 | 53 | </div>
|
54 |
| - |
55 | 54 | <p>
|
56 |
| - There are many ways to use Ntfy. You can send yourself messages for all sorts of things: When a long process finishes or fails, |
57 |
| - or to notify yourself when somebody logs into your server(s). Or you may want to use it in your own app to distribute messages to subscribed clients. |
58 |
| - Endless possibilities 😀. Be sure to check out the <a href="#examples">examples below</a>. |
| 55 | + There are many ways to use it: Notify yourself when a build finishes, when an rsync is done or a backup fails, |
| 56 | + or know when somebody logs into your server. There are <a href="#examples">many more examples</a>, endless possibilities 😀. |
59 | 57 | </p>
|
60 | 58 |
|
61 | 59 | <h2 id="publish" class="anchor">Publishing messages</h2>
|
|
64 | 62 | Because there is no sign-up, <b>the topic is essentially a password</b>, so pick something that's not easily guessable.
|
65 | 63 | </p>
|
66 | 64 | <p class="smallMarginBottom">
|
67 |
| - Here's an example showing how to publish a message using <tt>curl</tt> (via POST): |
| 65 | + Here's an example showing how to publish a message using a POST request (via <tt>curl -d</tt>): |
68 | 66 | </p>
|
69 | 67 | <code>
|
70 | 68 | curl -d "Backup successful 😀" <span class="ntfyUrl">ntfy.sh</span>/mytopic
|
71 | 69 | </code>
|
72 | 70 | <p class="smallMarginBottom">
|
73 |
| - And another one using PUT: |
| 71 | + And another one using PUT (via <tt>curl -T</tt>): |
74 | 72 | </p>
|
75 | 73 | <code>
|
76 |
| - echo -en "\u26A0\uFE0F Unauthorized login" | curl -sT- <span class="ntfyUrl">ntfy.sh</span>/mytopic |
| 74 | + echo -en "\u26A0\uFE0F Unauthorized login" | curl -T- <span class="ntfyUrl">ntfy.sh</span>/mytopic |
77 | 75 | </code>
|
78 | 76 | <p class="smallMarginBottom">
|
79 | 77 | Here's an example in JS with <tt>fetch()</tt> (see <a href="https://github.com/binwiederhier/ntfy/tree/main/examples">full example</a>):
|
|
200 | 198 |
|
201 | 199 | <h2 id="examples" class="anchor">Examples</h2>
|
202 | 200 | <p>
|
203 |
| - There are a million ways to use Ntfy, but here are some inspirations. I try to collect |
| 201 | + There are a million ways to use ntfy, but here are some inspirations. I try to collect |
204 | 202 | <a href="https://github.com/binwiederhier/ntfy/tree/main/examples">examples on GitHub</a>, so be sure to check
|
205 | 203 | those out, too.
|
206 | 204 | </p>
|
|
220 | 218 |
|
221 | 219 | <h3 id="example-web" class="anchor">Example: Server-sent messages in your web app</h3>
|
222 | 220 | <p>
|
223 |
| - Just as you can <a href="#subscribe-web">subscribe to topics in this Web UI</a>, you can use Ntfy in your own |
| 221 | + Just as you can <a href="#subscribe-web">subscribe to topics in this Web UI</a>, you can use ntfy in your own |
224 | 222 | web application. Check out the <a href="example.html">live example</a> or just look the source of this page.
|
225 | 223 | </p>
|
226 | 224 |
|
|
302 | 300 | is to facilitate instant notifications on Android.
|
303 | 301 | </p>
|
304 | 302 |
|
| 303 | + <p> |
| 304 | + <b id="battery-usage" class="anchor">How much battery does the Android app use?</b><br/> |
| 305 | + If you use the ntfy.sh server and you don't use the <i>instant delivery</i> feature, the Android app uses no |
| 306 | + additional battery, since Firebase Cloud Messaging (FCM) is used. If you use your own server, or you use |
| 307 | + <i>instant delivery</i>, the app has to maintain a constant connection to the server, which consumes about 4% of |
| 308 | + battery in 17h of use (on my phone). I use it and it makes no difference to me. |
| 309 | + </p> |
| 310 | + |
| 311 | + <p> |
| 312 | + <b id="instant-delivery" class="anchor">What is instant delivery?</b><br/> |
| 313 | + Instant delivery is a feature in the Android app. If turned on, the app maintains a constant connection to the |
| 314 | + server and listens for incoming notifications. This consumes <a href="#battery-usage">additional battery</a>, |
| 315 | + but delivers notifications instantly. |
| 316 | + </p> |
| 317 | + |
305 | 318 | <p>
|
306 | 319 | <b id="why-no-ios" class="anchor">Why is there no iOS app (yet)?</b><br/>
|
307 |
| - I don't have an iPhone or a Mac, so I didn't make an iOS app yet. I'd be awesome if |
| 320 | + I don't have an iPhone or a Mac, so I didn't make an iOS app yet. It'd be awesome if |
308 | 321 | <a href="https://github.com/binwiederhier/ntfy/issues/4">someone else could help out</a>.
|
309 | 322 | </p>
|
310 | 323 |
|
|
325 | 338 | <div id="detail"{{if not .Topic}} style="display: none"{{end}}>
|
326 | 339 | <div id="detailMain">
|
327 | 340 | <button id="detailCloseButton"><img src="static/img/close_black_24dp.svg"/></button>
|
328 |
| - <h1><img src="static/img/ntfy.png" alt="ntfy"/><br/><span id="detailTitle"></span></h1> |
| 341 | + <h1><span id="detailTitle"></span></h1> |
329 | 342 | <p class="smallMarginBottom">
|
330 |
| - <b>Ntfy</b> is a simple HTTP-based pub-sub notification service. This is a Ntfy topic. |
| 343 | + <b>ntfy</b> is a simple HTTP-based pub-sub notification service. This is a ntfy topic. |
331 | 344 | To send notifications to it, simply PUT or POST to the topic URL. Here's an example using <tt>curl</tt>:
|
332 | 345 | </p>
|
333 | 346 | <code>
|
|
0 commit comments