diff --git a/default.config b/default.config index cecb493..3ecc4d8 100644 --- a/default.config +++ b/default.config @@ -68,6 +68,7 @@ ## https://ntfy.sh or your custom domain with https:// and no trailing / # NTFY_DOMAIN="https://ntfy.sh" # NTFY_TOPIC_NAME="YourUniqueTopicName" +# NTFY_AUTH="" # set to either format -> "user:password" OR ":tk_12345678". If using tokens, don't forget the ":" # # PUSHBULLET_URL="https://api.pushbullet.com/v2/pushes" # PUSHBULLET_TOKEN="token-value" diff --git a/notify_templates/notify_ntfy.sh b/notify_templates/notify_ntfy.sh index d413a2c..e19f455 100644 --- a/notify_templates/notify_ntfy.sh +++ b/notify_templates/notify_ntfy.sh @@ -1,5 +1,5 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. -NOTIFY_NTFYSH_VERSION="v0.5" +NOTIFY_NTFYSH_VERSION="v0.6" # # Setup app and subscription at https://ntfy.sh # Leave (or place) this file in the "notify_templates" subdirectory within the same directory as the main dockcheck.sh script. @@ -24,11 +24,18 @@ trigger_ntfy_notification() { ContentType="Markdown: no" #text/plain fi + if [[ -n "${NTFY_AUTH:-}" ]]; then + NtfyAuth="-u $NTFY_AUTH" + else + NtfyAuth="" + fi + curl -S -o /dev/null ${CurlArgs} \ -H "Title: $MessageTitle" \ -H "$ContentType" \ -d "$MessageBody" \ - "$NtfyUrl" + $NtfyAuth \ + -L "$NtfyUrl" if [[ $? -gt 0 ]]; then NotifyError=true