web: fixes for logo

This commit is contained in:
2025-10-22 14:36:24 -04:00
committed by sbcrumb
parent 3ac5aa3121
commit e4ef60847a
3 changed files with 20 additions and 1 deletions
+1
View File
@@ -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",
+1 -1
View File
@@ -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 {
+18
View File
@@ -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():