mirror of
https://github.com/BreizhHardware/ntfy_alerts.git
synced 2026-01-19 00:47:33 +01:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5b113d725b | |||
| 9b2cf22892 | |||
|
|
34b314d40f | ||
|
|
7a1808569e | ||
|
|
063c2db3a9 | ||
|
|
f68bc12902 | ||
| c728183bf4 |
@@ -1,6 +1,7 @@
|
||||
# ntfy_alerts
|
||||
Personal ntfy alerts system
|
||||
|
||||
feel free to contribute and to fork
|
||||
|
||||
# Python ntfy.py
|
||||
## Description:
|
||||
@@ -30,9 +31,13 @@ services:
|
||||
- GHNTFY_TIMEOUT=timeout # Default is 3600 (1 hour)
|
||||
- GHREPO=["username/repo1", "username/repo2"] # Default is empty
|
||||
- GHNTFY_TOKEN= # Default is empty (Github token)
|
||||
volumes:
|
||||
- /path/to/github-ntfy:/github-ntfy/
|
||||
restart: unless-stopped
|
||||
````
|
||||
GHNTFY_TOKEN, need to have repo, read:org and read:user
|
||||
|
||||
Docker Hub repo: https://hub.docker.com/r/breizhhardware/github-ntfy
|
||||
## TODO:
|
||||
- [x] Dockerize the ntfy.py
|
||||
- [x] Add the watched repos list as a parameter
|
||||
|
||||
4
ntfy.py
4
ntfy.py
@@ -22,7 +22,7 @@ if not watched_repos_list:
|
||||
exit(1)
|
||||
|
||||
# Connexion à la base de données pour stocker les versions précédentes
|
||||
db_path = 'ghntfy_versions.db'
|
||||
db_path = '/github-ntfy/ghntfy_versions.db'
|
||||
conn = sqlite3.connect(db_path)
|
||||
cursor = conn.cursor()
|
||||
|
||||
@@ -90,7 +90,7 @@ def send_to_ntfy(releases, auth, url):
|
||||
"Authorization": f"Basic {auth}",
|
||||
"Title": f"New version for {app_name}",
|
||||
"Priority": "urgent",
|
||||
"Content-Type": "text/plain",
|
||||
"Markdown": "yes",
|
||||
"Actions": f"view, Update {app_name}, {app_url}, clear=true"}
|
||||
response = requests.post(f"{url}", headers=headers, data=message)
|
||||
if response.status_code == 200:
|
||||
|
||||
Reference in New Issue
Block a user