Home
Softono
gtfy-listener

gtfy-listener

Open source MIT Python
12
Stars
7
Forks
3
Issues
1
Watchers
2 years
Last Commit

About gtfy-listener

gtfy-listener is a lightweight Python utility that forwards push notifications from a Gotify server to an Ntfy.sh push server in real time. It connects to Gotify via websocket, captures incoming messages as they arrive, and relays them to a configured Ntfy endpoint without manual intervention. The tool is designed for users who want to migrate from Gotify to Ntfy, mirror notifications across both platforms, or consolidate alerting onto an Ntfy-based workflow. Configuration is handled through a simple .env file containing the Ntfy server URL, Gotify host, and Gotify client token. For local use, running pip install followed by python3 gtfy.py starts the listener. For persistent deployment, a Dockerfile is included, allowing the script to run as a container that auto-restarts on failure. The project uses minimal dependencies such as requests, python-dotenv, and websocket-client, keeping the setup straightforward. gtfy-listener suits self-hosters, homelab enthusiasts, and developers who rely on push-based alerts

Platforms

Web Self-hosted Docker

Languages

Python

Links

GTFY 🚀

docker-image

Gotify to Ntfy.sh forwarder

Forward Gotify Push Messages 🚀 to Ntfy.sh Push server by using websocket 🛸

using Gotify stream to Listen the Gotify Push Notifications via websocket Connection and Froward it to Ntfy Push server.

Setup

git clone https://github.com/sanwebinfo/gtfy-listener
cd gtfy-listener

## local test
## install packages
pip install -r requirements.txt
touch .env
  • Env File .env
NTFY = "<NTFY Push server URL>"
GOTIFY_HOST = "<Python Cricket score API>"
GOTIFY_TOKEN = "<GOTIFY CLIENT TOKEN>"

## test
python3 gtfy.py

Docker 🐬

Keep Running the Python Script in Docker

  • Update the .dockerfile before build - Replace example ENV with yours
FROM python:3.8.10
ENV PYTHONUNBUFFERED 1
RUN pip install --upgrade pip
RUN pip3 install requests python-dotenv websocket-client
ENV GOTIFY_HOST=push.example.com
ENV GOTIFY_TOKEN=XXXXXXXXXXXX
ENV NTFY_HOST=https://ntfy.sh/gotify
COPY gtfy.py /usr/bin
CMD ["python3", "/usr/bin/gtfy.py"]

## Build image
docker build . -t="gtfy-listener"

## List the image
docker image ls

## Create and Test Container
docker run -d --name gtfy gtfy-listener
docker container ps
docker stop (containerID)

## Run the container forever
docker run -d --restart=always --name gtfy gtfy-listener

## List Hidden container if error exists
docker ps -a

## other commands
docker logs (containerID)
docker stop (containerID)
docker rm (containerid)
docker docker rmi (imageid)
docker image prune
docker builder prune --all -f
docker system prune --all
docker rm $(docker ps -all -q)
docker rmi $(docker image ls -q)

Inspiration

Pushtify (Gotify to Pushover forwarder) - https://github.com/sebw/pushtify

LICENSE

MIT