||2 months ago|
|LICENSE||4 months ago|
|README.md||3 months ago|
|gitea-updater||2 months ago|
This script checks if Gitea is up to date, updates it if necessary and sends a message to a Telegram bot.
The trap to avoid when installing custom software is to update it. It seems obvious but it is never very easy because there is often a compilation part, interoperability management between bricks, backups and so on.
It is clearly necessary to have deployed a Gitea instance on your server. I wrote an article about this topic here: https://illuad.fr/2020/08/01/install-a-gitea-server.html
Since a message is sent to a Telegram bot, it is necessary to have one configured. I wrote an article about this topic here: https://illuad.fr/2020/10/27/get-a-telegram-alert-on-a-ssh-login-with-pam.html
This script can run on any GNU/Linux machine.
This script uses
restorecon commands but if you have followed my article, some of them are required which means they will necessarily be installed.
Since this script must be executed with root rights, it is a good practice to place it in
sudo curl -Lo /usr/local/sbin/gitea-updater -sSf https://gitea.illuad.fr/adrien/gitea-updater/raw/branch/master/gitea-updater sudo chmod 750 /usr/local/sbin/gitea-updater
Create the logs' directory.
sudo mkdir -p /var/log/updater/gitea
This script requires the configuration of 2 variables to work:
chat_id correspond to the API key and the chat id obtained during the bot creation process.
Fast variables setting
sudo sed -i "s/key=/key=<your_key>/" /usr/local/sbin/gitea-updater
sudo sed -i "s/chat_id=/chat_id=<your_chat_id>/" /usr/local/sbin/gitea-updater
Running this script automatically is a good idea, here is what you should have in the cron jobs of the root user.
sudo crontab -l 0 1 * * * /usr/local/sbin/gitea-updater
Every day at 1:00 am, the script will check if the Gitea is up to date.