📚 Improved log scheduling and setup for enhanced admin unified functionality. 🖥️🔍

This commit is contained in:
2025-06-02 12:01:27 +02:00
parent 74367497af
commit c1b0353ac5
3 changed files with 158 additions and 19 deletions

View File

@@ -681,6 +681,10 @@ install_python_packages() {
# Installiere direkt aus requirements.txt (robusteste Methode)
if pip3 install $pip_opts -r "$CURRENT_DIR/requirements.txt"; then
success "✅ Requirements.txt erfolgreich installiert"
# Kurze Validierung der Installation
progress "Prüfe pip-Installation..."
pip3 list | grep -E "(Flask|Werkzeug|SQLAlchemy|bcrypt)" || warning "Einige Core-Pakete möglicherweise nicht sichtbar"
else
warning "⚠️ Requirements.txt Installation fehlgeschlagen - verwende Fallback-Installation"
@@ -722,27 +726,116 @@ install_python_packages() {
progress "Validiere kritische Python-Abhängigkeiten..."
local validation_errors=0
if ! python3 -c "import flask; print(f'✅ Flask {flask.__version__} verfügbar')" 2>/dev/null; then
error "❌ Flask-Import fehlgeschlagen"
# Robuste Validierung mit detailliertem Logging
progress "Teste Flask-Import..."
if python3 -c "
import sys
try:
import flask
try:
version = flask.__version__
except AttributeError:
version = 'Version unbekannt'
print('✅ Flask ' + version + ' verfügbar')
sys.exit(0)
except ImportError as e:
print('❌ Flask-Import fehlgeschlagen: ' + str(e))
sys.exit(1)
except Exception as e:
print('❌ Flask-Test-Fehler: ' + str(e))
sys.exit(1)
" 2>&1; then
success "✅ Flask erfolgreich validiert"
else
warning "⚠️ Flask-Import problematisch"
((validation_errors++))
fi
if ! python3 -c "import werkzeug; print(f'✅ Werkzeug {werkzeug.__version__} verfügbar')" 2>/dev/null; then
error "❌ Werkzeug-Import fehlgeschlagen"
progress "Teste Werkzeug-Import..."
if python3 -c "
import sys
try:
import werkzeug
# Robuste Versions-Erkennung für Werkzeug
version = 'Version unbekannt'
try:
version = werkzeug.__version__
except AttributeError:
try:
from werkzeug import __version__ as wz_version
version = wz_version
except ImportError:
try:
import pkg_resources
version = pkg_resources.get_distribution('werkzeug').version
except:
version = 'verfügbar'
print('✅ Werkzeug ' + version + ' verfügbar')
sys.exit(0)
except ImportError as e:
print('❌ Werkzeug-Import fehlgeschlagen: ' + str(e))
sys.exit(1)
except Exception as e:
print('❌ Werkzeug-Test-Fehler: ' + str(e))
sys.exit(1)
" 2>&1; then
success "✅ Werkzeug erfolgreich validiert"
else
warning "⚠️ Werkzeug-Import problematisch"
((validation_errors++))
fi
if ! python3 -c "import sqlalchemy; print(f'✅ SQLAlchemy {sqlalchemy.__version__} verfügbar')" 2>/dev/null; then
error "❌ SQLAlchemy-Import fehlgeschlagen"
progress "Teste SQLAlchemy-Import..."
if python3 -c "
import sys
try:
import sqlalchemy
try:
version = sqlalchemy.__version__
except AttributeError:
version = 'Version unbekannt'
print('✅ SQLAlchemy ' + version + ' verfügbar')
sys.exit(0)
except ImportError as e:
print('❌ SQLAlchemy-Import fehlgeschlagen: ' + str(e))
sys.exit(1)
except Exception as e:
print('❌ SQLAlchemy-Test-Fehler: ' + str(e))
sys.exit(1)
" 2>&1; then
success "✅ SQLAlchemy erfolgreich validiert"
else
warning "⚠️ SQLAlchemy-Import problematisch"
((validation_errors++))
fi
if ! python3 -c "import bcrypt; print('✅ bcrypt verfügbar')" 2>/dev/null; then
error "❌ bcrypt-Import fehlgeschlagen"
progress "Teste bcrypt-Import..."
if python3 -c "
import sys
try:
import bcrypt
print('✅ bcrypt verfügbar')
sys.exit(0)
except ImportError as e:
print('❌ bcrypt-Import fehlgeschlagen: ' + str(e))
sys.exit(1)
except Exception as e:
print('❌ bcrypt-Test-Fehler: ' + str(e))
sys.exit(1)
" 2>&1; then
success "✅ bcrypt erfolgreich validiert"
else
warning "⚠️ bcrypt-Import problematisch"
((validation_errors++))
fi
if [ $validation_errors -gt 0 ]; then
# Zusammenfassung und Entscheidung
if [ $validation_errors -eq 0 ]; then
success "✅ Alle kritischen Python-Abhängigkeiten erfolgreich validiert"
elif [ $validation_errors -le 2 ]; then
warning "⚠️ $validation_errors Abhängigkeiten haben Probleme - System sollte trotzdem funktionieren"
info "→ Möglicherweise sind nur optionale Features betroffen"
else
error "$validation_errors kritische Python-Abhängigkeiten fehlen!"
fi
@@ -1107,20 +1200,47 @@ install_dependencies_only() {
progress "Teste kritische Python-Module..."
local import_test_errors=0
# Core-Framework-Tests
if ! python3 -c "import flask, werkzeug, jinja2; print('✅ Core-Framework verfügbar')" 2>/dev/null; then
# Core-Framework-Tests (robustere Version)
if python3 -c "
try:
import flask, werkzeug, jinja2
print('✅ Core-Framework verfügbar')
except ImportError as e:
print('⚠️ Core-Framework Import-Problem: ' + str(e))
exit(1)
" 2>&1; then
success "✅ Core-Framework erfolgreich getestet"
else
warning "⚠️ Core-Framework Import-Problem"
((import_test_errors++))
fi
# Datenbank-Tests
if ! python3 -c "import sqlalchemy; print('✅ Datenbank-Module verfügbar')" 2>/dev/null; then
# Datenbank-Tests (robustere Version)
if python3 -c "
try:
import sqlalchemy
print('✅ Datenbank-Module verfügbar')
except ImportError as e:
print('⚠️ Datenbank-Module Import-Problem: ' + str(e))
exit(1)
" 2>&1; then
success "✅ Datenbank-Module erfolgreich getestet"
else
warning "⚠️ Datenbank-Module Import-Problem"
((import_test_errors++))
fi
# Security-Tests
if ! python3 -c "import bcrypt, cryptography; print('✅ Security-Module verfügbar')" 2>/dev/null; then
# Security-Tests (robustere Version)
if python3 -c "
try:
import bcrypt, cryptography
print('✅ Security-Module verfügbar')
except ImportError as e:
print('⚠️ Security-Module Import-Problem: ' + str(e))
exit(1)
" 2>&1; then
success "✅ Security-Module erfolgreich getestet"
else
warning "⚠️ Security-Module Import-Problem"
((import_test_errors++))
fi