From b2c4e73e4ae13e5185831054731a2697a8aaf1af Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Thu, 9 Jul 2026 03:31:01 +0800 Subject: [PATCH] fix(sidebar): drop :8443 port from all links, remove toPublicHttpsUrl --- dashboard/backend/config.py | 22 +++++----- .../frontend/src/components/Sidebar.svelte | 43 ++++++------------- 2 files changed, 23 insertions(+), 42 deletions(-) diff --git a/dashboard/backend/config.py b/dashboard/backend/config.py index 911e72c..28617ec 100644 --- a/dashboard/backend/config.py +++ b/dashboard/backend/config.py @@ -60,18 +60,18 @@ DASHBOARD_URL = os.environ.get("DASHBOARD_URL", "https://nas.jimmygan.com") # External service URLs (used by frontend sidebar) EXTERNAL_SERVICES = { - "navidrome": os.environ.get("NAVIDROME_URL", "https://music.jimmygan.com:8443"), - "jellyfin": os.environ.get("JELLYFIN_URL", "https://media.jimmygan.com:8443"), - "audiobookshelf": os.environ.get("AUDIOBOOKSHELF_URL", "https://books.jimmygan.com:8443"), - "immich": os.environ.get("IMMICH_URL", "https://photos.jimmygan.com:8443"), - "t_youtube": os.environ.get("T_YOUTUBE_URL", "https://yt.jimmygan.com:8443"), - "media_management": os.environ.get("MEDIA_MANAGEMENT_URL", "https://media.jimmygan.com:8443"), + "navidrome": os.environ.get("NAVIDROME_URL", "https://music.jimmygan.com"), + "jellyfin": os.environ.get("JELLYFIN_URL", "https://media.jimmygan.com"), + "audiobookshelf": os.environ.get("AUDIOBOOKSHELF_URL", "https://books.jimmygan.com"), + "immich": os.environ.get("IMMICH_URL", "https://photos.jimmygan.com"), + "t_youtube": os.environ.get("T_YOUTUBE_URL", "https://yt.jimmygan.com"), + "media_management": os.environ.get("MEDIA_MANAGEMENT_URL", "https://media.jimmygan.com"), "hermes": os.environ.get("HERMES_URL", "https://hermes-agent.nousresearch.com/docs"), - "gitea_web": os.environ.get("GITEA_WEB_URL", "https://git.jimmygan.com:8443"), - "stirling_pdf": os.environ.get("STIRLING_PDF_URL", "https://pdf.jimmygan.com:8443"), - "vaultwarden": os.environ.get("VAULTWARDEN_URL", "https://vault.jimmygan.com:8443"), - "n8n": os.environ.get("N8N_URL", "https://n8n.jimmygan.com:8443"), - "speedtest": os.environ.get("SPEEDTEST_URL", "https://speed.jimmygan.com:8443"), + "gitea_web": os.environ.get("GITEA_WEB_URL", "https://git.jimmygan.com"), + "stirling_pdf": os.environ.get("STIRLING_PDF_URL", "https://pdf.jimmygan.com"), + "vaultwarden": os.environ.get("VAULTWARDEN_URL", "https://vault.jimmygan.com"), + "n8n": os.environ.get("N8N_URL", "https://n8n.jimmygan.com"), + "speedtest": os.environ.get("SPEEDTEST_URL", "https://speed.jimmygan.com"), } # Network addresses (used by frontend for LAN/Tailscale direct access) diff --git a/dashboard/frontend/src/components/Sidebar.svelte b/dashboard/frontend/src/components/Sidebar.svelte index ae4053d..24c072e 100644 --- a/dashboard/frontend/src/components/Sidebar.svelte +++ b/dashboard/frontend/src/components/Sidebar.svelte @@ -44,12 +44,12 @@ } const defaultMedia = [ - { label: "Navidrome", remoteHref: "https://music.jimmygan.com:8443", icon: "music" }, - { label: "Jellyfin", remoteHref: "https://media.jimmygan.com:8443", icon: "play" }, - { label: "Audiobookshelf", remoteHref: "https://books.jimmygan.com:8443", icon: "headphones" }, - { label: "Immich", remoteHref: "https://photos.jimmygan.com:8443", icon: "image" }, - { label: "t-youtube", remoteHref: "https://yt.jimmygan.com:8443", icon: "youtube" }, - { label: "Media Management", remoteHref: "https://media.jimmygan.com:8443", icon: "wrench" }, + { label: "Navidrome", remoteHref: "https://music.jimmygan.com", icon: "music" }, + { label: "Jellyfin", remoteHref: "https://media.jimmygan.com", icon: "play" }, + { label: "Audiobookshelf", remoteHref: "https://books.jimmygan.com", icon: "headphones" }, + { label: "Immich", remoteHref: "https://photos.jimmygan.com", icon: "image" }, + { label: "t-youtube", remoteHref: "https://yt.jimmygan.com", icon: "youtube" }, + { label: "Media Management", remoteHref: "https://media.jimmygan.com", icon: "wrench" }, { id: "transmission", label: "Transmission", icon: "download" }, ]; @@ -58,11 +58,11 @@ { id: "chat-digest", label: "Chat Digest", icon: "chat" }, { id: "conversations", label: "Code Sessions", icon: "code" }, { id: "gitea", label: "Repos", icon: "git" }, - { label: "Gitea Web", remoteHref: "https://git.jimmygan.com:8443", icon: "git", external: true }, - { label: "Stirling PDF", remoteHref: "https://pdf.jimmygan.com:8443", icon: "pdf", external: true }, - { label: "Vaultwarden", remoteHref: "https://vault.jimmygan.com:8443", icon: "lock", external: true }, - { label: "n8n", remoteHref: "https://n8n.jimmygan.com:8443", icon: "n8n", external: true }, - { label: "Speedtest", remoteHref: "https://speed.jimmygan.com:8443", icon: "speedtest", external: true }, + { label: "Gitea Web", remoteHref: "https://git.jimmygan.com", icon: "git", external: true }, + { label: "Stirling PDF", remoteHref: "https://pdf.jimmygan.com", icon: "pdf", external: true }, + { label: "Vaultwarden", remoteHref: "https://vault.jimmygan.com", icon: "lock", external: true }, + { label: "n8n", remoteHref: "https://n8n.jimmygan.com", icon: "n8n", external: true }, + { label: "Speedtest", remoteHref: "https://speed.jimmygan.com", icon: "speedtest", external: true }, ]; const defaultTools2 = []; @@ -184,25 +184,6 @@ handleDragEnd(); } - function toPublicHttpsUrl(href) { - if (typeof window === "undefined") return href; - if (!href) return href; - - const isStandardHttps = location.protocol === "https:" && (!location.port || location.port === "443"); - if (!isStandardHttps) return href; - - try { - const url = new URL(href); - if (url.protocol === "https:" && url.port === "8443") { - url.port = ""; - return url.toString(); - } - return href; - } catch { - return href; - } - } - function extHref(svc) { // Look up service URL from fetched config by label (lowercased, underscored) const key = svc.label ? svc.label.toLowerCase().replace(/\s+/g, "_") : ""; @@ -210,7 +191,7 @@ const remoteHref = configUrl || svc.remoteHref; if (lanReachable && svc.port) return `http://${lanIp}:${svc.port}`; - if (remoteHref) return lanReachable ? remoteHref : toPublicHttpsUrl(remoteHref); + if (remoteHref) return remoteHref; if (svc.port) { const host = /^\d+\.\d+\.\d+\.\d+$/.test(location.hostname) ? location.hostname : tsIp; return `http://${host}:${svc.port}`;