From 22cf6223e31e4e38d25caee14050faa98959dc88 Mon Sep 17 00:00:00 2001 From: pi-farm Date: Fri, 6 Feb 2026 21:43:15 +0100 Subject: [PATCH] add handling for non-docker-images --- docker-compose.yml | 2 +- multi-watch.sh | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index da9d0fb..bea752f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ services: image: git.pi-farm.de/pi-farm/multi-watch:1.0 container_name: multi-watch volumes: - - $(pwd)/config:/config + - ./config:/config - /etc/localtime:/etc/localtime:ro restart: unless-stopped diff --git a/multi-watch.sh b/multi-watch.sh index 5e5a15c..69d4938 100644 --- a/multi-watch.sh +++ b/multi-watch.sh @@ -44,7 +44,20 @@ EOF NEW_VAL="" if [ "$TYPE" == "DOCKER" ]; then - NEW_VAL=$(curl -s "https://hub.docker.com/v2/repositories/${REPO}/tags/${EXTRA}" | jq -r '.last_updated // empty') + if [[ "$REPO" == *"."* && "$REPO" == *"/"* ]]; then + # FALL: Eigene Registry (z.B. git.pi-farm.de) + # Wir versuchen hier den Docker-Standard-Weg über die Manifest-Config + # Hinweis: Das funktioniert ohne Auth nur bei öffentlichen Repos! + REGISTRY_HOST=$(echo $REPO | cut -d/ -f1) + IMAGE_NAME=$(echo $REPO | cut -d/ -f2-) + + # Hole das Digest (eindeutiger Hash) des Images + NEW_VAL=$(curl -s -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + "https://${REGISTRY_HOST}/v2/${IMAGE_NAME}/manifests/${EXTRA}" | jq -r '.config.digest // empty') + else + # FALL: Normaler Docker Hub + NEW_VAL=$(curl -s "https://hub.docker.com/v2/repositories/${REPO}/tags/${EXTRA}" | jq -r '.last_updated // empty') + fi elif [ "$TYPE" == "GITHUB" ]; then NEW_VAL=$(curl -s "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty') fi