Solved some bugs

This commit is contained in:
Kevin Veen-Birkenbach 2025-07-09 22:20:58 +02:00
parent 7bc0f32145
commit e18566d801
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
2 changed files with 21 additions and 10 deletions

View File

@ -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__)

View File

@ -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