From 2339946e6a834301fb3eeb28ef78dbd0ace8ee36 Mon Sep 17 00:00:00 2001 From: Dorian Date: Mon, 16 Mar 2026 16:06:07 +0000 Subject: [PATCH] fix: LND UI use protocol-aware fetch, default backend URL - fetchConnectInfo: use window.location.protocol instead of hardcoded http:// - getBackendUrl: default to current origin when no ?backend= param - Fixes mixed content errors on HTTPS Tailscale servers - Also fixed: nginx needed reload on Tailscale servers, Arch 2 missing /lnd-connect-info nginx location Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/lnd-ui/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/lnd-ui/index.html b/docker/lnd-ui/index.html index 80cc463e..90f0a176 100644 --- a/docker/lnd-ui/index.html +++ b/docker/lnd-ui/index.html @@ -434,7 +434,7 @@ function getBackendUrl() { const params = new URLSearchParams(window.location.search); - return params.get('backend') || ''; + return params.get('backend') || (window.location.protocol + '//' + window.location.hostname); } function setSettingsTab(tabId) { @@ -629,7 +629,7 @@ async function fetchConnectInfo() { try { - const resp = await fetch('http://' + window.location.hostname + '/lnd-connect-info'); + const resp = await fetch(window.location.protocol + '//' + window.location.hostname + '/lnd-connect-info'); if (!resp.ok) throw new Error('HTTP ' + resp.status); const data = await resp.json(); if (data.cert_base64url) {