mirror of
https://github.com/BreizhHardware/ntfy_alerts.git
synced 2026-01-19 00:47:33 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6da0b5dac0 | |||
| 6c714abedd | |||
|
|
ecf162f6ed |
@@ -32,6 +32,7 @@ services:
|
||||
- GHNTFY_TOKEN= # Default is empty (Github token)
|
||||
restart: unless-stopped
|
||||
````
|
||||
GHNTFY_TOKEN, need to have repo, read:org and read:user
|
||||
## TODO:
|
||||
- [x] Dockerize the ntfy.py
|
||||
- [x] Add the watched repos list as a parameter
|
||||
|
||||
7
ntfy.py
7
ntfy.py
@@ -86,7 +86,12 @@ def send_to_ntfy(releases, auth, url):
|
||||
(app_name, version_number, changelog))
|
||||
conn.commit()
|
||||
|
||||
headers = {"Authorization": f"Basic {auth}", "Content-Type": "text/plain"}
|
||||
headers = {
|
||||
"Authorization": f"Basic {auth}",
|
||||
"Title": f"New version for {app_name}",
|
||||
"Priority": "urgent",
|
||||
"Content-Type": "text/plain",
|
||||
"Actions": f"view, Update {app_name}, {app_url}, clear=true"}
|
||||
response = requests.post(f"{url}", headers=headers, data=message)
|
||||
if response.status_code == 200:
|
||||
logger.info(f"Message envoyé à Ntfy pour {app_name}")
|
||||
|
||||
Reference in New Issue
Block a user