Compare commits

...

3 Commits

Author SHA1 Message Date
mag37 37f33d7a06 Snooze bugfix, added auth support to ntfy.sh and sendmail support to SMTP 2025-08-11 21:36:51 +02:00
vorezal 732a5e69cd Reword disable notification comment for clarity and use update_snooze for dockcheck notifications. (#221)
Co-authored-by: Matthew Oleksowicz <matt@everyoneneeds.it>
2025-08-11 21:17:01 +02:00
op4lat 9156cc44e1 Ntfy.sh and authentication (#220)
* default.config: add NtfyAuth=

* notify_templates/notify_ntfy.sh: implement NtfyAuth

---------

Co-authored-by: Lat <lat@mail.com>
Co-authored-by: mag37 <robin.ivehult@gmail.com>
2025-08-11 21:16:38 +02:00
5 changed files with 22 additions and 19 deletions
+5 -1
View File
@@ -22,7 +22,11 @@
___
## :bell: Changelog
- **v0.6.9**: #
- **v0.7.0**:
- Bugfix: snooze dockcheck.sh-self-notification and some config clarification.
- Added authentication support to Ntfy.sh.
- Added suport for sendmail in the SMTP-template.
- **v0.6.9**:
- Bugfix: label logic didn't skip recreation (skipped pulling).
- Added comma separated search filtering so you can selectively search exactly which containers to check/update.
- eg: `dockcheck.sh -yp homer,dozzle`
+3 -2
View File
@@ -37,9 +37,9 @@
## Uncomment the line below and specify the number of seconds to delay notifications to enable snooze
# SNOOZE_SECONDS=86400
#
## Uncomment to not send notifications when dockcheck itself has updates.
## Uncomment and set to true to disable notifications when dockcheck itself has updates.
# DISABLE_DOCKCHECK_NOTIFICATION=false
## Uncomment to not send notifications when notify scripts themselves have updates.
## Uncomment and set to true to disable notifications when notify scripts themselves have updates.
# DISABLE_NOTIFY_NOTIFICATION=false
#
## Apprise configuration variables. Set APPRISE_PAYLOAD to make a CLI call or set APPRISE_URL to make an API request instead.
@@ -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"
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
VERSION="v0.6.9"
# ChangeNotes: bugfix label logic and added comma separated search filtering
VERSION="v0.7.0"
# ChangeNotes: Snooze bugfix, added auth support to ntfy.sh and sendmail support to SMTP
Github="https://github.com/mag37/dockcheck"
RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh"
+9 -2
View File
@@ -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
+2 -11
View File
@@ -1,4 +1,4 @@
NOTIFY_V2_VERSION="v0.4"
NOTIFY_V2_VERSION="v0.5"
#
# If migrating from an older notify template, remove your existing notify.sh file.
# Leave (or place) this file in the "notify_templates" subdirectory within the same directory as the main dockcheck.sh script.
@@ -177,16 +177,7 @@ dockcheck_notification() {
printf "Attempted to send notification to channel ${channel}, but the function was not found. Make sure notify_${channel}.sh is available in the ${ScriptWorkDir} directory or notify_templates subdirectory.\n"
done
if [[ -n "${snooze}" ]] && [[ -f "${SnoozeFile}" ]]; then
if [[ "${NotifyError}" == "false" ]]; then
if [[ -n "${found}" ]]; then
sed -e "s/dockcheck\.sh.*/dockcheck\.sh ${CurrentEpochTime}/" "${SnoozeFile}" > "${SnoozeFile}.new"
mv "${SnoozeFile}.new" "${SnoozeFile}"
else
printf "dockcheck.sh ${CurrentEpochTime}\n" >> "${SnoozeFile}"
fi
fi
fi
[[ -n "${snooze}" ]] && [[ "${NotifyError}" == "false" ]] && update_snooze "dockcheck.sh"
fi
fi