Skip to content

Notifies you when updates on selected programs are available 🤖

License

Notifications You must be signed in to change notification settings

trolologuy/update-notifier

Repository files navigation

update-notifier

License: MIT Code style: black Maintainability

Notifies you when updates for the selected software is available.

asciicast

Features

Prerequisites

  • Having Python 3 installed
  • Having geckodriver installed in /usr/local/bin/geckodriver(or edit the path in the SELENIUM variable in the settings.ini file)

Installation

  1. Rename the settings.example.ini to settings.ini
  2. Edit the settings.ini and add your credentials (more explanation regarding the variables below).
  3. Edit the installed.json and add the value of the exact version of the software you are currently using.
  4. Run the following command to install the required modules locally pip3 install -U -r requirements.txt --user

You could run this project in docker with a cronjob, so that the update checks are run once a day or once a week for example.

Usage

python3 update-notifier.py -i installed.json

Configuration file (settings.ini)

[settings]

  • NOTIFIER by default telegram since currently nothing else is supported.
  • SELENIUM by default /usr/local/bin/geckodriver since that's where I decided to install it for docker and vagrant. If you install geckodriver manually you may have to adapt this path.
  • HEALTHCHECKby default a random non-valid url. This is an URL that is to be pinged when the script was succesfully run. If you want to monitor the cronjob(s), you can use healthchecks.

[telegram]

  • BOT_TOKEN Please update this Token accordingly (more details below).
  • CHAT_ID Please update this ID accordingly (more details below). If you need help getting the BOT_TOKEN and CHAT_ID variables, please follow the *steps 1 and 2 in this gist

Deployment

You can also deploy the project through docker or vagrant.

Docker

  1. Install Docker
  2. Run either docker-compose up or docker build -t update-notifier -f deploy/Dockerfile . and docker run --rm -d --name notify update-notifier if you want to use the Dockerfile directly. We are using the parameter --rm to auto-delete the container once it has sent the notification.

Important Note: Since the content of the repo is copied into the container, everytime you modify one of the files you will have to rebuild the image and start a container using that freshly built image.

Vagrant

  1. Install Vagrant
  2. Install virtualbox
  3. cd deploy/vagrant to access the right folder
  4. vagrant up to start the virtual machine and the script

To destroy your Vagrant image: vagrant destroy --force

If you encounter any issue with the setting up of the project, feel free to open an issue :)

Similar projects