mirror of
				https://github.com/kevinveenbirkenbach/homepage.veen.world.git
				synced 2025-11-04 01:18:09 +00:00 
			
		
		
		
	Solved some bugs
This commit is contained in:
		
							
								
								
									
										24
									
								
								app/app.py
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								app/app.py
									
									
									
									
									
								
							@@ -33,15 +33,29 @@ def load_config(app):
 | 
			
		||||
    app.config.update(resolver.get_config())
 | 
			
		||||
 | 
			
		||||
def cache_icons_and_logos(app):
 | 
			
		||||
    """Cache all icons and logos to local files."""
 | 
			
		||||
    """Cache all icons and logos to local files, mit Fallback auf source."""
 | 
			
		||||
    for card in app.config["cards"]:
 | 
			
		||||
        icon = card.get("icon", {})
 | 
			
		||||
        if icon.get("source"):
 | 
			
		||||
            icon["cache"] = cache_manager.cache_file(icon["source"])
 | 
			
		||||
            cached = cache_manager.cache_file(icon["source"])
 | 
			
		||||
            # Fallback: wenn cache_file None liefert, nutze weiterhin source
 | 
			
		||||
            icon["cache"] = cached or icon["source"]
 | 
			
		||||
 | 
			
		||||
    # Company-Logo
 | 
			
		||||
    company_logo = app.config["company"]["logo"]
 | 
			
		||||
    cached = cache_manager.cache_file(company_logo["source"])
 | 
			
		||||
    company_logo["cache"] = cached or company_logo["source"]
 | 
			
		||||
 | 
			
		||||
    # Platform Favicon
 | 
			
		||||
    favicon = app.config["platform"]["favicon"]
 | 
			
		||||
    cached = cache_manager.cache_file(favicon["source"])
 | 
			
		||||
    favicon["cache"] = cached or favicon["source"]
 | 
			
		||||
 | 
			
		||||
    # Platform Logo
 | 
			
		||||
    platform_logo = app.config["platform"]["logo"]
 | 
			
		||||
    cached = cache_manager.cache_file(platform_logo["source"])
 | 
			
		||||
    platform_logo["cache"] = cached or platform_logo["source"]
 | 
			
		||||
 | 
			
		||||
    app.config["company"]["logo"]["cache"] = cache_manager.cache_file(app.config["company"]["logo"]["source"])
 | 
			
		||||
    app.config["platform"]["favicon"]["cache"] = cache_manager.cache_file(app.config["platform"]["favicon"]["source"])
 | 
			
		||||
    app.config["platform"]["logo"]["cache"] = cache_manager.cache_file(app.config["platform"]["logo"]["source"])
 | 
			
		||||
 | 
			
		||||
# Initialize Flask app
 | 
			
		||||
app = Flask(__name__)
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,11 @@ services:
 | 
			
		||||
    build:
 | 
			
		||||
      context: .
 | 
			
		||||
      dockerfile: Dockerfile
 | 
			
		||||
    image: application-portfolio
 | 
			
		||||
    container_name: portfolio
 | 
			
		||||
    ports:
 | 
			
		||||
      - "${PORT:-5000}:${PORT:-5000}"
 | 
			
		||||
    env_file:
 | 
			
		||||
      - .env
 | 
			
		||||
    volumes:
 | 
			
		||||
      - ./app:/app
 | 
			
		||||
      - ./.env:/app./.env
 | 
			
		||||
    environment:
 | 
			
		||||
      - PORT=${PORT:-5000}
 | 
			
		||||
      - FLASK_ENV=${FLASK_ENV:-production}
 | 
			
		||||
    restart: unless-stopped
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user