58 lines
3.2 KiB
Markdown
58 lines
3.2 KiB
Markdown
**From:** [](https://github.com/binwiederhier/ntfy)https://github.com/binwiederhier/ntfy
|
||
|
||

|
||
|
||
# ntfy.sh | Send push notifications to your phone or desktop via PUT/POST
|
||
|
||
**ntfy** (pronounced "*notify*") is a simple HTTP-based <ins>pub-sub</ins> 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 **<ins>ntfy.sh</ins>**. There is also an <ins>open-source Android app</ins> available on <ins>Google Play</ins> or <ins>F-Droid</ins>, as well as an <ins>open source iOS app</ins> available on the <ins>App Store</ins>.
|
||
|
||
### **Why does this exist when there's already a FreeBSD sysutils/ntfy pkg/port?**
|
||
|
||
The FreeBSD ntfy in ports/packages is a completely different project with the same name. This repo is to build a full install of ntfy.sh with client, server, and web running as a ntfy user with startup scripts and configs for client and server.
|
||
|
||
I built ntfy server on FreeBSD manually and have been testing it. I decided if I was going to keep using it that I should formalize an install.
|
||
|
||
### **FreeBSD prerequisites:**
|
||
|
||
I ran out of heap space building on a 2Gb FreeBSD 14.2 VM. It builds great when it was bumped to 4Gb (and more cores).
|
||
|
||
Install build pre-reqs:
|
||
`sudo pkg install python311 py311-pip node20 npm-node20 go gmake`
|
||
|
||
### Build:
|
||
|
||
`sudo sh ./build_ntfy_server.sh`
|
||
|
||
### Install:
|
||
|
||
`sudo sh ./install_ntfy_server.sh`
|
||
|
||
### Configure:
|
||
|
||
Edit your server.yml in /usr/local/etc/ntfy/ to set your hostname, listening IP/port, and any other desired settings. iOS devices require external service for instant push notifcations. Set `upstream-base-url: "https://ntfy.sh"` in your config to allow push without setting up APNS/Firebase services. See [ntfy docs](https://docs.ntfy.sh/) for more configuration options and details.
|
||
|
||
The nfty server service runs as a unprivileged user and must use a port higher than 1024. Use a webserver or reverse proxy in front of ntfy to provide http/https access.
|
||
|
||
Copy index.html to your webserver docs directory (e.g. https://ntfy.mydomain.com/docs/) to redirect to the online https://docs.ntfy.sh when a user clicks on the documentation button. Alternatively, you can mirror the online docs to your docs directory if you don't want to rely on theirs.
|
||
|
||
Use `sysrc ntfy_enable="YES"` or add `ntfy_enable="YES"` to your /etc/rc.conf or /etc/rc.conf.d/ntfy manually to enable the service. Use `service ntfy start` to start the service.
|
||
|
||
### Uninstall:
|
||
|
||
This will completely remove the binary, configs/scripts, directories, and user. Save your configs/database before running this if you want to preserve them.
|
||
|
||
`sudo sh ./uninstall_ntfy_server.sh`
|
||
|
||
### TODO:
|
||
I will likely rewrite all of this and create a proper port before it's all said and done. These are the things on my list in the meantime.
|
||
|
||
- Create dependency checks in install script and make more robust
|
||
- Testing client and config.
|
||
|
||
|
||
### License
|
||
The project is dual licensed under the [Apache License 2.0](LICENSE) and the [GPLv2 License](LICENSE.GPLv2).
|
||
|