ntfyの使い方
概要
- selfhostedなpub/sub
- gotifyなどの別のサービスもある
インストール
- 公式doc
- 大まかなインストール種別
- docker
- deb packages
httpsで利用する際
- caddy等でhttpをhttpsからフォワードすればよい
設定例
/etc/ntfy/server.yml
listen-http: ":60080"
~/.config/ntfy/client.yml
default-host: https://akabane.duckdns.org
publishの例
curl
$ curl -d "Backup successful" https://akabane.duckdns.org/unchi
{"id":"6tvo8vMXqqvM","time":1667442360,"event":"message","topic":"unchi","message":"Backup successful"}
ntfy
$ ntfy publish unchi "うんち"
{"id":"0HrDXeyi352l","time":1667442389,"event":"message","topic":"unchi","message":"うんち"}
subscribeの例
$ ntfy sub unchi
{"id":"kci991PqAvXa","time":1667441250,"event":"message","topic":"unchi","message":"This is a message"}
{"id":"J1JKu1BwehXb","time":1667441282,"event":"message","topic":"unchi","message":"うんち"}