From e06a6942ff69622e876cd479a1ee7df50b009867 Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Fri, 31 Oct 2025 18:01:23 +0100 Subject: [PATCH] Fix: Verbesserter Registry-Login mit detailliertem Debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bessere Host-IP-Erkennung mit Fallbacks - Detaillierte HTTP-Status-Code-Ausgabe - 401 wird als erfolgreiche Erreichbarkeit gewertet (Auth erforderlich) - Debug-Output für Login-Versuche - DEPLOYMENT_HOST:5000 als erste Option --- .gitea/workflows/production-deploy.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/production-deploy.yml b/.gitea/workflows/production-deploy.yml index c0d8f16a..e61fb2c2 100644 --- a/.gitea/workflows/production-deploy.yml +++ b/.gitea/workflows/production-deploy.yml @@ -224,21 +224,32 @@ jobs: echo "" echo "🔍 Teste Registry: $TEST_URL" - # Wenn URL bereits Port enthält, teste direkt + # Wenn URL bereits Port enthält, teste direkt (HTTP) if [[ "$TEST_URL" == *":5000" ]]; then # Direkter HTTP-Zugriff (Port bereits in URL) - if curl -s -f -o /dev/null "http://$TEST_URL/v2/" 2>/dev/null; then - echo "✅ Registry erreichbar über HTTP: http://$TEST_URL" + echo " Versuche HTTP-Zugriff auf http://$TEST_URL/v2/" + HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "http://$TEST_URL/v2/" 2>&1 || echo "000") + echo " HTTP-Status: $HTTP_CODE" + + # 401 bedeutet Registry ist erreichbar, aber Auth erforderlich (das ist gut!) + if [ "$HTTP_CODE" = "401" ] || [ "$HTTP_CODE" = "200" ]; then + echo "✅ Registry erreichbar über HTTP: http://$TEST_URL (Status: $HTTP_CODE)" # Versuche Login mit HTTP (ohne :5000 nochmal hinzuzufügen) - if echo "$REGISTRY_PASSWORD" | docker login "$TEST_URL" -u "$REGISTRY_USER" --password-stdin 2>&1; then + LOGIN_OUTPUT=$(echo "$REGISTRY_PASSWORD" | docker login "$TEST_URL" -u "$REGISTRY_USER" --password-stdin 2>&1) + LOGIN_EXIT_CODE=$? + echo " Login-Output: $LOGIN_OUTPUT" + + if [ $LOGIN_EXIT_CODE -eq 0 ]; then echo "✅ Erfolgreich bei Registry angemeldet: $TEST_URL" REGISTRY_URL="$TEST_URL" LOGIN_SUCCESS=true break else - echo "⚠️ Login fehlgeschlagen für $TEST_URL, versuche nächste URL..." + echo "⚠️ Login fehlgeschlagen für $TEST_URL (Exit Code: $LOGIN_EXIT_CODE), versuche nächste URL..." fi + else + echo "⚠️ Registry nicht erreichbar: http://$TEST_URL (Status: $HTTP_CODE)" fi else # Teste HTTPS zuerst