自建unifiedpush的ntfy服务端
# docker 安装
# 服务端配置文件 /etc/ntfy/server.yml
# 配置说明 https://docs.ntfy.sh/config/
touch /home/jcleng/ntfy/server.yml
# 添加配置
base-url: "https://ntfy.leng2011.icu"
listen-http: ":80"
# 运行
docker run \
-v /home/jcleng/ntfy:/etc/ntfy \
-e TZ=UTC \
-p 7600:80 \
--name=ntfy \
-itd \
binwiederhier/ntfy \
serve
# 然后在caddy入口配置https
# ntfy
ntfy.leng2011.icu:80 {
redir https://ntfy.leng2011.icu
}
ntfy.leng2011.icu:443 {
reverse_proxy * {
to http://127.0.0.1:7600
}
tls /home/jcleng/ntfy_cert/ntfy.leng2011.icu_nginx/ntfy.leng2011.icu_bundle.crt /home/jcleng/ntfy_cert/ntfy.leng2011.icu_nginx/ntfy.leng2011.icu.key
}
测试
# https://docs.ntfy.sh/
# 手机下载ntfy app,配置当前设置的https地址,创建一个订阅即可: ntfy.leng2011.icu/first_test
# curl发送订阅
curl -d "first_test successful 😀" https://ntfy.leng2011.icu/first_test
使用
# 把ntfy app的没人地址设置为https://ntfy.leng2011.icu,删除原来的通知,让其他软件创新注册即可