Félix MARQUET 66e22f6788 Merge pull request #2 from BreizhHardware/dev
Add Gotify support and arm64 and armv7 support
2024-10-24 15:32:08 +02:00
Fix
2024-10-21 15:00:13 +00:00
2024-10-24 13:10:10 +00:00
2024-10-21 16:44:11 +02:00
Fix
2024-10-21 15:00:13 +00:00
2024-02-29 23:14:28 +01:00
2024-10-24 13:10:10 +00:00
2024-10-24 13:26:18 +00:00
2024-10-21 16:15:01 +02:00

ntfy_alerts

Personal ntfy alerts system

Feel free to contribute and to fork !

Python ntfy.py

Description:

This script is used to watch the github repos and send a notification to the ntfy server when a new release is published.

It can aloso watch Docker Hub repos and do the same as github.

Utilisation:

auth and ntfy_url are required to be set as environment variables.

auth: can be generataed by the folowing command: echo -n 'username:password' | base64

ntfy_url: the url of the ntfy server including the topic

python ntfy.py

Docker:

If you want to use the docker image you can use the following docker-compose file for x86_64:

services:
  github-ntfy:
    image: breizhhardware/github-ntfy:latest
    container_name: github-ntfy
    environment:
      - USERNAME=username # Required
      - PASSWORD=password # Required
      - NTFY_URL=ntfy_url # Required if ntfy is used
      - GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour)
      - GHNTFY_TOKEN= # Default is empty (Github token)
      - DOCKER_USERNAME= # Default is empty (Docker Hub username)
      - DOCKER_PASSWORD= # Default is empty (Docker Hub password)
      - GOTIFY_URL=gotify_url # Required if gotify is used
      - GOTIFY_TOKEN= # Required if gotify is used
    volumes:
      - /path/to/github-ntfy:/github-ntfy/
    ports:
      - 80:80
    restart: unless-stopped

For arm64 this docker compose file is ok:

services:
  github-ntfy:
    image: breizhhardware/github-ntfy:arm64
    container_name: github-ntfy
    environment:
      - USERNAME=username # Required
      - PASSWORD=password # Required
      - NTFY_URL=ntfy_url # Required if ntfy is used
      - GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour)
      - GHNTFY_TOKEN= # Default is empty (Github token)
      - DOCKER_USERNAME= # Default is empty (Docker Hub username)
      - DOCKER_PASSWORD= # Default is empty (Docker Hub password)
      - GOTIFY_URL=gotify_url # Required if gotify is used
      - GOTIFY_TOKEN= # Required if gotify is used
    volumes:
      - /path/to/github-ntfy:/github-ntfy/
    ports:
      - 80:80
    restart: unless-stopped

For armV7 this docker compose is ok:

services:
  github-ntfy:
    image: breizhhardware/github-ntfy:armv7
    container_name: github-ntfy
    environment:
      - USERNAME=username # Required
      - PASSWORD=password # Required
      - NTFY_URL=ntfy_url # Required if ntfy is used
      - GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour)
      - GHNTFY_TOKEN= # Default is empty (Github token)
      - DOCKER_USERNAME= # Default is empty (Docker Hub username)
      - DOCKER_PASSWORD= # Default is empty (Docker Hub password)
      - GOTIFY_URL=gotify_url # Required if gotify is used
      - GOTIFY_TOKEN= # Required if gotify is used
    volumes:
      - /path/to/github-ntfy:/github-ntfy/
    ports:
      - 80:80
    restart: unless-stopped

GHNTFY_TOKEN, need to have repo, read:org and read:user

Docker Hub repo: https://hub.docker.com/r/breizhhardware/github-ntfy

TODO:

  • Dockerize the ntfy.py
  • Add the watched repos list as a parameter
  • Add the application version as a database
  • Add the watched repos list as a web interface
  • Add Docker Hub compatibility
  • Rework of the web interface
  • Compatibility with Gotify
  • Compatibility with Discord Webhook
  • Compatibility and distribution for arm64 and armv7

Bash setup-notify.sh

Description:

This script is used to setup the ntfy notification system on ssh login for a new server.

Utilisation:

bash setup-notify.sh <ntfy_url> <username> <password> <topic>

ntfy_url: the url of the ntfy server

username: the username of the user

password: the password of the user

topic: the topic of the notification

This script will create a send-notify.sh in the root of your disk and add the login-notify.sh to the /etc/profile.d/ folder.

Bash send-notify.sh

Description:

This script is used to send a notification to the ntfy server.

Utilisation:

bash send-notify.sh <ntfy_url> <basic_auth> <topic> <message>

ntfy_url: the url of the ntfy server

basic_auth: the basic auth of the user

topic: the topic of the notification

message: the message of the notification

Description
No description provided
Readme GPL-3.0 1.4 MiB
Languages
Rust 80.6%
JavaScript 9.6%
HTML 5.7%
Shell 3.1%
Dockerfile 1%