Compare commits

..

18 Commits

Author SHA1 Message Date
mag37
7493d462b3 Patched bugfix to not recreate stopped containers 2025-12-04 11:07:42 +01:00
mag37
ed2938166f readme tweaks + added help for -K option 2025-12-04 10:36:13 +01:00
mag37
49403b98a1 added function to print currently backed up images 2025-12-04 10:20:12 +01:00
mag37
f16953a479 Added all readme, help text and configs 2025-12-04 10:14:24 +01:00
mag37
160f4a2c5f Test to remove the <none>-tagged copy after backup is created 2025-11-29 17:06:06 +01:00
mag37
85e2b2c02c added timestamp variables to exports, formatting 2025-11-28 16:32:56 +01:00
mag37
644cbaedd1 moved the prune logic and made a forced prune with -k flag 2025-11-24 22:18:07 +01:00
mag37
eeb719296d cleaned up the config info queries 2025-11-24 22:07:25 +01:00
mag37
9c44a5176d fixed missing formatting variables 2025-11-22 20:22:57 +01:00
mag37
e191971933 label-fix to fallback to default :latest when unset 2025-11-21 14:03:32 +01:00
mag37
c3c7206622 quickfixes to not be completely broken - but needs much more work 2025-11-20 20:22:04 +01:00
mag37
c1124676d1 reworked the image listing when removing backups to properly list all dockcheck/*** backups 2025-11-15 20:53:45 +01:00
mag37
6576a36fda moved the cleanup and prune logic to always run. Changed some wording on messages. 2025-11-15 20:02:48 +01:00
mag37
42d35b7a03 enclosing some variables in braces due to strings messing up 2025-11-13 20:27:31 +01:00
mag37
fc58962f79 added forgotten variables, corrected some variables 2025-11-13 20:18:25 +01:00
mag37
ff2006437f final logic to get image backups to work for testing 2025-11-13 17:49:52 +01:00
mag37
ac98e81172 datecheck function rewrite 2025-11-13 17:29:53 +01:00
mag37
6fefcbc3dd added new variables, options and setup 2025-11-13 16:30:46 +01:00
5 changed files with 62 additions and 101 deletions

View File

@@ -13,9 +13,9 @@
</p> </p>
<h2 align="center">CLI tool to automate docker image updates or notifying when updates are available.</h2> <h2 align="center">CLI tool to automate docker image updates or notifying when updates are available.</h2>
<h3 align="center">selective updates, include/exclude containers, image backups, custom labels, notification plugins, prune when done etc.</h3> <h3 align="center">selective updates, exclude containers, custom labels, notification plugins, prune when done etc.</h3>
<h4 align="center">:whale: Docker Hub pull limit :chart_with_downwards_trend: not an issue for checks only for actual pulls - <a href="#whale-docker-hub-pull-limit-chart_with_downwards_trend-not-an-issue-for-checks-but-for-actual-pulls">read more</a></h4> <h4 align="center">:whale: Docker Hub pull limit :chart_with_downwards_trend: not an issue for checks but for actual pulls - <a href="#whale-docker-hub-pull-limit-chart_with_downwards_trend-not-an-issue-for-checks-but-for-actual-pulls">read more</a></h4>
<h5 align="center">For Podman - see the fork <a href="https://github.com/sudo-kraken/podcheck">sudo-kraken/podcheck</a>!</h4> <h5 align="center">For Podman - see the fork <a href="https://github.com/sudo-kraken/podcheck">sudo-kraken/podcheck</a>!</h4>
@@ -23,12 +23,10 @@ ___
## Changelog ## Changelog
- **v0.7.5**: - **v0.7.5**:
- Added new option **BackupForDays**; `-b N` and `-B`: - Added new option **DaysKept**; `-k N` and `-K`:
- Backup an image before pulling a new version for easy rollback in case of breakage. - Backup an image before pulling a new version for easy rollback in case of breakage.
- Removes backed up images older than *N* days. - Removes backed up images older than *N* days.
- List currently backed up images with `-B`. - List currently backed up images with `-K`.
- Fixes:
- Bugfix for `-s` *Stopped* to not recreate stopped containers after update.
- **v0.7.4**: - **v0.7.4**:
- Added new option `-R`: - Added new option `-R`:
- Will skip container recreation after pulling images. - Will skip container recreation after pulling images.
@@ -58,8 +56,6 @@ Example: dockcheck.sh -y -x 10 -d 10 -e nextcloud,heimdall
Options: Options:
-a|y Automatic updates, without interaction. -a|y Automatic updates, without interaction.
-b N Enable image backups and sets number of days to keep from pruning.
-B List currently backed up images, then exit.
-c D Exports metrics as prom file for the prometheus node_exporter. Provide the collector textfile directory. -c D Exports metrics as prom file for the prometheus node_exporter. Provide the collector textfile directory.
-d N Only update to new images that are N+ days old. Lists too recent with +prefix and age. 2xSlower. -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. -e X Exclude containers, separated by comma.
@@ -67,6 +63,8 @@ Options:
-F Only compose up the specific container, not the whole compose stack (useful for master-compose structure). -F Only compose up the specific container, not the whole compose stack (useful for master-compose structure).
-h Print this Help. -h Print this Help.
-i Inform - send a preconfigured notification. -i Inform - send a preconfigured notification.
-k N DaysKept - enable backups of images prior to update and prunes backups older than N days.
-K List currently backed up images, then exit.
-I Prints custom releasenote urls alongside each container with updates in CLI output (requires urls.list). -I Prints custom releasenote urls alongside each container with updates in CLI output (requires urls.list).
-l Only include containers with label set. See readme. -l Only include containers with label set. See readme.
-m Monochrome mode, no printf colour codes and hides progress bar. -m Monochrome mode, no printf colour codes and hides progress bar.
@@ -85,19 +83,18 @@ Options:
### Basic example: ### Basic example:
``` ```
$ ./dockcheck.sh $ ./dockcheck.sh
[##################################################] 5/5 . . .
Containers on latest version: Containers on latest version:
glances glances
homer homer
Containers with updates available: Containers with updates available:
01) adguardhome 1) adguardhome
02) syncthing 2) syncthing
03) whoogle-search 3) whoogle-search
Choose what containers to update: Choose what containers to update:
Enter number(s) separated by comma, [a] for all - [q] to quit: 1,2 Enter number(s) separated by comma, [a] for all - [q] to quit:
``` ```
Then it proceeds to run `pull` and `up -d` on every container with updates. Then it proceeds 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. After the updates are complete, you'll get prompted if you'd like to prune dangling images.
@@ -245,22 +242,21 @@ The `urls.list` file is just an example and I'd gladly see that people contribut
Pass `-x N` where N is number of subprocesses allowed, experiment in your environment to find a suitable max! Pass `-x N` where N is number of subprocesses allowed, experiment in your environment to find a suitable max!
Change the default value by editing the `MaxAsync=N` variable in `dockcheck.sh`. To disable the subprocess function set `MaxAsync=0`. Change the default value by editing the `MaxAsync=N` variable in `dockcheck.sh`. To disable the subprocess function set `MaxAsync=0`.
## Image Backups; `-b N` to backup previous images as custom (retagged) images for easy rollback ## Image Backups; `-k N` to backup previous images as custom (retagged) images for easy rollback
When the option `BackupForDays` is set **dockcheck** will store the image being updated as a backup, retagged with a different name and removed due to age configured (*BackupForDays*) in a future run. When the option `DaysKept` is set **dockcheck** will store the image being updated as a backup, retagged with a different name and removed due to age configured (*DaysKept*) in a future run.
Let's say we're updating `b4bz/homer:latest` - then before replacing the current image it will be retagged with the name `dockcheck/homer:2025-10-26_1132_latest` Let's say we're updating `b4bz/homer:latest` - then before replacing the current image it will be retagged with the name `dockcheck/homer:2025-10-26_1132_latest`
- `dockcheck` as repo name to not interfere with others. - `dockcheck` as repo name to not interfere with others.
- `homer` is the image. - `homer` is the image.
- `2025-10-26_1132` is the time when running the script. - `2025-10-26_1132` is the time when running the script.
- `latest` is the tag of the image. - `latest` is the tag of the image.
Then if an update breaks, you could restore the image by stopping the container, delete the new image, eg. `docker rmi b4bz/homer:latest`, then retag the backup as latest `docker tag dockcheck/homer:<date>_latest b4bz/homer:latest`. Then if an update breaks you could temporarily roll back to the previoius working state by changing the docker compose image to `image: dockcheck/homer:2025-10-26_1132_latest` and get it up and running again, then continue troubleshooting the breaking update.
After that, start the container again (now with the backup image active) and it will be updated as usual next time you run dockcheck or other updates.
The backed up images will be removed if they're older than *BackupForDays* value (passed as `-b N` or set in the `dockcheck.config` with `BackupForDays=N`) and then pruned. The backed up images will be removed if they're older than *DaysKept* value (passed as `-k N` or set in the `dockcheck.config` with `DaysKept=N`) and then pruned.
If configured for eg. 7 days, force earlier cleaning by just passing a lower number of days, eg. `-b 2` to clean everything older than 2 days. If configured for eg. 7 days, force earlier cleaning by just passing a lower number of days, eg. `-k 2` to clean everything older than 2 days.
Backed up images will not be removed if neither `-b` flag nor `BackupForDays` config variable is set. Backed up images will not be removed if neither `-k` flag nor `DaysKept` config variable is set.
Use the capital option `-B` to list currently backed up images. Or list all images with `docker images`. Use the capital option `-K` to list currently backed up images. Or list all images with `docker images`.
To manually remove any backed up images, do `docker rmi dockcheck/homer:2025-10-26_1132_latest`. To manually remove any backed up images, do `docker rmi dockcheck/homer:2025-10-26_1132_latest`.
## Extra plugins and tools: ## Extra plugins and tools:

View File

@@ -28,7 +28,7 @@
#CurlRetryCount=3 # Max number of curl retries #CurlRetryCount=3 # Max number of curl retries
#CurlConnectTimeout=5 # Time to wait for curl to establish a connection before failing #CurlConnectTimeout=5 # Time to wait for curl to establish a connection before failing
#DisplaySourcedFiles=false # Display what files are being sourced/used #DisplaySourcedFiles=false # Display what files are being sourced/used
#BackupForDays=7 # Enable backups of images and removes backups older than N days. #DaysKept=7 # Enable backups of images and removes backups older than N days.
### Notify settings ### Notify settings
## All commented values are examples only. Modify as needed. ## All commented values are examples only. Modify as needed.

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERSION="v0.7.5" VERSION="v0.7.4"
# ChangeNotes: New option -b N to backup image before pulling for easy rollback. # ChangeNotes: New option -R to pull without recreation. Fixes: value too great error, legacy cleanups.
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"
@@ -34,8 +34,6 @@ Help() {
echo echo
echo "Options:" echo "Options:"
echo "-a|y Automatic updates, without interaction." echo "-a|y Automatic updates, without interaction."
echo "-b N Enable image backups and sets number of days to keep from pruning."
echo "-B List currently backed up images, then exit."
echo "-c Exports metrics as prom file for the prometheus node_exporter. Provide the collector textfile directory." echo "-c Exports metrics as prom file for the prometheus node_exporter. Provide the collector textfile directory."
echo "-d N Only update to new images that are N+ days old. Lists too recent with +prefix and age. 2xSlower." 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 "-e X Exclude containers, separated by comma."
@@ -44,7 +42,10 @@ Help() {
echo "-h Print this Help." echo "-h Print this Help."
echo "-i Inform - send a preconfigured notification." echo "-i Inform - send a preconfigured notification."
echo "-I Prints custom releasenote urls alongside each container with updates in CLI output (requires urls.list)." echo "-I Prints custom releasenote urls alongside each container with updates in CLI output (requires urls.list)."
echo "-k N Number of days to store image backups before pruning - this also enables the backup function."
echo "-K List currently backed up images, then exit."
echo "-l Only include containers with label set. See readme." echo "-l Only include containers with label set. See readme."
echo "-k N DaysKept - enable backups of images prior to update and prunes backups older than N days."
echo "-m Monochrome mode, no printf colour codes and hides progress bar." echo "-m Monochrome mode, no printf colour codes and hides progress bar."
echo "-M Prints custom releasenote urls as markdown (requires template support)." echo "-M Prints custom releasenote urls as markdown (requires template support)."
echo "-n No updates; only checking availability without interaction." echo "-n No updates; only checking availability without interaction."
@@ -85,7 +86,7 @@ Stopped=${Stopped:-""}
CollectorTextFileDirectory=${CollectorTextFileDirectory:-} CollectorTextFileDirectory=${CollectorTextFileDirectory:-}
Exclude=${Exclude:-} Exclude=${Exclude:-}
DaysOld=${DaysOld:-} DaysOld=${DaysOld:-}
BackupForDays=${BackupForDays:-} DaysKept=${DaysKept:-}
OnlySpecific=${OnlySpecific:-false} OnlySpecific=${OnlySpecific:-false}
SpecificContainer=${SpecificContainer:-""} SpecificContainer=${SpecificContainer:-""}
SkipRecreate=${SkipRecreate:-false} SkipRecreate=${SkipRecreate:-false}
@@ -110,11 +111,9 @@ c_reset="\033[0m"
RunTimestamp=$(date +'%Y-%m-%d_%H%M') RunTimestamp=$(date +'%Y-%m-%d_%H%M')
RunEpoch=$(date +'%s') RunEpoch=$(date +'%s')
while getopts "ayb:BfFhiIlmMnprsuvc:e:d:t:x:R" options; do while getopts "ayfFhiIlmMnprsuvc:e:d:k:Kt:x:R" options; do
case "${options}" in case "${options}" in
a|y) AutoMode=true ;; a|y) AutoMode=true ;;
b) BackupForDays="${OPTARG}" ;;
B) print_backups; exit 0 ;;
c) CollectorTextFileDirectory="${OPTARG}" ;; c) CollectorTextFileDirectory="${OPTARG}" ;;
d) DaysOld=${OPTARG} ;; d) DaysOld=${OPTARG} ;;
e) Exclude=${OPTARG} ;; e) Exclude=${OPTARG} ;;
@@ -122,6 +121,8 @@ while getopts "ayb:BfFhiIlmMnprsuvc:e:d:t:x:R" options; do
F) OnlySpecific=true ;; F) OnlySpecific=true ;;
i) Notify=true ;; i) Notify=true ;;
I) PrintReleaseURL=true ;; I) PrintReleaseURL=true ;;
k) DaysKept="${OPTARG}" ;;
K) print_backups; exit 0 ;;
l) OnlyLabel=true ;; l) OnlyLabel=true ;;
m) MonoMode=true ;; m) MonoMode=true ;;
M) PrintMarkdownURL=true ;; M) PrintMarkdownURL=true ;;
@@ -171,12 +172,11 @@ if [[ -n "$DaysOld" ]]; then
exit 2 exit 2
fi fi
fi fi
if [[ -n "$BackupForDays" ]]; then if [[ -n "$DaysKept" ]]; then
if ! [[ $BackupForDays =~ ^[0-9]+$ ]]; then if ! [[ $DaysKept =~ ^[0-9]+$ ]]; then
printf "-b argument given (%s) is not a number.\n" "$BackupForDays" printf "-k argument given (%s) is not a number.\n" "$DaysKept"
exit 2 exit 2
fi fi
[[ "$AutoPrune" == true ]] && printf "%bWARNING: When -b option is used, -p has no function.%b\n" "$c_yellow" "$c_reset"
fi fi
if [[ -n "$CollectorTextFileDirectory" ]]; then if [[ -n "$CollectorTextFileDirectory" ]]; then
if ! [[ -d $CollectorTextFileDirectory ]]; then if ! [[ -d $CollectorTextFileDirectory ]]; then
@@ -231,7 +231,6 @@ choosecontainers() {
while [[ -z "${ChoiceClean:-}" ]]; do while [[ -z "${ChoiceClean:-}" ]]; do
read -r -p "Enter number(s) separated by comma, [a] for all - [q] to quit: " Choice read -r -p "Enter number(s) separated by comma, [a] for all - [q] to quit: " Choice
if [[ "$Choice" =~ [qQnN] ]]; then if [[ "$Choice" =~ [qQnN] ]]; then
[[ -n "${BackupForDays:-}" ]] && remove_backups
exit 0 exit 0
elif [[ "$Choice" =~ [aAyY] ]]; then elif [[ "$Choice" =~ [aAyY] ]]; then
SelectedUpdates=( "${GotUpdates[@]}" ) SelectedUpdates=( "${GotUpdates[@]}" )
@@ -262,28 +261,6 @@ datecheck() {
fi fi
} }
remove_backups() {
IFS=$'\n'
CleanupCount=0
for backup_img in $(docker images --format "{{.Repository}} {{.Tag}}" | sed -n '/^dockcheck/p'); do
repo_name=${backup_img% *}
backup_tag=${backup_img#* }
backup_date=${backup_tag%%_*}
# UNTAGGING HERE
if datecheck "$backup_date" "$BackupForDays"; then
[[ "$CleanupCount" == 0 ]] && printf "\n%bRemoving backed up images older then %s days.%b\n" "$c_blue" "$BackupForDays" "$c_reset"
docker rmi "${repo_name}:${backup_tag}" && ((CleanupCount+=1))
fi
done
unset IFS
if [[ "$CleanupCount" == 0 ]]; then
printf "\nNo backup images to remove.\n"
else
[[ "$CleanupCount" -gt 1 ]] && b_phrase="backups" || b_phrase="backup"
printf "\n%b%s%b %s removed.%b\n" "$c_green" "$CleanupCount" "$c_teal" "$b_phrase" "$c_reset"
fi
}
progress_bar() { progress_bar() {
QueCurrent="$1" QueCurrent="$1"
QueTotal="$2" QueTotal="$2"
@@ -582,25 +559,6 @@ if [[ -n "${GotUpdates:-}" ]]; then
NumberofUpdates="${#SelectedUpdates[@]}" NumberofUpdates="${#SelectedUpdates[@]}"
# TODO: move this to proper place + setup optarg etc.
# Digest log setup
LogDigestChanges="true"
LogPath="$ScriptWorkDir/updatelog"
if [[ -n "${LogDigestChanges}" ]]; then
LogStore=()
LogStore+=("$(printf "%-30s %s > %s\n" "IMAGE:TAG" "OLD DIGEST" "NEW DIGEST")")
fi
# TODO: move this to proper place
get_image_facts(){
ImageConfig=$(docker image inspect "$ImageId" --format '{{ json . }}')
ContRepoDigests=$($jqbin -r '.RepoDigests[0]' <<< "$ImageConfig")
[[ "$ContRepoDigests" == "null" ]] && ContRepoDigests=""
ContRepo=${ContImage%:*}
ContApp=${ContRepo#*/}
[[ "$ContImage" =~ ":" ]] && ContTag=${ContImage#*:} || ContTag="latest"
}
CurrentQue=0 CurrentQue=0
for i in "${SelectedUpdates[@]}"; do for i in "${SelectedUpdates[@]}"; do
((CurrentQue+=1)) ((CurrentQue+=1))
@@ -611,17 +569,17 @@ if [[ -n "${GotUpdates:-}" ]]; then
ContPath=$($jqbin -r '."Config"."Labels"."com.docker.compose.project.working_dir"' <<< "$ContConfig") ContPath=$($jqbin -r '."Config"."Labels"."com.docker.compose.project.working_dir"' <<< "$ContConfig")
[[ "$ContPath" == "null" ]] && ContPath="" [[ "$ContPath" == "null" ]] && ContPath=""
# Add new backup tag prior to pulling if option is set # Add new backup tag prior to pulling if option is set
if [[ -n "${BackupForDays:-}" ]]; then if [[ -n "${DaysKept:-}" ]]; then
get_image_facts ContRepoDigests=$(docker image inspect "$ImageId" --format "{{index .RepoDigests 0}}")
ContRepo=${ContImage%:*}
ContApp=${ContRepo#*/}
[[ "$ContImage" =~ ":" ]] && ContTag=${ContImage#*:} || ContTag="latest"
BackupName="dockcheck/${ContApp}:${RunTimestamp}_${ContTag}" BackupName="dockcheck/${ContApp}:${RunTimestamp}_${ContTag}"
docker tag "$ImageId" "$BackupName" docker tag "$ImageId" "$BackupName"
printf "%b%s backed up as %s%b\n" "$c_teal" "$i" "$BackupName" "$c_reset" printf "%b%s backed up as %s%b\n" "$c_teal" "$i" "$BackupName" "$c_reset"
fi fi
[[ -n "${LogDigestChanges}" ]] && get_image_facts
# Checking if compose-values are empty - hence started with docker run # Checking if compose-values are empty - hence started with docker run
if [[ -z "$ContPath" ]]; then if [[ -z "$ContPath" ]]; then
if [[ "$DRunUp" == true ]]; then if [[ "$DRunUp" == true ]]; then
@@ -635,18 +593,13 @@ if [[ -n "${GotUpdates:-}" ]]; then
if docker pull "$ContImage"; then if docker pull "$ContImage"; then
# Removal of the <none>-tag image left behind from backup # Removal of the <none>-tag image left behind from backup
if [[ ! -z "${ContRepoDigests:-}" ]] && [[ -n "${BackupForDays:-}" ]]; then docker rmi "$ContRepoDigests"; fi [[ -n "${DaysKept:-}" ]] && docker rmi "$ContRepoDigests"
if [[ -n "${LogDigestChanges}" ]]; then
NewDigest=$(docker image inspect "$ContImage" --format '{{index .RepoDigests 0 }}')
LogStore+=("$(printf "%-30s %s > %s\n" "$i:$ContTag" "$ContRepoDigests" "$NewDigest")")
fi
else else
printf "\n%bDocker error, exiting!%b\n" "$c_red" "$c_reset" ; exit 1 printf "\n%bDocker error, exiting!%b\n" "$c_red" "$c_reset" ; exit 1
fi fi
done done
printf "\n%bDone pulling updates.%b\n" "$c_green" "$c_reset" printf "\n%bDone pulling updates.%b\n" "$c_green" "$c_reset"
[[ -n "${LogDigestChanges}" ]] && { printf "%s\n" "${LogStore[@]}" > "${LogPath}_$(date +'%Y-%m-%d_%H%M')"; }
if [[ "$SkipRecreate" == true ]]; then if [[ "$SkipRecreate" == true ]]; then
printf "%bSkipping container recreation due to -R.%b\n" "$c_yellow" "$c_reset" printf "%bSkipping container recreation due to -R.%b\n" "$c_yellow" "$c_reset"
@@ -708,8 +661,28 @@ if [[ -n "${GotUpdates:-}" ]]; then
fi fi
printf "\n%bAll updates done!%b\n" "$c_green" "$c_reset" printf "\n%bAll updates done!%b\n" "$c_green" "$c_reset"
# Trigger pruning only when backup-function is not used # Clean up old backup image tags if -k is used
if [[ -z "${BackupForDays:-}" ]]; then if [[ -n "${DaysKept:-}" ]]; then
IFS=$'\n'
CleanupCount=0
for backup_img in $(docker images --format "{{.Repository}} {{.Tag}}" | sed -n '/^dockcheck/p'); do
repo_name=${backup_img% *}
backup_tag=${backup_img#* }
backup_date=${backup_tag%%_*}
# UNTAGGING HERE
if datecheck "$backup_date" "$DaysKept"; then
[[ "$CleanupCount" == 0 ]] && echo "Removing backed up images older then $DaysKept days."
docker rmi "${repo_name}:${backup_tag}" && ((CleanupCount+=1))
fi
done
unset IFS
if [[ "$CleanupCount" == 0 ]]; then
printf "\nNo backup images to remove.\n"
else
printf "\n%b%s%b backup images removed.%b\n" "$c_green" "$CleanupCount" "$c_teal" "$c_reset"
docker image prune -f
fi
else
if [[ "$AutoPrune" == false ]] && [[ "$AutoMode" == false ]]; then printf "\n"; read -rep "Would you like to prune all dangling images? y/[n]: " AutoPrune; fi if [[ "$AutoPrune" == false ]] && [[ "$AutoMode" == false ]]; then printf "\n"; read -rep "Would you like to prune all dangling images? y/[n]: " AutoPrune; fi
if [[ "$AutoPrune" == true ]] || [[ "$AutoPrune" =~ [yY] ]]; then printf "\nAuto pruning.."; docker image prune -f; fi if [[ "$AutoPrune" == true ]] || [[ "$AutoPrune" =~ [yY] ]]; then printf "\nAuto pruning.."; docker image prune -f; fi
fi fi
@@ -721,7 +694,4 @@ else
printf "\nNo updates available.\n" printf "\nNo updates available.\n"
fi fi
# Clean up old backup image tags if -b is used
[[ -n "${BackupForDays:-}" ]] && remove_backups
exit 0 exit 0

View File

@@ -1,5 +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.5" NOTIFY_MATRIX_VERSION="v0.4"
# #
# Required receiving services must already be set up. # Required receiving services must already be set up.
# Leave (or place) this file in the "notify_templates" subdirectory within the same directory as the main dockcheck.sh script. # Leave (or place) this file in the "notify_templates" subdirectory within the same directory as the main dockcheck.sh script.
@@ -29,7 +29,7 @@ trigger_matrix_notification() {
AccessToken="${!AccessTokenVar}" # e.g. MATRIX_ACCESS_TOKEN=token-value AccessToken="${!AccessTokenVar}" # e.g. MATRIX_ACCESS_TOKEN=token-value
RoomId="${!RoomIdVar}" # e.g. MATRIX_ROOM_ID=myroom RoomId="${!RoomIdVar}" # e.g. MATRIX_ROOM_ID=myroom
MatrixServer="${!MatrixServerVar}" # e.g. MATRIX_SERVER_URL=http://matrix.yourdomain.tld MatrixServer="${!MatrixServerVar}" # e.g. MATRIX_SERVER_URL=http://matrix.yourdomain.tld
MsgBody=$($jqbin -Rn --arg body "$MessageBody" '{msgtype:"m.text", body:$body}') MsgBody="{\"msgtype\":\"m.text\",\"body\":\"$MessageBody\"}"
# URL Example: https://matrix.org/_matrix/client/r0/rooms/!xxxxxx:example.com/send/m.room.message?access_token=xxxxxxxx # URL Example: https://matrix.org/_matrix/client/r0/rooms/!xxxxxx:example.com/send/m.room.message?access_token=xxxxxxxx
curl -S -o /dev/null ${CurlArgs} -X POST "$MatrixServer/_matrix/client/r0/rooms/$RoomId/send/m.room.message?access_token=$AccessToken" -H 'Content-Type: application/json' -d "$MsgBody" curl -S -o /dev/null ${CurlArgs} -X POST "$MatrixServer/_matrix/client/r0/rooms/$RoomId/send/m.room.message?access_token=$AccessToken" -H 'Content-Type: application/json' -d "$MsgBody"

View File

@@ -15,14 +15,12 @@ calibre https://github.com/linuxserver/docker-calibre/releases
calibre-web https://github.com/linuxserver/docker-calibre-web/releases calibre-web https://github.com/linuxserver/docker-calibre-web/releases
cleanuperr https://github.com/flmorg/cleanuperr/releases cleanuperr https://github.com/flmorg/cleanuperr/releases
cross-seed https://github.com/cross-seed/cross-seed/releases cross-seed https://github.com/cross-seed/cross-seed/releases
crowdsec https://github.com/crowdsecurity/crowdsec/releases
cup https://github.com/sergi0g/cup/releases cup https://github.com/sergi0g/cup/releases
dockge https://github.com/louislam/dockge/releases dockge https://github.com/louislam/dockge/releases
dozzle https://github.com/amir20/dozzle/releases dozzle https://github.com/amir20/dozzle/releases
flatnotes https://github.com/dullage/flatnotes/releases flatnotes https://github.com/dullage/flatnotes/releases
forgejo https://codeberg.org/forgejo/forgejo/releases forgejo https://codeberg.org/forgejo/forgejo/releases
fressrss https://github.com/FreshRSS/FreshRSS/releases fressrss https://github.com/FreshRSS/FreshRSS/releases
gerbil https://github.com/fosrl/gerbil/releases
gluetun https://github.com/qdm12/gluetun/releases gluetun https://github.com/qdm12/gluetun/releases
go2rtc https://github.com/AlexxIT/go2rtc/releases go2rtc https://github.com/AlexxIT/go2rtc/releases
gotify https://github.com/gotify/server/releases gotify https://github.com/gotify/server/releases
@@ -47,11 +45,9 @@ mealie https://github.com/mealie-recipes/mealie/releases
meilisearch https://github.com/meilisearch/meilisearch/releases meilisearch https://github.com/meilisearch/meilisearch/releases
monica https://github.com/monicahq/monica/releases monica https://github.com/monicahq/monica/releases
mqtt https://github.com/eclipse/mosquitto/tags mqtt https://github.com/eclipse/mosquitto/tags
newt https://github.com/fosrl/newt/releases
nextcloud-aio-mastercontainer https://github.com/nextcloud/all-in-one/releases nextcloud-aio-mastercontainer https://github.com/nextcloud/all-in-one/releases
nginx https://github.com/docker-library/official-images/blob/master/library/nginx nginx https://github.com/docker-library/official-images/blob/master/library/nginx
owncast https://github.com/owncast/owncast/releases owncast https://github.com/owncast/owncast/releases
pangolin https://github.com/fosrl/pangolin/releases
prowlarr https://github.com/Prowlarr/Prowlarr/releases prowlarr https://github.com/Prowlarr/Prowlarr/releases
prowlarr-ls https://github.com/linuxserver/docker-prowlarr/releases prowlarr-ls https://github.com/linuxserver/docker-prowlarr/releases
qbittorrent https://www.qbittorrent.org/news qbittorrent https://www.qbittorrent.org/news
@@ -70,7 +66,6 @@ snappymail https://github.com/the-djmaze/snappymail/releases
sonarr https://github.com/Sonarr/Sonarr/releases/ sonarr https://github.com/Sonarr/Sonarr/releases/
sonarr-ls https://github.com/linuxserver/docker-sonarr/releases sonarr-ls https://github.com/linuxserver/docker-sonarr/releases
syncthing https://github.com/syncthing/syncthing/releases syncthing https://github.com/syncthing/syncthing/releases
tailscale https://github.com/tailscale/tailscale/releases
tautulli https://github.com/Tautulli/Tautulli/releases tautulli https://github.com/Tautulli/Tautulli/releases
thelounge https://github.com/thelounge/thelounge/releases thelounge https://github.com/thelounge/thelounge/releases
traefik https://github.com/traefik/traefik/releases traefik https://github.com/traefik/traefik/releases