Compare commits

...

4 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
xmirakulix
fbc9a252f5 update SMTP template, added suport for sendmail (#219)
* update smtp template, add suport for sendmail

* add sendmail to DSM and bump version

* correct errormsg and version number
2025-08-02 08:04:43 +02:00
7 changed files with 32 additions and 23 deletions

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`

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"

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"
@@ -601,7 +601,7 @@ if [[ -n "${GotUpdates:-}" ]]; then
fi
done
if [[ "$AutoPrune" == false ]] && [[ "$AutoMode" == false ]]; then printf "\n"; read -rep "Would you like to prune dangling images? y/[n]: " AutoPrune; fi
if [[ "$AutoPrune" == true ]] || [[ "$AutoPrune" =~ [yY] ]]; then printf "\n Auto pruning.."; docker image prune -f; fi
if [[ "$AutoPrune" == true ]] || [[ "$AutoPrune" =~ [yY] ]]; then printf "\nAuto pruning.."; docker image prune -f; fi
printf "\n%bAll done!%b\n" "$c_green" "$c_reset"
else
printf "\nNo updates installed, exiting.\n"

View File

@@ -1,5 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_DSM_VERSION="v0.3"
NOTIFY_DSM_VERSION="v0.4"
# INFO: ssmtp is deprecated - consider to use msmtp instead.
#
# mSMTP/sSMTP has to be installed and configured manually.
@@ -10,13 +10,16 @@ NOTIFY_DSM_VERSION="v0.3"
MSMTP=$(which msmtp)
SSMTP=$(which ssmtp)
SENDMAIL=$(which sendmail)
if [ -n "$MSMTP" ] ; then
MailPkg=$MSMTP
elif [ -n "$SSMTP" ] ; then
MailPkg=$SSMTP
elif [ -n "$SENDMAIL" ] ; then
MailPkg=$SENDMAIL
else
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
echo "No msmtp, ssmtp or sendmail binary found in PATH: $PATH" ; exit 1
fi
trigger_DSM_notification() {

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

View File

@@ -1,5 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_SMTP_VERSION="v0.3"
NOTIFY_SMTP_VERSION="v0.4"
# INFO: ssmtp is depcerated - consider to use msmtp instead.
#
# mSMTP/sSMTP has to be installed and configured manually.
@@ -15,13 +15,16 @@ fi
MSMTP=$(which msmtp)
SSMTP=$(which ssmtp)
SENDMAIL=$(which sendmail)
if [ -n "$MSMTP" ] ; then
MailPkg=$MSMTP
elif [ -n "$SSMTP" ] ; then
MailPkg=$SSMTP
elif [ -n "$SENDMAIL" ] ; then
MailPkg=$SENDMAIL
else
echo "No msmtp or ssmtp binary found in PATH: $PATH" ; exit 1
echo "No msmtp, ssmtp or sendmail binary found in PATH: $PATH" ; exit 1
fi
trigger_smtp_notification() {

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