NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

Fixed POST to webhook

b6b399a5
Felix Kleinekathöfer <[email protected]> 3 years, 7 months ago
data/Dockerfiles/watchdog/watchdog.sh | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Diff

diff --git a/data/Dockerfiles/watchdog/watchdog.sh b/data/Dockerfiles/watchdog/watchdog.sh
index ada402ba..2b8ff78f 100755
--- a/data/Dockerfiles/watchdog/watchdog.sh
+++ b/data/Dockerfiles/watchdog/watchdog.sh
@@ -167,14 +167,13 @@ function notify_error() {
       return 1
     fi
 
-    WEBHOOK_BODY=$(echo ${WATCHDOG_NOTIFY_WEBHOOK_BODY} | sed "s/\$SUBJECT\|\${SUBJECT}/$SUBJECT/g" | sed "s/\$BODY\|\${BODY}/$BODY/" | sed "s/\"/\\\\\"/g")
+    # Replace subject and body placeholders
+    WEBHOOK_BODY=$(echo ${WATCHDOG_NOTIFY_WEBHOOK_BODY} | sed "s/\$SUBJECT\|\${SUBJECT}/$SUBJECT/g" | sed "s/\$BODY\|\${BODY}/$BODY/")
+    
+    # POST to webhook
+    curl -X POST -H "Content-Type: application/json" -d "${WEBHOOK_BODY}" ${WATCHDOG_NOTIFY_WEBHOOK}
 
-    curl -X POST \
-      -H "Content-Type: application/json" \
-      -d ${WEBHOOK_BODY} \
-      ${WATCHDOG_NOTIFY_WEBHOOK}
-
-    log_msg "Posted notification to webhook"
+    log_msg "Sent notification using webhook"
   fi
 }