Open Source Push Notifications! Get notified of any event you can imagine. Triggers abound!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] Source Advocate and I'm back with another video and today I wanted to talk about push notifications so I've shown you lots of different ways that you can accomplish kind of your own rolled push notifications you could use something like rocket chat and use their push notification service but they're starting to crack down on that more and understand that right you can get tons and tons of people uptaking something and using your push notification server which means you've got to run a more beefy server so I can I can get that so I was looking for other options and I've shown you home assistant does push notifications which is awesome there's just tons of things out there there's a project called a prize that I want to cover in the future but I was just kind of looking around to see what else was there and I came across intify or notify I think is really how it's pronounced but I say intify ntfy is what it is and I've shown you this in the past I showed you this a long time ago it's a command line tool that you can use to send messages and I've actually been using the web hook version of that to send myself messages from a client's server when it finishes a backup process every night so that I get a notification on my phone in the morning and I realize hey it worked that's great if it didn't work it sends me a message let me know like hey something didn't happen that should have so I can check in and see what's going on but most of the time I just get the hey it worked which is awesome now I do that through rocket chat I just have a a channel that I created that's private and it sends it through a web hook to Rocket chat which is great I do a similar thing with my uptime Kuma where I have it send a web hook request also to the rocket chat server so if something goes down it sends me that but I get it the rocket chat guys are kind of like Hey we're getting you know too much too much stuff going on they might take away that server at some point so I was looking for something different and I found ntfy.sh which is part of that intify program and they've got push notifications Made Easy and you can kind of see a little running thing over here of what it looks like and they've got it for Google Play F Droid and the app store for iOS there's a little bit of setup to make it work with iOS so I want to go through that today and I'm going to go through how to set this up and it's really not that difficult I want to say thank you to all of my subscribers and all of my patrons over at patreon seriously you guys make this so worth it for me to do these videos every week I really truly enjoy it and I just can't say thank you enough if you're enjoying these videos subscribe let YouTube know that I'm doing a good job by subscribing to the channel plus you'll get notified when I have new videos coming out and finally if you're enjoying what I'm doing give it a like just click on that thumbs up and that way YouTube knows that you like it and they'll pass it along to other people that might enjoy my content as well I really appreciate it thank you again let's get started I'm going to do the docker version but look here there's Linux binaries I know there's a lot of you guys or there's some of you guys who don't like Docker and don't want to use that you just want to install it straight up so here's Linux binaries here's Debian Ubuntu repositories if you keep going down you've got Fedora Rel Centos Alma Rocky repositories you've got Arch Linux if you want to do it that way if you use NYX Os or the Nix package manager you've got that option as well Mac OS and if you're on Windows you can use scoop to do it from there so pretty cool but Docker again that's just my preferred way so he's got some really great examples the documentation on this is absolutely terrific so I definitely want to make sure to point that out if you guys are looking for answers if you've got questions the documentation on here is really really good it breaks everything down I've been reading through it for the last few days trying to kind of get everything put together for the video there's even kubernetes support so if you like to run kubernetes you've got options there as well so I think really really cool but I just wanted to go through kind of what this does and how it works so before I get into the installation is set up I want to just show you what it can do so I've already set up a test server I'm going to go through setting up another server with you guys but I've got this test server that i s that I've set up and I've got a domain pointed at it which makes it to me more useful you can run this just locally if you want to but push notifications get a little bit more tricky when you do that you really need to have a caca signed SSL certification on your domain so that you can get those push notifications go through at least on iOS so yeah so I've got these two topics that I've created so one just called Brian test and one called my test topic zero two one two so the topic is kind of like a thing that you create and that's what tells your your device what to look for so this uses Pub sub messaging which is very popular these days it makes it really nice to be able to throw a message out onto a server and that's published you then subscribe to those messages and you will see those messages so I'm going to create a new publish published message right here so I'm going to go up here to all notifications and then I'm just going to publish a new message so right here it says hey here's what the URL is going to be when you publish this so it's pointing to my server which is awesome and then this thing just says what's the topic you want so we can create a new topic so I'm just going to call this video test and then I'm going to give it a title this is a message for the video and this is just a test message for the video I think into phi.sh is really awesome open source software okay so forgive my spelling I'm typing fast so you guys don't have to just sit through that but I created this topic so I'm going to hit send now it goes but you notice it's not here in the list it's not going to be on either of these because I've not subscribed to that topic yet so what I have to do is go here and basically say I want to subscribe to that topic so I'm going to put in video Dash test so you need to know what that topic is you can kind of say generate a name if you don't want to create a topic and then you can say use another server and put in a different server URL but in this case I want the default server URL so I'm going to say subscribe and as soon as I subscribe I can see the message I just created now if I send any other messages on that topic with that topic they'll show up here now if I do it from here if I just go here you notice it doesn't give me the topic field it just defaults to I'm going to send it on this topic so I can just create a message and send it and it's going to be out there and whoever subscribed to it would get it if I go back to here it's going to give me that topic field again so I just have to say video test and then give it another title so my next message is even better make sure to subscribe and like this video on YouTube I have a patreon in the description if you would like to support my work okay again forgive any misspellings but you get the idea I can hit send it's going to show up up here because I'm subscribed to that topic but I can also see that I've got a new message on this specific topic I can click on it and I can go and read that message I can clear these out when I'm done with them I don't have to leave them there so right now it's saying there's no messages in this topic now I can do the same thing from my phone which is really great and I can get push notifications now I don't have to use the web interface to do this this is just kind of a nice hey here's something that you can use in order to do this so if I open up my terminal I can SSH over first and we'll just go to my test server and I'm just going to go CD Docker Enterprise and I'm going to clear this out so you guys can see what I'm doing here and I'm going to type in a message of int curl Dash D like that and then I'm going to give it a message so the Dash D says send this message as a push or as a put or a post for an API so I'm just going to say this is a message from the CLI and then I'm going to give it Dash capital L because I'm using https and I'm going to say https colon slash slash I'm going to give it my server URL so into Phi serve actually I could probably just do this from intify.sh on this one from localhost so localhost and then I'm going to give it the port number and then a slash and this is going to be video test as the topic and you'll look right back here behind that screen it popped up right away so I was able to send that from the terminal and receive it right away here on the system I would also get it on my phone if I was subscribed on my phone so what I'm going to do is I'm going to open up my phone and I'm going to start recording the screen three two one recording all right and now I'm going to go back and I'm going to post a message from this to my phone so I'm going to use one of these other ones that I'm subscribed to on my phone so we'll do the same thing we'll give the exact same command except instead of video test I'm going to say Brian test and CLI to show on the phone and you've actually got other options you can put but this is just a kind of a fast and dirty way to do this so I sent it and it shows up right here on my phone screen and if I tap it it will take me to the application to that topic where I can see the other things in the topic so you can see kind of how that works here on the iPhone which is pretty great because again getting push notifications is a really great way to get yourself information the reason I show you this is I started thinking about all the things that I want to get notified about and as I run up more servers and I ramp up more servers and I ramp up my network and I'm doing different things I want to get notified about different things happening on my systems and a lot of times I can write a really simple bash script and then just include a line like this that's going to give me that information I mean it this is just something that could be so useful for so many things and the flexibility that's built into intify or notify.sh is really amazing you can put actions on the notifications you can you can just do so many really cool things if you just learn a little bit about how it works really really awesome so I wanted to show you guys how to set up this system today so that you can see exactly what is going on and how I got this all running and how I've got my domain running you'll need a few things to do this and we're going to get into it all right to get into fight up and running you're going to need a couple of things so you either need a machine that you want to run it on maybe you can run on your desktop if you're going to leave that on all the time that's fine because you could use that for transmitting those messages but you want to have something that you can run it on I'm going to run it on a Ubuntu Server completely up to you guys how you do it I'm going to use Docker now again if you don't want to use Docker there's binaries there's different repositories to get this running I like Docker just because it's really easy in my opinion to get it up and running but you do need to have Docker installed and Docker compose for the way that we're going to do this today the other thing you might want is a domain name so I own the domain routemehome.org I have an a record that points routemehome.org to a public IP address and then I can create subdomains on the Fly that also point to this to that public IP address that's how I'm doing this so I've got videos on how to do that I'll link those in the description of the show notes so you guys can see how to do it as well if you're interested in doing that and you don't have it set up yet but you want to have that just so that you get the push notifications you can access this from anywhere and really there's a few things to think about from the security side of things so when I'm sending these messages so when I'm here and I'm sending these messages remember this is a topic now I'm giving these regular names but security through obscurity is never a great way to do things but it is a way that you can do things so you could just create this as more of a random set of letters and numbers and then someone has to know okay first I need to know where your server is which you know where this one is because I've created it second I need to know what your topics are so I need to I need to understand what these topics are in order to subscribe to them so if you use something that's hard for people to guess it's harder for them to get into your topics and see your messages and things that are coming through now you can also do private topics so if we go into settings you'll see right here manage users so you can add users and give those users passwords and set things up so that topics are private to those users and then it uses some basic authentication for those users to be able to see those topics so there's a lot of different options built into this it's very very useful here you've got some other settings where you can set the ding and all those kind of sounds so a lot of stuff right through this web interface you can set up but tons of stuff through the CLI that you can also set up if you just go through and read his documentation he just really really lays out very well what you need so once you've got those few things that you need set up we'll go through and get everything ready so that we can get this running so I'm going to exit this server that I'm on and I'm going to SSH into a different server and I'm going to first thing make a directory I'm going to put Dash p and then Docker slash ntfy and that can be whatever you want you can put ntfy-server if you want to it's fine we're just giving this a folder name so this says make a folder check and see if the docker folder exists if it does use it if it doesn't create it next thing check and see if this serve if this folder exists if it does use it if it doesn't create it so it just does everything in one command for us now we can see it into Docker intify server which is great if I do an LS there's nothing else here yet so I'm going to create a file called Nano I'm going to use Nano a text editor and I'm going to create a file called Docker compose make sure I spell it correctly.yml it's going to open up and I'm going to grab some text and we're going to paste it in and we'll look at what all it means all right so it's going to use version 2.3 of compose which is fine the service is going to be called Notifier ntfy it's going to pull down the image that we need and then we're going to call this container the intify server the command is serve that's fine our environment variable that we're going to use is time zone and that's for me America Chicago you should change this to whatever your time zone is volumes we're going to set up a couple so now he sets these without the dot slash I use the dot slash because I like to keep everything inside of the folder that I'm working in and that's what this little period does right at the beginning it says put it in the current directory and then continue on with these so I've got that slash VAR slash cache slash ntfy and that's going to map to The Container side of VAR slash cache slash ntfy and the same thing for DOT slash Etsy slash ntfy so inside the container to be slash Etc ntfy the ports so he Maps just 80 to 80. again 80 is a very common Port if you're going to run this inside of your own network at home and you're going to run nginx proxy manager or some other kind of reverse proxy you'll have that running on Port 80 most likely so it's better to avoid Port 80. I said it as 81.50 you can use any port that's not in use on your system or that your system isn't being expected to use for some other reason so 8150 is fine so here we've got health check so this is just all this just leave as it is the only thing you need to change is make this port right here the same as what he has set so this port right here needs to match whatever you set over here on the left so if you change it to 8150 you need to change this one to 8150 . everything else here should just remain the same and you should be pretty much set so once you've got that all set and you're happy with it just do control o to save then hit enter to confirm and then just double check everything make sure the spacing looks good making sure everything looks good because yaml is space dependent don't use tabs you have to use spaces but once you're good once you're happy with everything Ctrl X to exit out of the nanotext editor so we're going to do a real quick uh just pull everything down that we need and we're going to set this up like this so we're going to do docker space compose up which means bring down the images and start my containers Dash D and then two ampersands and we're going to do a second command so that first command is Docker compose of Dash D we're going to just tell it right after that run this next command which is Docker space compose logs Dash F which means once you bring everything up and get it started running show me the log output so we're going to do this it's going to start bringing everything down it's not very big so there you can see it says it's listening on Port 80 but remember we're mapping to Port 8150 so while it says it's listening on 80 we know that it's actually running on a different one so what I'm going to do I'm going to put up a new tab I'm going to go to the IP address of that machine and I'm going to do a colon make sure I get the right symbol there and then 81.50 and there we go we've got our new ntfy server now you notice it says this is notification not supported so we have to hit the notifications API it says Support over https so this is one of the reasons that we want to get https and SSL set up but for now we can see that we're here we could actually publish a thing and subscribe to the message and we would see it show up here in the interface everything would be great but what I want to do is I want to get this set up so let's go set it up I'm going to open up my nginx proxy manager if you don't have an index proxy manager and you want to get it I have videos on how to get it set up if I have a script that'll install Docker CE Docker compose an nginx proxy manager all for you with no problem um probably no problem if you're running Linux but if you're using a different reverse proxy that's fine hopefully you know how to set it up to add different things but I'm going to go ahead and say add I'm going to give this a name so I want this to be into Phi test dot route me home.org okay make sure I spilled everything correctly looks good and then I'm going to put in the IP address of my server so my nginx proxy manager runs on a different machine than the server where I'm setting this up that's why I need to put in my IP address if nginx proxim editor was running on the same machine I could use localhost or I could use the name of the container if I put them both in the same Docker Network that's not the default network but in this case I need to use the IP address so here I'm going to put 8150 I'm going to tell it's a block common exploits and give me websocket support and I'm just going to say save first thing I want to do is make sure that this actually opens up so I'm going to go right here to entify test I'm just going to click on it should open up and give me that same window and it does but now it's running at this URL which is great so I'm going to come back in here and I'm just going to go over here to the right for that entry I'm going to click on the little three dots click on edit I'm going to go to the SSL tab I'm going to say request a new certificate Force SSL HTTP 2 support and I agree make sure your email's in here and I'm just going to hit save that's going to go out and say hey let's encrypt I'd like to get a valid SSL certificate for this site can you challenge it real quick make sure you can hit it and then give me a certificate and if it does this little pop-up just goes away but you'll now see that it says let's encrypt right here let's encrypt so we're just going to click on this again now you notice it doesn't have the https part anymore it just says hey do you want to get notifications say Grant click on allow for your browser and now you'll get the browser notifications whenever something comes in on a topic that you're subscribed to pretty straightforward so this is set we're done with this part that's it's it's that simple that took about five minutes for us to set up now there's a couple of things you need to do if you want to get push notifications on your phone so first is knowing that on your phone you need to set this URL so there's a little settings page when you download the intify.sh app go into your settings page and put in your https URL for this site and then there's also a configuration file we need to grab so I'm going to go back over here I'm just going to hit Ctrl C to stop watching the logs here everything looks good I'm going to do an LS and you'll notice now we have a couple of folders here so it created those folders that we told it we wanted there so I'm going to go CD Etc ntfy I'm doing LS you'll notice there's nothing here but there should be a server.yml file so we're going to say sudo Nano server.yml we're going to create a special file called server.yml and it just needs a few things in it so it needs a base Dash URL and we're going to type that in all lowercase and then colon and then in quotations we're just going to put in our URL so this is https colon slash slash and this was ntfy t-e-s-t and Route me home.org just double check my spelling and then we need one called the up stream space or hyphen base hyphen URL and that one is going to be https colon slash ntfy.sh and then end quote so it should just look like that and then there's some caching stuff you can put there's a lot of different parameters you can put in this file and he's got a really excellent sample file on his GitHub page so again I'll link you guys to the GitHub page so you go look at that but these are the things that we need in order for it to get us uh what we want for our for our push notifications for iOS so I'm going to hit Ctrl o to save hit enter to confirm and then Ctrl X to exit so now we need to bring down our our intify server so we're going to do CD dot dot slash dot dot just to go back to this level where it's Docker Enterprise server I'll clear that out so you can see what I'm typing I'm going to do Docker compose down that's just going to take our server down real quick and then I'm going to do Docker compose up Dash D to ampersands Docker compose logs Dash f and if you notice it should come right back up saying listening on that Port which is great we've got everything there so now I'm going to go into my device I'm going to record this on my device again it's recording and I'm going to go in and I'm going to go back to the main page here I'm going to go over to this little settings tab at the bottom and you'll notice up here it's got the default server so I'm going to change that default server you can add a separate server but I'm just going to change the default for now so I'm going to type it in HTTPS colon slash and this is going to be NT f y t e s t make sure I spell it correctly test there we go Dot route me home .org I'm going to save that so now that should have the correct one and if I zoom it up for you guys uh let's see I'm zooming it up for myself I don't know if it'll zoom in up on the recording routemehome.org everything there looks good so I'm going to go back over here and I'm going to get rid of this yeah just unsubscribe for now and I'm going to subscribe to the new topic and we're just going to give this a new topic here so let's call this now if I wanted to use another server I could tap this button and fill in another server URL but I don't I want to use the default server so I'm just going to hit subscribe so now I'm subscribed to that message service it's still recording so I'm actually going to go publish something on it I'm going to call this yt-test and I'm going to put in my first message from my new server this is awesome I hope I can really find a lot of uses for this and you can put tags and things like that you can even put Emojis and stuff like that in it but for now we'll just send that I want to make sure that we get our message so my first message there it is we've got the message so for some reason it doesn't show it right away which is weird even though it came in on a push notification so we know we got it it may take a section for this for this to actually start pulling from the subscriptions but the push notification came in this will check in eventually and start getting our actual subscriptions and our messages that we're subscribed to we'll do another one just to prove that it's working so we'll do it again YT test and new test hey this is my second message and I'll send it and again you'll see the push notification come in there it is right there on the screen I'll tap it and it's still saying hey you don't have anything here that's kind of funny but if we kill the app and then go back into it maybe it'll reach out there so now it reached out and it started pulling the messages so there's a little bit of a funkiness with the app going on there but now if we send one it should also come into the app let's just see what happens we'll do one more uh YT test and hey here's one more and send so we got it there it is and we can even see the message right there so if we tap back we can see our we can see what we're subscribed to and here we can see our messages so this thing's working really well I'm very excited about how well this works and how fast it is to get set up now remember there are users and things like that that you can also set up in here so down here I can actually send a request from this machine to through my server kind of like I did before so if I do curl Dash D and I put in a message this is my message on my new server from the CLI whoops and then I do Dash capital L and the reason I have to do this is to tell it hey curl I need you to chase down the redirects because the https is being put forced as a redirect so I'm going to do a quote https colon slash intified test Dot routemehome.org colon 81 no no slash and then we're going to give it yt-test now my phone turned off which means it stopped recording let me start it recording again I'll even exit the app this time and we'll record and then we're going to send this message yes oh I don't need the quote on the URL so we're going to take that off there we go this should go and there it's going to give you some Json output to tell you hey here's what I tried to send and then on the phone screen you can see that the notification came in and I can go here and click and again for whatever reason I'm going to pull to refresh but usually these come in on their own so there you go it's bringing everything in just like you'd expect it to which is pretty awesome so this means that now I've got the ability to use this type of message in a script and actually get things back and he goes into more detail in his in his documentation so if you go out here and check out his doc sorry that was bright um if you go out here and check out the docs on sending so he's got subscribing he's got publishing so if you go to the sending messages you can see there's a lot of different ways to do things down here but I mean there's just tons of detail on what you can do so here he shows you you can do this from the command line um so you can do a fetch but here you can do a curl you can send headers you can send body you can send a message title with it so you can just I mean so many different things you can do but he's also got different ways that you can use this so you can use it with curl that's the that's the easy way through the bash side is to use Curl to do that the command line um he's got the ntfy CLI so you can use ntfy publish he's got https so if you want to do an https call JavaScript go Powershell Windows users he's got Powershell for you okay or Linux users who use Powershell he's got python and he's got PHP so I mean really tons of ways to do these different things and on every single one he's got a lot of really good information on what it does why it's there and then it gives you lots of different code on how to use this I mean just so much great information on this documentation page it's just really impressive to me that he's got so much here all right I have shown you the things that you need to have to get started with intify server I think it's just a tremendous project and it's an opportunity for you to get out there and really get some notifications about the different things that you're doing and know what's going on in your systems know what's going on in your life know what's going on with your automations know what's going on with all kinds of different things that are out there I hope you enjoyed this if you did like subscribe tell your friends about it so they come along on the open source Journey with us and I'll talk to you next time [Music] it's your open source Advocate and I'm back and I've set up a store with a little bit of merchandise I love being your open source Advocate but I want you guys to be the open source Advocates with me so if you want to get out there and get some of this stuff and if you do let me know what you think of it thank you for subscribing
Info
Channel: Awesome Open Source
Views: 106,363
Rating: undefined out of 5
Keywords: open, source, opensource, open-source, self, hosted, selfhosted, self-hosted, free, libre, software, server, web, internet, browser, linux, mac, macos, os x, windows, microsoft, unix, bsd, ios, android, pi, raspberry, desktop, vps, tutorial, how to, setup, installation, instructions, cli, command line, terminal, interface, network, networking, news, projects, push, notifications, iOS, Android, mobile, ntfy, notify, ui, gui, actions, buttons, options, iphone, ipad, samsung, motorola, lg
Id: WJgwWXt79pE
Channel Id: undefined
Length: 31min 31sec (1891 seconds)
Published: Sat Aug 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.