From 9397f115e3f0b068ff3bd1ae7868645f0b85e85c Mon Sep 17 00:00:00 2001 From: SBCrumb Date: Wed, 22 Oct 2025 14:36:24 -0400 Subject: [PATCH] web: fixes for logo --- api/auth.py | 1 + nfoguard-web/static/css/styles.css | 2 +- start_web.py | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/api/auth.py b/api/auth.py index 2198d5d..e65a037 100644 --- a/api/auth.py +++ b/api/auth.py @@ -93,6 +93,7 @@ class SimpleAuthMiddleware(BaseHTTPMiddleware): "/webhook/", "/health", "/logo/", # Logo files should always be accessible + "/favicon.ico", # Favicon should always be accessible "/ping", "/api/v1/health", "/api/v1/metrics", diff --git a/nfoguard-web/static/css/styles.css b/nfoguard-web/static/css/styles.css index c29d650..4003573 100644 --- a/nfoguard-web/static/css/styles.css +++ b/nfoguard-web/static/css/styles.css @@ -60,7 +60,7 @@ body { .header-logo .logo { height: 60px; width: auto; - filter: brightness(0) invert(1); /* Make logo white */ + /* filter: brightness(0) invert(1); */ /* Make logo white - temporarily disabled for testing */ } .header-text { diff --git a/start_web.py b/start_web.py index 6b527c1..7e97111 100644 --- a/start_web.py +++ b/start_web.py @@ -64,6 +64,24 @@ def setup_static_files(app: FastAPI) -> None: return FileResponse(index_file) else: return {"message": "NFOGuard Web Interface", "status": "running"} + + # Serve favicon + @app.get("/favicon.ico") + async def serve_favicon(): + # Try to serve favicon from logo directory or static files + favicon_paths = [ + os.path.join(logo_path, "favicon.ico"), + os.path.join(static_path, "favicon.ico"), + os.path.join(logo_path, "NFOguardLogoPlain.png") # Fallback to logo + ] + + for favicon_path in favicon_paths: + if os.path.exists(favicon_path): + return FileResponse(favicon_path) + + # Return 204 No Content if no favicon found + from fastapi import Response + return Response(status_code=204) def main():