Add repo list as enviroment variable

This commit is contained in:
2024-03-01 13:56:29 +01:00
parent e8c1923a81
commit 910ae52445
3 changed files with 16 additions and 12 deletions

View File

@@ -11,6 +11,7 @@ RUN pip install -r requirements.txt
ENV USERNAME="" \
PASSWORD="" \
NTFY_URL="" \
GHNTFY_TIMEOUT="3600"
GHNTFY_TIMEOUT="3600" \
GHREPO=""
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -21,17 +21,17 @@ services:
image: breizhhardware/github-ntfy
container_name: github-ntfy
environment:
- USERNAME=username
- PASSWORD=password
- NTFY_URL=ntfy_url
- USERNAME=username # Required
- PASSWORD=password # Required
- NTFY_URL=ntfy_url # Required
- GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour)
- GHNTFY_WATCHED_REPOS=["username/repo1", "username/repo2"] # Default is empty
restart: unless-stopped
````
Acctualy the watched repos list is hardcoded in the ntfy.py file under the name of watched_repos_list.
## TODO:
- [x] Dockerize the ntfy.py
- [ ] Add the watched repos list as a parameter
- [ ] Add the watched repos list as a file
- [ ] Add the watched repos list as a database
- [x] Add the watched repos list as a parameter
- [ ] Add the application version as a database
- [ ] Add the watched repos list as a web interface
# Bash setup-notify.sh
## Description:

11
ntfy.py
View File

@@ -2,15 +2,18 @@ import requests
import time
import os
import logging
import json
# Configurer le logger
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
watched_repos_list = ['dani-garcia/vaultwarden', 'jellyfin/jellyfin', 'linuxserver/Heimdall',
'jlesage/docker-nginx-proxy-manager', 'linuxserver/docker-speedtest-tracker',
'linuxserver/docker-xbackbone', 'Fallenbagel/jellyseerr', 'FlareSolverr/FlareSolverr',
'linuxserver/docker-jackett', 'linuxserver/docker-radarr', 'linuxserver/docker-sonarr']
repo_list_env = os.environ.get('GHREPO')
watched_repos_list = json.loads(repo_list_env) if repo_list_env else []
if not watched_repos_list:
logger.error("Aucun dépôt n'a été spécifié. Veuillez spécifier les dépôts à surveiller dans l'environnement GHREPO")
exit(1)
# Dictionnaire pour stocker les versions précédentes
previous_versions = {}