🎉 Improved backend structure & cleaned up files (#123) - Added start scripts for development & production environments. 🛠️ Removed unnecessary database files. 📚 Refactored logging system for better performance & organization. 💄 Fixed minor typo in app.log file.
This commit is contained in:
@ -6,6 +6,10 @@ MYP (Mercedes-Benz Your Printer) System - Air-Gapped Production Environment
|
||||
Dieses Skript startet das System im Production-Modus mit allen
|
||||
erforderlichen Sicherheits- und Performance-Optimierungen.
|
||||
|
||||
Verfügbare Modi:
|
||||
- production: Mercedes-Benz TBA Air-Gapped (optimiert + sicher)
|
||||
- development: Lokale Entwicklung (debug + flexibel)
|
||||
|
||||
Verwendung:
|
||||
python start_production.py
|
||||
|
||||
@ -45,11 +49,12 @@ def print_production_banner():
|
||||
{'='*80}
|
||||
|
||||
🚀 Environment: Production Air-Gapped
|
||||
🔒 Security: Maximum (SSL + Security Headers)
|
||||
🔒 Security: Maximum (SSL + Security Headers + CSRF)
|
||||
🌐 Network: Air-Gapped (Offline-Mode)
|
||||
⚡ Performance: Optimized for Industrial Environment
|
||||
📊 Monitoring: Enabled
|
||||
🔍 Audit-Logging: Enabled
|
||||
⚡ Performance: Fully Optimized (Cache + Minified Assets)
|
||||
📊 Monitoring: Production-Grade Health Checks
|
||||
🔍 Audit-Logging: Mercedes-Benz Compliance Mode
|
||||
🎯 Modi: Nur Production + Development (konsolidiert)
|
||||
📅 Start-Zeit: {datetime.now().strftime('%d.%m.%Y %H:%M:%S')}
|
||||
|
||||
{'='*80}
|
||||
@ -82,6 +87,15 @@ def check_production_requirements():
|
||||
else:
|
||||
requirements.append(f"❌ {file} fehlt")
|
||||
|
||||
# Konsolidierte Modi-Konfiguration prüfen
|
||||
try:
|
||||
from app import ProductionConfig, DevelopmentConfig
|
||||
requirements.append("✅ Konsolidierte Modi-Konfiguration verfügbar")
|
||||
requirements.append(f" • ProductionConfig: Optimiert + Sicher")
|
||||
requirements.append(f" • DevelopmentConfig: Debug + Flexibel")
|
||||
except ImportError as e:
|
||||
requirements.append(f"❌ Modi-Konfiguration fehlt: {e}")
|
||||
|
||||
# SSL-Zertifikate prüfen (optional)
|
||||
ssl_files = [
|
||||
'ssl/server.crt',
|
||||
@ -131,9 +145,15 @@ def set_production_optimizations():
|
||||
os.environ['SQLITE_SYNCHRONOUS'] = 'NORMAL'
|
||||
os.environ['SQLITE_CACHE_SIZE'] = '10000'
|
||||
|
||||
# Asset-Optimierungen (konsolidiert)
|
||||
os.environ['USE_MINIFIED_ASSETS'] = 'true'
|
||||
os.environ['DISABLE_ANIMATIONS'] = 'true'
|
||||
os.environ['LIMIT_GLASSMORPHISM'] = 'true'
|
||||
|
||||
print(" ✅ Memory-Optimierungen aktiviert")
|
||||
print(" ✅ Flask-Optimierungen aktiviert")
|
||||
print(" ✅ Datenbank-Optimierungen aktiviert")
|
||||
print(" ✅ Asset-Optimierungen aktiviert (konsolidiert)")
|
||||
print()
|
||||
|
||||
def setup_security():
|
||||
@ -152,14 +172,19 @@ def setup_security():
|
||||
# CSRF-Schutz
|
||||
os.environ['CSRF_TIME_LIMIT'] = '3600'
|
||||
|
||||
# Mercedes-Benz Compliance
|
||||
os.environ['COMPLIANCE_MODE'] = 'true'
|
||||
os.environ['AUDIT_LOGGING'] = 'true'
|
||||
|
||||
print(" ✅ Security Headers konfiguriert")
|
||||
print(" ✅ Session-Sicherheit aktiviert")
|
||||
print(" ✅ CSRF-Schutz aktiviert")
|
||||
print(" ✅ Mercedes-Benz Compliance aktiviert")
|
||||
print()
|
||||
|
||||
def start_application():
|
||||
"""Startet die Hauptanwendung"""
|
||||
print("🚀 Starte MYP Production System...\n")
|
||||
print("🚀 Starte MYP Production System (Konsolidierte Modi)...\n")
|
||||
|
||||
try:
|
||||
# app.py importieren und starten
|
||||
|
Reference in New Issue
Block a user