mirror of
https://github.com/unraid/webgui.git
synced 2026-02-05 16:39:01 -06:00
Merge pull request #561 from dylanparker/add-gotify-notification-agent
Adding support for the self-hosted Gotify notification agent.
This commit is contained in:
BIN
plugins/dynamix/icons/gotify.png
Normal file
BIN
plugins/dynamix/icons/gotify.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 959 B |
@@ -26,6 +26,44 @@
|
||||
]]>
|
||||
</Script>
|
||||
</Agent>
|
||||
<Agent>
|
||||
<Name>Gotify</Name>
|
||||
<Variables>
|
||||
<Variable Help="The full server base URL including protocol and port. eg: https://example.com:8888/" Desc="Full Server Base URL" Default="">SERVER_URL</Variable>
|
||||
<Variable Help="The App Token to use." Desc="App Token" Default="">APP_TOKEN</Variable>
|
||||
<Variable Help="Specify the fields which are included in the title of the notification." Desc="Notification Title" Default="$SUBJECT">TITLE</Variable>
|
||||
<Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable>
|
||||
</Variables>
|
||||
<Script>
|
||||
<![CDATA[
|
||||
#!/bin/bash
|
||||
############
|
||||
{0}
|
||||
############
|
||||
MESSAGE=$(echo -e "$MESSAGE")
|
||||
case "$IMPORTANCE" in
|
||||
'normal' )
|
||||
PRIORITY="3"
|
||||
;;
|
||||
'warning' )
|
||||
PRIORITY="5"
|
||||
;;
|
||||
'alert' )
|
||||
PRIORITY="7"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Remove any trailing slash
|
||||
SERVER_URL=${SERVER_URL%/}
|
||||
|
||||
curl -s -k -X POST \
|
||||
-F "title=$TITLE" \
|
||||
-F "message=$MESSAGE" \
|
||||
-F "priority=$PRIORITY" \
|
||||
${SERVER_URL}/message?token=$APP_TOKEN 2>&1
|
||||
]]>
|
||||
</Script>
|
||||
</Agent>
|
||||
<Agent>
|
||||
<Name>Join</Name>
|
||||
<Variables>
|
||||
|
||||
Reference in New Issue
Block a user