Permit to download easily just and pixi binary without custom software
What for?
This project is a simple Python script to send a email when tracked Github projects (specified in conf) have a new release. The purpose is to use this script in a cron table.
Unbelievable, but I haven't found an existing equivalent!
Why using configuration?...
...instead use stared project of your Github account? Cause I've got about 80 "stared" projects and I don't wan't to be alerted for new releases of each of these project. But, perhaps I'll add such a feature later on...
And, Github API limits is at 60 requests by seconds, and I want to write this script really quickly in a first time.
How to use?
Really simple!
- Edit conf.ini file to set
[config]section- your SMTP server configuration (host and port)
- sender mail
- receiver mail (⚠️ not tested with more than 1 receiver)
- Add the projects you want to follow in the section
[project]- Be careful to follow a JSON valid syntax as in the provided file, i.e. coma after each
autor/projectexcept the last one.
- Be careful to follow a JSON valid syntax as in the provided file, i.e. coma after each
After first execution, the conf.ini file will be filled with last release tag found by the script, as you can see in the provided file.
Hope you like, and have fun to read your mail!
Problems I have to solve really quickly
I wrote this script really quickly, certainly faster than this README. So I already have two big proglems:
- The script sends mail even if no new projets or release has been detected
- The biggest, you have to edit script to specify absolute path...
- A lot of other little problems, like the code that's disgusting and so on.
For who's asking: yes, it's normal that I have put all code in one main function like a blind gunner.. Really quickly I said!
But overall, the script works and sends mail!
Hey boy, what is the pit.db file?
Oh, just for fun, and because I love this project, I use pit by michaeldv to follow my task etc.
It makes me think I should push my python version of this project on occasion when I will take the time to do...
How to build it?
This project use two very cool projets to handle env & build:
- just as an alternative to GNU Make
- pixi to manage python & dependancies environnment without question
You can install these two software by your way, or use the Makefile to do it: $ make.
This command will download & untar just and pixie into a hidden .bin folder and launch just target to do the rest.
Don't forget to set a valid SMTP host/port in
config.ini. Otherwise, notifier execution will fail. See below if you want to get a wrapper
Just's targets permit to:
- just run the script
- build a docker image
- create a release
- etc.
Use .bin/just --list to list all available target.
Use mailpit to wrap mails
If you don't want to really send and receive mail, e.g. to test... things! I recommand mailpit.
You can quickly get it with just: .bin/just get-mail-wrapper.
Then execute-it: ./mailpit.
By default, SMTP port is 1025, and HTTP port to access to interface is 8025.
