71 lines
2.1 KiB
Bash
Executable File
71 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
echo "🔗 Storage Link Problem lösen"
|
|
echo "============================"
|
|
|
|
# 1. Aktuellen Storage-Status prüfen
|
|
echo "🔍 Aktueller Storage-Status:"
|
|
ls -la public/storage
|
|
echo ""
|
|
|
|
# 2. Storage-Verzeichnis entfernen (falls es ein Verzeichnis ist)
|
|
echo "🗑️ Entferne falsches Storage-Verzeichnis..."
|
|
if [ -d "public/storage" ]; then
|
|
rm -rf public/storage
|
|
echo "✅ Storage-Verzeichnis entfernt"
|
|
elif [ -L "public/storage" ]; then
|
|
rm public/storage
|
|
echo "✅ Storage-Link entfernt"
|
|
fi
|
|
|
|
# 3. Storage Link neu erstellen
|
|
echo "🔗 Erstelle Storage Link neu..."
|
|
php artisan storage:link
|
|
|
|
# 4. Link prüfen
|
|
echo "🔍 Prüfe neuen Storage Link:"
|
|
ls -la public/storage
|
|
echo ""
|
|
|
|
# 5. Ziel-Verzeichnis prüfen
|
|
echo "📁 Prüfe Ziel-Verzeichnis:"
|
|
ls -la storage/app/public/
|
|
echo ""
|
|
|
|
# 6. Bilder-Verzeichnis prüfen
|
|
echo "🖼️ Prüfe Bilder-Verzeichnis:"
|
|
ls -la storage/app/public/nail_polishes/ 2>/dev/null || echo "⚠️ nail_polishes Verzeichnis nicht gefunden"
|
|
|
|
# 7. Test-Bild erstellen
|
|
echo "🧪 Erstelle Test-Bild..."
|
|
mkdir -p storage/app/public/nail_polishes
|
|
echo "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==" | base64 -d > storage/app/public/nail_polishes/test.jpg
|
|
chmod 644 storage/app/public/nail_polishes/test.jpg
|
|
|
|
# 8. Berechtigungen setzen
|
|
echo "🔐 Setze Berechtigungen..."
|
|
chmod -R 755 public/storage/
|
|
chmod -R 777 storage/app/public/
|
|
|
|
# 9. Test-URL
|
|
echo "🧪 Teste Bild-URL..."
|
|
curl -I https://neonail.vogt.de.com/storage/nail_polishes/test.jpg
|
|
|
|
# 10. Echte Bilder testen
|
|
echo "🖼️ Teste echte Bilder..."
|
|
sqlite3 database.sqlite "SELECT image_path FROM nail_polishes WHERE image_path IS NOT NULL LIMIT 1;" | while read image_path; do
|
|
if [ ! -z "$image_path" ]; then
|
|
echo "Teste: $image_path"
|
|
if [ -f "storage/app/public/$image_path" ]; then
|
|
echo "✅ Bild existiert: $image_path"
|
|
curl -I "https://neonail.vogt.de.com/storage/$image_path"
|
|
else
|
|
echo "❌ Bild fehlt: $image_path"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "✅ Storage Link Problem behoben!"
|
|
echo "📋 Testen Sie: https://neonail.vogt.de.com"
|