From 94fd34478b6c62e796baecc6ddb1f840518ac114 Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 20:42:25 +0100 Subject: [PATCH 01/15] Added ssmtp notify template. --- notify_ssmtp.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 notify_ssmtp.sh diff --git a/notify_ssmtp.sh b/notify_ssmtp.sh new file mode 100644 index 0000000..6841a27 --- /dev/null +++ b/notify_ssmtp.sh @@ -0,0 +1,29 @@ +### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +# +# Copy/rename this file to notify.sh to enable the notification snipppet. +# Required receiving services must already be set up. +# Modify to fit your setup - changing SendMailFrom, SendMailTo + +send_notification() { +Updates=("$@") +UpdToString=$( printf "%s\n" "${Updates[@]}" ) +SendMailFrom=me@mydomain.tld +SendMailTo=me@mydomain.tld +FromHost=$(hostname) + +printf "\nSending email notification\n" + +ssmtp $SendMailTo << __EOF +From: "$FromHost" <$SendMailFrom> +date:$(date -R) +To: <$SendMailTo> +Subject: [dockcheck] Updates available on $FromHost +Content-Type: text/plain; charset=UTF-8; format=flowed +Content-Transfer-Encoding: 7bit + +The following containers on $FromHost have updates available: + +$UpdToString + +__EOF +} From 5485a3b2cf4cba114fd1ed4b43a1e165afcff8ba Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 20:42:53 +0100 Subject: [PATCH 02/15] Added apprise notify template. --- notify_apprise.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 notify_apprise.sh diff --git a/notify_apprise.sh b/notify_apprise.sh new file mode 100644 index 0000000..ac6c980 --- /dev/null +++ b/notify_apprise.sh @@ -0,0 +1,34 @@ +### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. +# +# Copy/rename this file to notify.sh to enable the notification snippet. +# Required receiving services must already be set up. +# Modify to fit your setup - set AppriseURL to your Apprise ip/domain. + +send_notification() { +Updates=("$@") +UpdToString=$( printf "%s\n" "${Updates[@]}" ) +FromHost=$(hostname) +AppriseURL="http://apprise.mydomain.tld:1234/notify/apprise" + +printf "\nSending Apprise notification\n" + +MessageTitle="$FromHost - updates available." +# Setting the MessageBody variable here. +read -d '\n' MessageBody << EOF +Containers on $FromHost with updates available: + +$UpdToString + +EOF + +curl -X POST -F "title=$MessageTitle" -F "body=$MessageBody" -F "tags=all" $AppriseURL +} + + +# If you run apprise bare metal on the same machine as dockcheck +# you can just comment out the AppriseURL and swap the curl line +# with something ike this: +# +# apprise -vv -t "$MessageTitle" -b "$MessageBody" \ +# 'mailto://myemail:mypass@gmail.com' \ +# 'pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b' From fe31aed33c188e62892121e367ee566bd31a05be Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 20:55:08 +0100 Subject: [PATCH 03/15] Edited generic template --- notify_generic.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notify_generic.sh b/notify_generic.sh index 7c52c33..04b508c 100644 --- a/notify_generic.sh +++ b/notify_generic.sh @@ -1,5 +1,6 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. -# Copy/rename this file to notify.sh to enable email/text notifications +# +# Copy/rename this file to notify.sh to enable the notification snippet. # generic sample, the "Hello World" of notification addons send_notification() { From 58bb55c79ad0091dc27a704f85846811679738ac Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 21:17:30 +0100 Subject: [PATCH 04/15] added .gitignore to safeguard users custom notify.sh --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6c60473 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# ignore users custom notify.sh +/notify.sh From ae5cd4d86e7d0cf65c534bb8debe0685b3c24b37 Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 21:45:13 +0100 Subject: [PATCH 05/15] Updated README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0955f59..a4950e1 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ ### :bell: Recent changes +- **v0.3.3**: Notification tweaks, added Apprise template. - **v0.3.2**: Added a notify function to wrap a notify-script, currently DSM/Ssmtp + template script. - **v0.3.1**: Addded option `-m` , monochrome mode - no printf color codes. - **v0.3.0**: Added option `-d N`, age (days) new images have to be before being pulled and updated. @@ -77,6 +78,13 @@ After the updates are complete, you'll get prompted if you'd like to prune dangl ### Notifications: +Use a `notify_X.sh` template file, copy it to `notify.sh` in the same location as the script, modify it to your needs! +Current templates: +- Synology [DSM](https://www.synology.com/en-global/dsm) +- Email with [sSMTP](https://wiki.debian.org/sSMTP) +- Apprise - both [native](https://github.com/caronc/apprise) and [API](https://github.com/caronc/apprise-api) (with it's [multitude](https://github.com/caronc/apprise#supported-notifications) of notifications) + + A simple email notification function is added, with a generic example and DSM/Ssmtp script by [yoyoma2](https://github.com/yoyoma2). Further addons are welcome, suggestions or PR! ### :warning: `-r flag` disclaimer and warning From 45dbe65c287fddc135c2b4441831974ab9988c02 Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 21:47:14 +0100 Subject: [PATCH 06/15] typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4950e1..20ba51e 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ After the updates are complete, you'll get prompted if you'd like to prune dangl ### Notifications: -Use a `notify_X.sh` template file, copy it to `notify.sh` in the same location as the script, modify it to your needs! +Use a `notify_X.sh` template file, copy it to `notify.sh`, modify it to your needs! Current templates: - Synology [DSM](https://www.synology.com/en-global/dsm) - Email with [sSMTP](https://wiki.debian.org/sSMTP) From 63b35ab2c3c3db07fd3d6122d97d11764e570b9f Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 21:49:36 +0100 Subject: [PATCH 07/15] formatting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20ba51e..7e8cf59 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Enter number(s) separated by comma, [a] for all - [q] to quit: Then it proceedes to run `pull` and `up -d` on every container with updates. After the updates are complete, you'll get prompted if you'd like to prune dangling images. -### Notifications: +### :loudspeaker: Notifications Use a `notify_X.sh` template file, copy it to `notify.sh`, modify it to your needs! Current templates: From 30533043561b318eff98ce8e2bbfb2edf5e2e7e8 Mon Sep 17 00:00:00 2001 From: mag37 Date: Fri, 5 Jan 2024 21:51:43 +0100 Subject: [PATCH 08/15] fixes --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e8cf59..9393321 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,8 @@ Current templates: - Apprise - both [native](https://github.com/caronc/apprise) and [API](https://github.com/caronc/apprise-api) (with it's [multitude](https://github.com/caronc/apprise#supported-notifications) of notifications) -A simple email notification function is added, with a generic example and DSM/Ssmtp script by [yoyoma2](https://github.com/yoyoma2). Further addons are welcome, suggestions or PR! +Further additions are welcome - suggestions or PR! +Initiated and first contributed by [yoyoma2](https://github.com/yoyoma2). ### :warning: `-r flag` disclaimer and warning **Wont auto-update the containers, only their images. (compose is recommended)** From 47ebb756913d68c8a8ca422923f708a2cc5002ce Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 6 Jan 2024 00:11:33 +0100 Subject: [PATCH 09/15] Added option -i --- README.md | 15 +++++++++------ dockcheck.sh | 12 ++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 9393321..5cb33ab 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ### :bell: Recent changes -- **v0.3.3**: Notification tweaks, added Apprise template. +- **v0.3.3**: Added Apprise template and the option `-i` inform - to send notifications. - **v0.3.2**: Added a notify function to wrap a notify-script, currently DSM/Ssmtp + template script. - **v0.3.1**: Addded option `-m` , monochrome mode - no printf color codes. - **v0.3.0**: Added option `-d N`, age (days) new images have to be before being pulled and updated. @@ -43,18 +43,20 @@ ___ ## `dockcheck.sh` ``` $ ./dockcheck.sh -h - Syntax: dockcheck.sh [OPTION] [part of name to filter] + Syntax: dockcheck.sh [OPTION] [part of name to filter] Example: dockcheck.sh -y -d 10 -e nextcloud,heimdall Options: - -h Print this Help. -a|y Automatic updates, without interaction. - -n No updates, only checking availability. + -d N Only update to new images that are N+ days old. Lists too recent with +prefix and age. 2xSlower. -e X Exclude containers, separated by comma. - -d N Only update to new images that are N+ days old. Lists too recent with +prefix. 2xSlower. + -h Print this Help. + -i Inform - send a preconfigured notification. + -m Monochrome mode, no printf color codes. + -n No updates, only checking availability. -p Auto-Prune dangling images after update. -r Allow updating images for docker run, wont update the container. - -s Include stopped containers in the check. (Logic: docker ps -a). + -s Include stopped containers in the check. (Logic: docker ps -a) ``` Basic example: @@ -77,6 +79,7 @@ Then it proceedes to run `pull` and `up -d` on every container with updates. After the updates are complete, you'll get prompted if you'd like to prune dangling images. ### :loudspeaker: Notifications +Trigger with the `-i` flag. Use a `notify_X.sh` template file, copy it to `notify.sh`, modify it to your needs! Current templates: diff --git a/dockcheck.sh b/dockcheck.sh index 9b7f39b..3189c4d 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -VERSION="v0.3.2" -### ChangeNotes: Added a notify function - template and email script (DSM etc) +VERSION="v0.3.3" +### ChangeNotes: Added option -i, inform - notify. Added Appraise template. Github="https://github.com/mag37/dockcheck" RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh" @@ -14,7 +14,6 @@ ScriptWorkDir="$(dirname "$ScriptPath")" LatestRelease="$(curl -s -r 0-50 $RawUrl | sed -n "/VERSION/s/VERSION=//p" | tr -d '"')" LatestChanges="$(curl -s -r 0-200 $RawUrl | sed -n "/ChangeNotes/s/### ChangeNotes: //p")" -[ -s $ScriptWorkDir/notify.sh ] && source $ScriptWorkDir/notify.sh ### Help Function: Help() { @@ -26,6 +25,7 @@ Help() { echo "-d N Only update to new images that are N+ days old. Lists too recent with +prefix and age. 2xSlower." echo "-e X Exclude containers, separated by comma." echo "-h Print this Help." + echo "-i Inform - send a preconfigured notification." echo "-m Monochrome mode, no printf color codes." echo "-n No updates, only checking availability." echo "-p Auto-Prune dangling images after update." @@ -41,14 +41,14 @@ c_blue="\033[0;34m" c_teal="\033[0;36m" c_reset="\033[0m" - Stopped="" -while getopts "aynprhsme:d:" options; do +while getopts "aynprhisme:d:" options; do case "${options}" in a|y) AutoUp="yes" ;; n) AutoUp="no" ;; r) DRunUp="yes" ;; p) AutoPrune="yes" ;; + i) [ -s $ScriptWorkDir/notify.sh ] && { source $ScriptWorkDir/notify.sh ; Notify="yes" ; } ;; e) Exclude=${OPTARG} ;; m) declare c_{red,green,yellow,blue,teal,reset}="" ;; s) Stopped="-a" ;; @@ -234,7 +234,7 @@ fi if [[ -n ${GotUpdates[*]} ]] ; then printf "\n%bContainers with updates available:%b\n" "$c_yellow" "$c_reset" [[ -z "$AutoUp" ]] && options || printf "%s\n" "${GotUpdates[@]}" - [[ $(type -t send_notification) == function ]] && send_notification "${GotUpdates[@]}" + [[ ! -z "$Notify" ]] && { [[ $(type -t send_notification) == function ]] && send_notification "${GotUpdates[@]}" || printf "Could not source notification function.\n" ; } fi ### Optionally get updates if there's any From 92ba4a184e5eef1cc3e0e37976f7b16bfe483633 Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 6 Jan 2024 07:47:41 +0100 Subject: [PATCH 10/15] edits --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cb33ab..688125c 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,10 @@ Use a `notify_X.sh` template file, copy it to `notify.sh`, modify it to your nee Current templates: - Synology [DSM](https://www.synology.com/en-global/dsm) - Email with [sSMTP](https://wiki.debian.org/sSMTP) -- Apprise - both [native](https://github.com/caronc/apprise) and [API](https://github.com/caronc/apprise-api) (with it's [multitude](https://github.com/caronc/apprise#supported-notifications) of notifications) +- Apprise (with it's [multitude](https://github.com/caronc/apprise#supported-notifications) of notifications) + - both native [caronc/apprise](https://github.com/caronc/apprise) and the standalone [linuxserver/docker-apprise-api](https://github.com/linuxserver/docker-apprise-api) +Run it scheduled with `-ni` to only get notified when there's updates available! Further additions are welcome - suggestions or PR! Initiated and first contributed by [yoyoma2](https://github.com/yoyoma2). From edf6d5bd7287e382857baed4884ab0466477c870 Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 6 Jan 2024 08:40:26 +0100 Subject: [PATCH 11/15] added architecture workaround --- README.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 688125c..377e824 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@

With features like excluding specific containers, filter by name, auto-prune dangling images and more. -### :bell: Recent changes +### :bell: Changelog - **v0.3.3**: Added Apprise template and the option `-i` inform - to send notifications. - **v0.3.2**: Added a notify function to wrap a notify-script, currently DSM/Ssmtp + template script. - **v0.3.1**: Addded option `-m` , monochrome mode - no printf color codes. @@ -32,9 +32,10 @@ ___ ## Dependencies -Running docker (duh) and compose, either standalone or plugin. -[`regclient/regctl`](https://github.com/regclient/regclient) (Licensed under [Apache-2.0 License](http://www.apache.org/licenses/LICENSE-2.0)) -User will be prompted to download `regctl` if not in `PATH` or `PWD` +- Running docker (duh) and compose, either standalone or plugin. +- [`regclient/regctl`](https://github.com/regclient/regclient) (Licensed under [Apache-2.0 License](http://www.apache.org/licenses/LICENSE-2.0)) + - User will be prompted to download `regctl` if not in `PATH` or `PWD`. + - regctl requires `amd64/aarch64` - see [workaround](#workaround-for-non-amd-aarch) if other architecture is used. ___ @@ -93,6 +94,7 @@ Run it scheduled with `-ni` to only get notified when there's updates available! Further additions are welcome - suggestions or PR! Initiated and first contributed by [yoyoma2](https://github.com/yoyoma2). + ### :warning: `-r flag` disclaimer and warning **Wont auto-update the containers, only their images. (compose is recommended)** `docker run` dont support using new images just by restarting a container. @@ -103,6 +105,27 @@ Containers need to be manually stopped, removed and created again to run on the - Not respecting `--profile` options when re-creating the container. - Not working well with containers created by Portainer. +### Workaround for non **amd64** / **aarch64** +`regctl` provides binaries for amd64/aarch64, to use on other architecture you could try this workaround. +Run regctl in a contianer wrapped in a shell script. Copied from [regclient/docs/install.md](https://github.com/regclient/regclient/blob/main/docs/install.md): + +```sh +cat >regctl < Date: Sat, 6 Jan 2024 08:44:07 +0100 Subject: [PATCH 12/15] fixed link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 377e824..13a1196 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ ___ - Running docker (duh) and compose, either standalone or plugin. - [`regclient/regctl`](https://github.com/regclient/regclient) (Licensed under [Apache-2.0 License](http://www.apache.org/licenses/LICENSE-2.0)) - User will be prompted to download `regctl` if not in `PATH` or `PWD`. - - regctl requires `amd64/aarch64` - see [workaround](#workaround-for-non-amd-aarch) if other architecture is used. + - regctl requires `amd64/aarch64` - see [workaround](#workaround-for-non-amd64--aarch64) if other architecture is used. ___ From 61e247f0ea2d32c5524c5010788a9281d1b2a43e Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 6 Jan 2024 17:29:35 +0100 Subject: [PATCH 13/15] formatting --- notify_DSM.sh | 13 +++++++++---- notify_ssmtp.sh | 15 +++++++++------ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/notify_DSM.sh b/notify_DSM.sh index e2b3f2d..3085be5 100644 --- a/notify_DSM.sh +++ b/notify_DSM.sh @@ -1,13 +1,18 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. -# Copy/rename this file to notify.sh to enable email notifications on synology DSM +# +# Copy/rename this file to notify.sh to enable email notifications on Synology DSM +# DSM Notification Email has to be configured manually. # Modify to your liking - changing SendMailTo and Subject and content. send_notification() { Updates=("$@") UpdToString=$( printf "%s\n" "${Updates[@]}" ) +FromHost=$(hostname) + +# User variables: # change this to your usual destination for synology DSM notification emails SendMailTo=me@mydomain.com -FromHost=$(hostname) +SubjectTag="diskstation" printf "\nSending email notification\n" @@ -15,11 +20,11 @@ ssmtp $SendMailTo << __EOF From: "$FromHost" <$SendMailTo> date:$(date -R) To: <$SendMailTo> -Subject: [diskstation] Some docker containers need to be updated +Subject: [$SubjectTag] Updates available on $FromHost Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit -The following docker containers on $FromHost need to be updated: +The following containers on $FromHost have updates available: $UpdToString diff --git a/notify_ssmtp.sh b/notify_ssmtp.sh index 6841a27..2d80cb4 100644 --- a/notify_ssmtp.sh +++ b/notify_ssmtp.sh @@ -1,23 +1,26 @@ ### DISCLAIMER: This is a third party addition to dockcheck - best effort testing. # # Copy/rename this file to notify.sh to enable the notification snipppet. -# Required receiving services must already be set up. -# Modify to fit your setup - changing SendMailFrom, SendMailTo +# sSMTP has to be installed and configured manually. +# Modify to fit your setup - changing SendMailFrom, SendMailTo, SubjectTag send_notification() { Updates=("$@") UpdToString=$( printf "%s\n" "${Updates[@]}" ) -SendMailFrom=me@mydomain.tld -SendMailTo=me@mydomain.tld FromHost=$(hostname) -printf "\nSending email notification\n" +# User variables: +SendMailFrom="me@mydomain.tld" +SendMailTo="me@mydomain.tld" +SubjectTag="dockcheck" + +printf "\nSending email notification.\n" ssmtp $SendMailTo << __EOF From: "$FromHost" <$SendMailFrom> date:$(date -R) To: <$SendMailTo> -Subject: [dockcheck] Updates available on $FromHost +Subject: [$SubjectTag] Updates available on $FromHost Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit From 6c37e255fb3175ca946cc38fc3fc64ade472175f Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 6 Jan 2024 17:30:00 +0100 Subject: [PATCH 14/15] formatting --- notify_DSM.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notify_DSM.sh b/notify_DSM.sh index 3085be5..c2df64b 100644 --- a/notify_DSM.sh +++ b/notify_DSM.sh @@ -11,10 +11,10 @@ FromHost=$(hostname) # User variables: # change this to your usual destination for synology DSM notification emails -SendMailTo=me@mydomain.com +SendMailTo="me@mydomain.com" SubjectTag="diskstation" -printf "\nSending email notification\n" +printf "\nSending email notification.\n" ssmtp $SendMailTo << __EOF From: "$FromHost" <$SendMailTo> From 82f644293383429d6e972c0b976bbc6b55b8351d Mon Sep 17 00:00:00 2001 From: mag37 Date: Sat, 6 Jan 2024 20:33:21 +0100 Subject: [PATCH 15/15] modified apprise-notify --- README.md | 9 ++++----- notify_apprise.sh | 27 +++++++++++++++------------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 13a1196..6e540e4 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ ___ - Running docker (duh) and compose, either standalone or plugin. - [`regclient/regctl`](https://github.com/regclient/regclient) (Licensed under [Apache-2.0 License](http://www.apache.org/licenses/LICENSE-2.0)) - User will be prompted to download `regctl` if not in `PATH` or `PWD`. - - regctl requires `amd64/aarch64` - see [workaround](#workaround-for-non-amd64--aarch64) if other architecture is used. + - regctl requires `amd64/arm64` - see [workaround](#workaround-for-non-amd64--arm64) if other architecture is used. ___ @@ -81,6 +81,7 @@ After the updates are complete, you'll get prompted if you'd like to prune dangl ### :loudspeaker: Notifications Trigger with the `-i` flag. +Run it scheduled with `-ni` to only get notified when there's updates available! Use a `notify_X.sh` template file, copy it to `notify.sh`, modify it to your needs! Current templates: @@ -89,8 +90,6 @@ Current templates: - Apprise (with it's [multitude](https://github.com/caronc/apprise#supported-notifications) of notifications) - both native [caronc/apprise](https://github.com/caronc/apprise) and the standalone [linuxserver/docker-apprise-api](https://github.com/linuxserver/docker-apprise-api) -Run it scheduled with `-ni` to only get notified when there's updates available! - Further additions are welcome - suggestions or PR! Initiated and first contributed by [yoyoma2](https://github.com/yoyoma2). @@ -105,8 +104,8 @@ Containers need to be manually stopped, removed and created again to run on the - Not respecting `--profile` options when re-creating the container. - Not working well with containers created by Portainer. -### Workaround for non **amd64** / **aarch64** -`regctl` provides binaries for amd64/aarch64, to use on other architecture you could try this workaround. +### Workaround for non **amd64** / **arm64** +`regctl` provides binaries for amd64/arm64, to use on other architecture you could try this workaround. Run regctl in a contianer wrapped in a shell script. Copied from [regclient/docs/install.md](https://github.com/regclient/regclient/blob/main/docs/install.md): ```sh diff --git a/notify_apprise.sh b/notify_apprise.sh index ac6c980..9945524 100644 --- a/notify_apprise.sh +++ b/notify_apprise.sh @@ -2,33 +2,36 @@ # # Copy/rename this file to notify.sh to enable the notification snippet. # Required receiving services must already be set up. -# Modify to fit your setup - set AppriseURL to your Apprise ip/domain. +# Modify to fit your setup - if API, set AppriseURL to your Apprise ip/domain. send_notification() { Updates=("$@") UpdToString=$( printf "%s\n" "${Updates[@]}" ) FromHost=$(hostname) -AppriseURL="http://apprise.mydomain.tld:1234/notify/apprise" printf "\nSending Apprise notification\n" MessageTitle="$FromHost - updates available." # Setting the MessageBody variable here. -read -d '\n' MessageBody << EOF +read -d '\n' MessageBody << __EOF Containers on $FromHost with updates available: $UpdToString -EOF +__EOF + +# Modify to fit your setup: +apprise -vv -t "$MessageTitle" -b "$MessageBody" \ + mailto://myemail:mypass@gmail.com \ + mastodons://{token}@{host} \ + pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b \ + tgram://{bot_token}/{chat_id}/ + +### If you use the Apprise-API - Comment out the apprise command above. +### Uncomment the AppriseURL and the curl-line below: +# AppriseURL="http://apprise.mydomain.tld:1234/notify/apprise" +# curl -X POST -F "title=$MessageTitle" -F "body=$MessageBody" -F "tags=all" $AppriseURL -curl -X POST -F "title=$MessageTitle" -F "body=$MessageBody" -F "tags=all" $AppriseURL } -# If you run apprise bare metal on the same machine as dockcheck -# you can just comment out the AppriseURL and swap the curl line -# with something ike this: -# -# apprise -vv -t "$MessageTitle" -b "$MessageBody" \ -# 'mailto://myemail:mypass@gmail.com' \ -# 'pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b'