Merge pull request #137 from mag37/notify_versioning

notify-template versioning
This commit is contained in:
mag37 2025-03-16 20:56:11 +01:00 committed by GitHub
commit 0a9d60f4df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 110 additions and 25 deletions

View file

@ -21,6 +21,7 @@
___ ___
## :bell: Changelog ## :bell: Changelog
- **v0.5.8.0**: Added version checks to all templates and a notification if a new template is released.
- **v0.5.7.0**: Rewritten templates - now with a function to notify when there's a new Dockcheck release. - **v0.5.7.0**: Rewritten templates - now with a function to notify when there's a new Dockcheck release.
- Manually migrate your current `notify.sh` settings to a new template for new functionality. - Manually migrate your current `notify.sh` settings to a new template for new functionality.
- **v0.5.6.1**: Async xargs hotfix - due to errors `failed to request manifest head ... context canceled` - **v0.5.6.1**: Async xargs hotfix - due to errors `failed to request manifest head ... context canceled`
@ -29,9 +30,6 @@ ___
- To disable xargs `-P` flag (max processes) all together, set `MaxAsync` to 0. - To disable xargs `-P` flag (max processes) all together, set `MaxAsync` to 0.
- **v0.5.6.0**: Heavily improved performance due to async checking for updates. - **v0.5.6.0**: Heavily improved performance due to async checking for updates.
- **v0.5.5.0**: osx and bsd compatibility changes + rewrite of dependency installer - **v0.5.5.0**: osx and bsd compatibility changes + rewrite of dependency installer
- **v0.5.4.0**: Added support for a Prometheus+node_exporter metric collection through a file collector.
- **v0.5.3.0**: Local image check changed (use imageId instead of name) and Gotify-template fixed (whale icon removed).
- **v0.5.2.1**: Rewrite of dependency downloads, jq can be installed with package manager or static binary.
___ ___

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERSION="v0.5.7.0" VERSION="v0.5.8.0"
### ChangeNotes: Rewritten templates - now with a function to notify when theres a new Dockcheck release. ### ChangeNotes: Added version checks to all templates and a notification if a new template is released.
Github="https://github.com/mag37/dockcheck" Github="https://github.com/mag37/dockcheck"
RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh" RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh"
@ -457,4 +457,3 @@ else
fi fi
exit 0 exit 0

View file

@ -1,5 +1,6 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
# INFO: ssmtp is depcerated - consider to use msmtp instead. NOTIFY_DSM_VERSION="v0.1"
# INFO: ssmtp is deprecated - consider to use msmtp instead.
# #
# Copy/rename this file to notify.sh to enable the notification snipppet. # Copy/rename this file to notify.sh to enable the notification snipppet.
# mSMTP/sSMTP has to be installed and configured manually. # mSMTP/sSMTP has to be installed and configured manually.
@ -70,5 +71,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1\nLatest version: $2\n\nChangenotes: $3\n" printf -v MessageBody "Installed version: $1\nLatest version: $2\n\nChangenotes: $3\n"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_DSM.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_DSM_VERSION/s/NOTIFY_DSM_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_DSM_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_DSM.sh update avialable:\n $NOTIFY_DSM_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_APPRISE_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up. # Required receiving services must already be set up.
@ -43,5 +44,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_apprise.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_APPRISE_VERSION/s/NOTIFY_APPRISE_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_APPRISE_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_apprise.sh update avialable:\n $NOTIFY_APPRISE_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_DISCORD_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up. # Required receiving services must already be set up.
@ -31,5 +32,12 @@ dockcheck_notification() {
printf "\nSending Discord dockcheck notification\n" printf "\nSending Discord dockcheck notification\n"
MessageBody="$FromHost - New version of dockcheck available: \n Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" MessageBody="$FromHost - New version of dockcheck available: \n Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_discord.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_DISCORD_VERSION/s/NOTIFY_DISCORD_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_DISCORD_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_discord.sh update avialable:\n $NOTIFY_DISCORD_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_GENERIC_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# generic sample, the "Hello World" of notification addons # generic sample, the "Hello World" of notification addons
@ -32,5 +33,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_generic.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_GENERIC_VERSION/s/NOTIFY_GENERIC_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_GENERIC_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_generic.sh update avialable:\n $NOTIFY_GENERIC_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_GOTIFY_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up. # Required receiving services must already be set up.
@ -41,5 +42,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_gotify.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_GOTIFY_VERSION/s/NOTIFY_GOTIFY_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_GOTIFY_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_gotify.sh update avialable:\n $NOTIFY_GOTIFY_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_MATRIX_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up. # Required receiving services must already be set up.
@ -39,5 +40,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_matrix.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_MATRIX_VERSION/s/NOTIFY_MATRIX_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_MATRIX_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_matrix.sh update avialable:\n $NOTIFY_MATRIX_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_NTFYSH_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Setup app and subscription at https://ntfy.sh # Setup app and subscription at https://ntfy.sh
@ -38,5 +39,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_ntfy-sh.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_NTFYSH_VERSION/s/NOTIFY_NTFYSH_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_NTFYSH_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_ntfy-sh.sh update avialable:\n $NOTIFY_NTFYSH_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_PUSHBULLET_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up. # Required receiving services must already be set up.
@ -39,5 +40,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_pushbullet.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_PUSHBULLET_VERSION/s/NOTIFY_PUSHBULLET_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_PUSHBULLET_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_pushbullet.sh update avialable:\n $NOTIFY_PUSHBULLET_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_PUSHOVER_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up. # Required receiving services must already be set up.
@ -45,5 +46,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_pushover.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_PUSHOVER_VERSION/s/NOTIFY_PUSHOVER_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_PUSHOVER_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_pushover.sh update avialable:\n $NOTIFY_PUSHOVER_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_SMTP_VERSION="v0.1"
# INFO: ssmtp is depcerated - consider to use msmtp instead. # INFO: ssmtp is depcerated - consider to use msmtp instead.
# #
# Copy/rename this file to notify.sh to enable the notification snipppet. # Copy/rename this file to notify.sh to enable the notification snipppet.
@ -59,5 +60,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "Installed version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_smtp.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_SMTP_VERSION/s/NOTIFY_SMTP_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_SMTP_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_smtp.sh update avialable:\n $NOTIFY_SMTP_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }

View file

@ -1,4 +1,5 @@
### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing.
NOTIFY_TELEGRAM_VERSION="v0.1"
# #
# Copy/rename this file to notify.sh to enable the notification snippet. # Copy/rename this file to notify.sh to enable the notification snippet.
# Required receiving services must already be set up. # Required receiving services must already be set up.
@ -39,5 +40,12 @@ dockcheck_notification() {
# Setting the MessageBody variable here. # Setting the MessageBody variable here.
printf -v MessageBody "$FromHost - New version of dockcheck available.\n\nInstalled version: $1 \nLatest version: $2 \n\nChangenotes: $3" printf -v MessageBody "$FromHost - New version of dockcheck available.\n\nInstalled version: $1 \nLatest version: $2 \n\nChangenotes: $3"
RawNotifyUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/notify_templates/notify_telegram.sh"
LatestNotifyRelease="$(curl -s -r 0-150 $RawNotifyUrl | sed -n "/NOTIFY_TELEGRAM_VERSION/s/NOTIFY_TELEGRAM_VERSION=//p" | tr -d '"')"
if [[ "$NOTIFY_TELEGRAM_VERSION" != "$LatestNotifyRelease" ]] ; then
printf -v NotifyUpdate "\n\nnotify_telegram.sh update avialable:\n $NOTIFY_TELEGRAM_VERSION -> $LatestNotifyRelease\n"
MessageBody="${MessageBody}${NotifyUpdate}"
fi
trigger_notification trigger_notification
} }