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) <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-16 16:06:07 +00:00
parent dabf7966d1
commit 63db28d0ef

View File

@@ -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) {