Update notification service

This commit is contained in:
MacRimi
2026-03-19 09:18:14 +01:00
parent 19a3a14417
commit 10f8735f55
2 changed files with 6 additions and 2 deletions

View File

@@ -76,6 +76,9 @@ class NotificationChannel(ABC):
def _http_request(self, url: str, data: bytes, headers: Dict[str, str], def _http_request(self, url: str, data: bytes, headers: Dict[str, str],
method: str = 'POST') -> Tuple[int, str]: method: str = 'POST') -> Tuple[int, str]:
"""Execute HTTP request with timeout. Returns (status_code, body).""" """Execute HTTP request with timeout. Returns (status_code, body)."""
# Ensure User-Agent is set to avoid Cloudflare 1010 errors
if 'User-Agent' not in headers:
headers['User-Agent'] = 'ProxMenux-Monitor/1.1'
req = urllib.request.Request(url, data=data, headers=headers, method=method) req = urllib.request.Request(url, data=data, headers=headers, method=method)
try: try:
with urllib.request.urlopen(req, timeout=self.REQUEST_TIMEOUT) as resp: with urllib.request.urlopen(req, timeout=self.REQUEST_TIMEOUT) as resp:

View File

@@ -1495,6 +1495,7 @@ EMOJI USAGE — place ONE emoji at the START of EVERY non-empty line (title and
• pve-manager (9.1.4 -> 9.1.6) • pve-manager (9.1.4 -> 9.1.6)
• qemu-server (9.1.3 -> 9.1.4) • qemu-server (9.1.3 -> 9.1.4)
• pve-container (6.0.18 -> 6.1.2) • pve-container (6.0.18 -> 6.1.2)
EXAMPLE — pve_update (new Proxmox VE version): EXAMPLE — pve_update (new Proxmox VE version):
[TITLE] [TITLE]
🆕 pve01: Proxmox VE 9.1.6 available 🆕 pve01: Proxmox VE 9.1.6 available
@@ -1525,7 +1526,7 @@ EMOJI USAGE — place ONE emoji at the START of EVERY non-empty line (title and
⏱️ Duration: 00:01:10 ⏱️ Duration: 00:01:10
🗄️ Storage: ct/101/2026-03-17T22:04:29Z 🗄️ Storage: ct/101/2026-03-17T22:04:29Z
📊 Total: 2 backups | 16.4 GiB | ⏱️ 00:05:31 📊 Total: 2 backups | 📦 16.4 GiB | ⏱️ 00:05:31
EXAMPLE — backup partially failed (some ok, some failed): EXAMPLE — backup partially failed (some ok, some failed):
[TITLE] [TITLE]
@@ -1544,7 +1545,7 @@ EMOJI USAGE — place ONE emoji at the START of EVERY non-empty line (title and
💽 Size: 0 B 💽 Size: 0 B
⏱️ Duration: 00:00:37 ⏱️ Duration: 00:00:37
📊 Total: 2 backups | ❌ 1 failed | 12.3 GiB | ⏱️ 00:04:58 📊 Total: 2 backups | ❌ 1 failed | 📦 12.3 GiB | ⏱️ 00:04:58
EXAMPLE — disk I/O health warning: EXAMPLE — disk I/O health warning:
[TITLE] [TITLE]