ntfy
ntfy lets you send push notifications to your phone or desktop via scripts from any computer, using simple HTTP PUT or POST requests.
References
Make directory
mkdir -p {{DOCKER_PATH_VAR}}/ntfy && cd {{DOCKER_PATH_VAR}}/ntfycompose.yml
nano compose.ymlservices: ntfy: image: binwiederhier/ntfy container_name: ntfy command: - serve environment: - TZ=UTC volumes: - ./cache:/var/cache/ntfy - ./config:/etc/ntfy - ./auth:/var/lib/ntfy ports: - 8383:80 healthcheck: test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"] interval: 60s timeout: 10s retries: 3 start_period: 40s restart: unless-stopped init: true./config/server.yml
nano ./config/server.yml# Base configurationbase-url: "http://localhost:8383"listen-http: ":80"
# Auth settingsauth-file: "/var/lib/ntfy/user.db"auth-default-access: "deny-all"
# Cache settingscache-file: "/var/cache/ntfy/cache.db"cache-duration: "12h"Start container
docker compose up -dCreate admin user
docker exec -it ntfy ntfy user add --role=admin {{USERNAME_VAR}}Create token
docker exec -it ntfy ntfy token add {{USERNAME_VAR}}Example usage
HTTP
curl -X POST "http://localhost:8383/test_topic" \ -H "Authorization: Bearer <tk_your_token>" \ -H "Title: Test Title" \ -H "Tags: rocket,star" \ -H "Priority: default" \ -d "Message using a token"CLI
Requires CLI to be installed through your package manager.
ntfy publish \ --host="http://localhost:8383" \ --token="<tk_your_token>" \ --title="Test Title" \ --tags="rocket,star" \ --priority="default" \ test_topic "Message using a token"Open web ui
http://localhost:8383/test_topic or http://{{SERVER_IP_VAR}}:8383/test_topic