From 8e52e2bf7444d181927e284839d0e949b900c2b7 Mon Sep 17 00:00:00 2001 From: hzhang Date: Sun, 17 May 2026 22:39:58 +0100 Subject: [PATCH] feat(ui): overridable favicon/logo with branded default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the ⚓ emoji with a real logo image used as the in-app brand mark and the favicon. Default bundled public/logo.svg is the HangmanLab mark recolored to the Foundry-Deck ember (#ff6a1a). Override at deploy time via HARBORFORGE_LOGO_URL (injected into runtime-config.js; getLogoUrl() + favicon swap), no rebuild needed. Co-Authored-By: Claude Opus 4.7 (1M context) --- Dockerfile | 6 ++++- index.html | 9 ++++++- public/logo.svg | 44 ++++++++++++++++++++++++++++++++++ src/components/Sidebar.tsx | 3 ++- src/index.css | 7 +++++- src/pages/LoginPage.tsx | 3 ++- src/pages/OidcCallbackPage.tsx | 3 ++- src/pages/SetupWizardPage.tsx | 4 ++-- src/runtime.ts | 9 ++++++- 9 files changed, 79 insertions(+), 9 deletions(-) create mode 100644 public/logo.svg diff --git a/Dockerfile b/Dockerfile index eb3e7aa..0b10370 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,10 +17,14 @@ ENV FRONTEND_DEV_MODE=0 # exists; /auth/config remains authoritative once the backend is up. ARG HARBORFORGE_OIDC_ONLY=false ENV HARBORFORGE_OIDC_ONLY=${HARBORFORGE_OIDC_ONLY} +# Optional deploy-time branding override: a URL the SPA uses for the +# logo + favicon. Empty → bundled /logo.svg default. +ARG HARBORFORGE_LOGO_URL= +ENV HARBORFORGE_LOGO_URL=${HARBORFORGE_LOGO_URL} EXPOSE 3000 CMD ["sh", "-c", "\ if [ \"$HARBORFORGE_OIDC_ONLY\" = \"true\" ]; then OO=true; else OO=false; fi; \ - CFG=\"window.__HF_RUNTIME__={\\\"oidc_only\\\":$OO};\"; \ + CFG=\"window.__HF_RUNTIME__={\\\"oidc_only\\\":$OO,\\\"logo_url\\\":\\\"$HARBORFORGE_LOGO_URL\\\"};\"; \ mkdir -p public; printf '%s' \"$CFG\" > public/runtime-config.js; \ [ -d dist ] && printf '%s' \"$CFG\" > dist/runtime-config.js; \ if [ \"$FRONTEND_DEV_MODE\" = \"1\" ]; then npm run dev -- --host 0.0.0.0 --port 3000 --strictPort; else serve -s dist -l 3000; fi"] diff --git a/index.html b/index.html index de538cb..5896e66 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + HarborForge @@ -11,6 +11,13 @@ + diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..9298035 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 70fb676..8d995aa 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -2,6 +2,7 @@ import { useState, useEffect } from 'react' import { Link, useLocation, useNavigate } from 'react-router-dom' import api from '@/services/api' import { useAuthConfig, oidcLinkHref } from '@/hooks/useAuthConfig' +import { getLogoUrl } from '@/runtime' import type { User } from '@/types' interface Props { @@ -50,7 +51,7 @@ export default function Sidebar({ user, onLogout }: Props) { return (