Push Notification Server with ntfy

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay we're continuing to look at notify ntfy.sh is the website uh and today we're gonna set the server which is just it might be easier than actually using the application which was super easy to do and I'm going to go over the basics of just setting up a server we're not going to go over uh you know security certificates and stuff like that using let's encrypt I'll show you they have instructions for that just adding some stuff to the config file uh but let's go ahead and look at their website here ntfy and I got this set up and I tested in the Shell I didn't test out the web application or the phone application so we're going to do that together um let's go ahead and ntfy docs and off to the side here uh they have a bunch of stuff here we want installation okay so it's under self-hosting so again you don't have to do this you can use their servers but if you're gonna do this why not use your own server um so and I'm just gonna do something on my local network uh and something else I'm not gonna go over is port forwarding if you're behind a firewall that's that's a whole other topic uh but if you have a server somewhere up online super simple here so look look we clicked on this they have General steps Linux binaries uh Debbie and Ubuntu repositories Fedora Arch blah blah blah Mac OS Windows Docker I don't know I would use all these now I am just going to use the binaries right so it's straight binary it's actually a single binary and two config files one for the client one for the server I'm really really interested in the server one today um I could add the Debian repositories that they have set up because it's not in the default repositories I hate adding reposit a bunch of extra repositories I don't need so I'm gonna go with just the binary today the benefit of adding their repository is when there's updates you'll automatically get updates if we're doing the the binary we're gonna have to check updates for ourselves regularly so keep that in mind now look they already have it compiled for uh you know your x86 64-bit processor so your desktop but they also have you know your most common versions of arm processors here so you can run on your phone if you wanted as a server but let's go ahead and again I'm just going to use this right here and this is the most up-to-date if you go to their GitHub page and click on releases and they'll list all the files they have the binaries Debbie and that's that that's where this is coming from and as of recording it 1.2 nine point or yeah you know 1.291 is the uh the current release so let's go ahead I'll just copy that first line uh I'm in an empty directory here I have it split into three screens because we're going to get the server running and then we're going to monitor it and then we're going to send a message let's go ahead and just download that okay so it's downloaded next thing we're going to do is we're going to untar it so we're just going to run this account I'll just go to copy and paste it's untarred so it untargeted to the local directory there there's a subdirectory now there's the file we downloaded subdirectories and uh right here is the binary file so what we need to do next is copy that to our system directory uh one of our path directories now their uh they copy it to USR bin I personally think it probably belongs in USR local bin um but I'm just going to follow their directions for now uh basically uh us USR bin should only be for binaries that are installed by your operating system if you're installing something manual like this it should go in uh USR local bin it doesn't really matter uh but if you're backing up stuff sometimes I backing up your local bin is easier because it's only stuff you know that's not installed by default processors I think maybe they do this since you can install set up their repositories and they're just trying to be consistent so anyway what we're going to do is we're going to use sudo because we're going to write to a directory that we're uh don't normal users shouldn't have access to so we're going to copy over that binary so now it's there and it's executable but we also want to set up the config files so again uh in what we unzipped we have a client config file and a server config file so we just make a directory under Etc like so which I didn't delete after uh make it so let me delete that real quick sudo remove because I did test this already I deleted the binary but I didn't delete that directory okay so we deleted because I did make one change to the config file let's try that again okay so I got to make the directory because I just deleted it sorry I lost track of where I was at we're just going to copy over there are two yaml files to this directory so now if I list out what's inside this directory that we just created we have two yaml files the client which again you can use Curl or their client they have full documentation on their website but they also have this yaml file now next they're saying to run it and to notify server they're running a sudo I'm assuming because by default it's going to try to use port 80 okay which regular users don't have access to uh if I try to run that now I am going to get an error because I already have a web server running on my machine I have Apache running on Port 80. so we want to change what port we're going to use and that's simple enough we're just going to say sudo Vim or whatever text error you like Etc notify and we're going to go into the server config file let's make this full here and it has a bunch of example stuff in here we're just going to go down to the bottom if we go back to their web page and we get past this installation so we're done with the installation and again if you don't have something running on Port 80 already it's gonna be running like that although I don't like the idea of running it as root they're pseudo there's no need for that let's go to configuration they're going to give you some examples here and look you can set up https they give you some examples here I don't have uh you know um a URL set up and encryption on this machine I am going to set this up on a machine that does have a a domain name and encryption Keys it shows you what port we're going to listen on I don't know why it doesn't show you that here we're going to listen on Port 80 okay if you're using encryption Keys the ports you use are important so I'm just going to add to this file this but I'm going to change this to a port that I'm not using I'm just going to use 7777 because I know that's not being used I'm going to save that now I can run this notify uh serve command I don't need to run in a sudo because I don't need special privileges to run on Port 7777 do that it is running great I can come down here and now we can run just like we did before let's go back to their main page here and we will go down to their examples and again I can send something to a topic so I can say Okay backup successful but we're going to use our local machine so I'm just going to say localhost right and I'm going to give it a topic I'll just again say fbk we're using Port 7777 just like any other thing web browsers what support is just the domain name or IP address colon the port and then forward slash the topic okay we sent it let's go ahead and listen to that so let's go ahead curl dash s if I remember correctly I'm doing this from memory uh and we're going to say do I need I just say Local Host colon 7777 forward slash fbk Json boom it's listening come back up here and send a message and there he goes it shows up down there let's go back to our web browser though and I'm going to go localhost colon 7777 and it's running as a web server it says single binary is running as a web server here just like their web server but this is running locally here and I can subscribe to a topic or I can do just like before I can do forward slash fpk and you can see here that it has those messages if you look through the documentation they do store the messages by default and you can change all this uh for a certain number of hours and you can set up attachments as well uh we're not going to get into that but that's all in the documentation uh so the web browser is working uh locally let's go ahead and look at my mobile device so we're going to go into here and we're going to open up here I already have some using their server I'm going to click here I'm going to do fbk and I'm going to say use another server I'm going to use my local server so HTTP colon forward slash forward slash and I'm going to give it my IP address 192.16 8.1.154 I think is my IP address uh colon 7777 subscribe I haven't done this yet let's see if this works no 55 subscribe there we go look at that oh you're not looking at it look at that so uh super simple let's do that again let's go back let's subscribe to another one we're going to say use another server there there we go subscribe it actually remembered and now let's go back here let's go uh here and we're going to send a message and we said tester there we go it came through on my mobile device yay how simple was that even with my little hiccups there here and there I thank you for watching films by chris.com that's Chris the K there's a link in the description as always please visit my website let's think about supporting liking share subscribing and I hope that you have a great day
Info
Channel: Kris Occhipinti
Views: 7,119
Rating: undefined out of 5
Keywords: Linux (Operating System), Push notification server, Android, web app, shell, ntfy
Id: bZzqrX05mNU
Channel Id: undefined
Length: 9min 15sec (555 seconds)
Published: Sat Feb 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.