From 50e57750625a81266cd7a0fd41a4e24e7a5cfc8f Mon Sep 17 00:00:00 2001 From: MacRimi Date: Sat, 21 Feb 2026 20:55:18 +0100 Subject: [PATCH] Update flask_notification_routes.py --- AppImage/scripts/flask_notification_routes.py | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/AppImage/scripts/flask_notification_routes.py b/AppImage/scripts/flask_notification_routes.py index efa4ae53..8fa54695 100644 --- a/AppImage/scripts/flask_notification_routes.py +++ b/AppImage/scripts/flask_notification_routes.py @@ -231,25 +231,25 @@ def _pve_remove_our_blocks(text, headers_to_remove): def _build_webhook_fallback(): """Build fallback manual commands for webhook setup.""" - body_tpl = '{"title":"{{ escape title }}","message":"{{ escape message }}","severity":"{{ severity }}","timestamp":"{{ timestamp }}","type":"{{#if fields.type}}{{ fields.type }}{{else}}test{{/if}}","hostname":"{{#if fields.hostname}}{{ fields.hostname }}{{else}}unknown{{/if}}"}' - return [ - "# 1. Append to END of /etc/pve/notifications.cfg", - "# (do NOT delete existing content):", - "", - f"webhook: {_PVE_ENDPOINT_ID}", - f"\tmethod post", - f"\turl {_PVE_WEBHOOK_URL}", - "", - f"matcher: {_PVE_MATCHER_ID}", - f"\ttarget {_PVE_ENDPOINT_ID}", - "\tmode all", - "", - "# 2. Append to /etc/pve/priv/notifications.cfg :", - f"webhook: {_PVE_ENDPOINT_ID}", - "", - "# 3. Set body via pvesh (NOT in the config file -- PVE stores it base64):", - f"pvesh set /cluster/notifications/endpoints/webhook/{_PVE_ENDPOINT_ID} --body '{body_tpl}'", - ] + body_tpl = '{"title":"{{ escape title }}","message":"{{ escape message }}","severity":"{{ severity }}","timestamp":"{{ timestamp }}","type":"{{#if fields.type}}{{ fields.type }}{{else}}test{{/if}}","hostname":"{{#if fields.hostname}}{{ fields.hostname }}{{else}}unknown{{/if}}"}' + return [ + "# 1. Append to END of /etc/pve/notifications.cfg", + "# (do NOT delete existing content):", + "", + f"webhook: {_PVE_ENDPOINT_ID}", + f"\tmethod post", + f"\turl {_PVE_WEBHOOK_URL}", + "", + f"matcher: {_PVE_MATCHER_ID}", + f"\ttarget {_PVE_ENDPOINT_ID}", + "\tmode all", + "", + "# 2. Append to /etc/pve/priv/notifications.cfg :", + f"webhook: {_PVE_ENDPOINT_ID}", + "", + "# 3. Set body via pvesh (NOT in the config file -- PVE stores it base64):", + f"pvesh set /cluster/notifications/endpoints/webhook/{_PVE_ENDPOINT_ID} --body '{body_tpl}'", + ] def setup_pve_webhook_core() -> dict: