mirror of
https://github.com/BreizhHardware/ntfy_alerts.git
synced 2026-03-18 21:40:38 +01:00
Add repo list as enviroment variable
This commit is contained in:
@@ -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"]
|
||||
|
||||
14
README.md
14
README.md
@@ -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
11
ntfy.py
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user