based on:
https://www.linux-magazine.com/Issues/2020/230/Gotify
https://www.linux-magazine.com/index.php/layout/set/print/Issues/2020/230/Gotify/(tagID)/75
https://letsfoss.com/setting-up-gotify-in-raspberry-pi/
https://www.linux-magazine.com/Issues/2020/230/Gotify
install the server:
cd /opt
wget https://github.com/gotify/server/releases/download/v2.3.0/gotify-linux-amd64.zip
unzip gotify-linux-amd64.zip -d gotify
cd gotify
chmod +x gotify-linux-amd64
wget -O config.yml https://raw.githubusercontent.com/gotify/server/master/config.example.yml
nano config.yml #to change the port: 80 and pass: admin
ufw allow 8085/tcp
ufw reload
#sudo ./gotify-linux-amd64
create a service script:
nano /lib/systemd/system/gotify.service
[Unit]
Gotify Service (LetsFOSS.com)
Description=Gotify Starter
After=network-online.target
Requires=network-online.target
[Service]
WorkingDirectory=/opt/gotify/
ExecStart=/opt/gotify/gotify-linux-amd64
Restart=always
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start gotify
systemctl status gotify
install on android:
https://f-droid.org/en/packages/com.github.gotify/
install on firefox:
https://addons.mozilla.org/en-US/firefox/addon/gotify
usage with curl:
curl -X POST "https://IPADDRESS:PORT/message?token=TOKEN" -F "title=This is a title" -F"message=Message goes here"
curl -X POST "http://5.189.170.200:80/message?token=AWNR5t5S6yIvJff" -F "title=This is a title" -F"message=Message goes here"
command line client version:
wget https://github.com/gotify/cli/releases/download/v2.2.3/gotify-cli-linux-amd64
sudo mv gotify-cli-linux-amd64 /usr/bin/gotify
chmod +x /usr/bin/gotify
gotify init
Gotify URL: http://5.189.170.200:80
1
AWNR5t5S6yIvJff
0
2
gotify push "Message goes here"
curl wttr.in/Tokyo?format="%l:+%c+%t+%w+%m" | gotify push