feat: bitcoin-ui CSS fix, HTTPS proxy support, deploy script improvements
Bitcoin UI: - Replace cdn.tailwindcss.com with locally bundled tailwind.css (CSP blocks external scripts) - Make all asset paths relative for nginx proxy compatibility - Add bitcoin-ui build/deploy to deploy-to-target.sh (was missing entirely) - Use --network host (bitcoin-ui proxies Bitcoin RPC at 127.0.0.1:8332) HTTPS mixed content fix: - Add HTTPS_PROXY_PATHS in AppSession.vue — when parent page is HTTPS, iframe loads through nginx proxy instead of direct HTTP port - Prevents browser blocking HTTP iframes inside HTTPS pages - All Tailscale servers use HTTPS, this was breaking all app iframes Deploy & first-boot improvements: - first-boot-containers.sh auto-detects disk size for pruning vs txindex - first-boot-containers.sh checks fallback source path for UI containers - Added mempool-electrs to APP_PORTS mapping - ElectrumX container creation in first-boot - Podman doctor/fix/uptime skills added Also includes: session persistence, identity management, LND transactions, ElectrumX status UI, nostr-provider improvements, Web5 enhancements Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4e54b8bd4d
commit
367b483a72
@@ -1,6 +1,7 @@
|
||||
FROM docker.io/library/nginx:alpine
|
||||
|
||||
COPY index.html /usr/share/nginx/html/
|
||||
COPY qrcode.js /usr/share/nginx/html/
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
RUN mkdir -p /usr/share/nginx/html/assets/img
|
||||
|
||||
+252
-21
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||
<title>Electrs - Archipelago</title>
|
||||
<title>ElectrumX - Archipelago</title>
|
||||
<style>
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; min-height: 100vh; color: white; overflow-x: hidden; }
|
||||
@@ -69,6 +69,28 @@
|
||||
.md-flex-row { flex-direction: row; }
|
||||
.md-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
|
||||
}
|
||||
|
||||
/* Connection details */
|
||||
.conn-tabs { display: flex; background: rgba(255,255,255,0.08); border-radius: 0.5rem; overflow: hidden; margin-bottom: 1.5rem; }
|
||||
.conn-tab { flex: 1; padding: 0.625rem 1rem; text-align: center; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; color: rgba(255,255,255,0.5); border: none; background: none; }
|
||||
.conn-tab.active { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
|
||||
.conn-tab:hover:not(.active) { color: rgba(255,255,255,0.8); }
|
||||
.conn-layout { display: flex; flex-direction: column; gap: 1.5rem; }
|
||||
@media (min-width: 640px) { .conn-layout { flex-direction: row; } }
|
||||
.qr-box { flex-shrink: 0; width: 196px; background: white; border-radius: 0.75rem; padding: 0.75rem; display: flex; align-items: center; justify-content: center; }
|
||||
.qr-box img { width: 100%; height: auto; display: block; image-rendering: pixelated; }
|
||||
.conn-fields { flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }
|
||||
.field-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.45); margin-bottom: 0.25rem; }
|
||||
.field-row { display: flex; align-items: center; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 0.5rem; overflow: hidden; }
|
||||
.field-value { flex: 1; padding: 0.625rem 0.875rem; font-family: monospace; font-size: 0.9375rem; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.copy-btn { padding: 0.625rem 0.75rem; background: none; border: none; border-left: 1px solid rgba(255,255,255,0.1); cursor: pointer; color: rgba(255,255,255,0.4); transition: all 0.2s ease; display: flex; align-items: center; }
|
||||
.copy-btn:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.05); }
|
||||
.copy-btn.copied { color: #4ade80; }
|
||||
.field-row-split { display: flex; gap: 0.75rem; }
|
||||
.field-row-split > div { flex: 1; }
|
||||
.conn-disabled { text-align: center; padding: 2rem 1rem; }
|
||||
.help-text { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.875rem; color: rgba(255,255,255,0.5); line-height: 1.5; }
|
||||
.version-text { font-size: 0.75rem; color: rgba(255,255,255,0.4); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -76,6 +98,7 @@
|
||||
<div class="overlay"></div>
|
||||
|
||||
<div class="container">
|
||||
<!-- Header -->
|
||||
<div class="glass-card p-6 mb-6">
|
||||
<div class="flex flex-col md-flex-row items-center gap-4">
|
||||
<div class="icon-box flex-shrink-0">
|
||||
@@ -84,8 +107,11 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div class="flex-1">
|
||||
<h1 class="text-2xl font-bold text-white">Electrs</h1>
|
||||
<p class="text-white-70">Bitcoin Electrum indexer for Mempool & Electrum clients</p>
|
||||
<div class="flex items-center gap-3">
|
||||
<h1 class="text-2xl font-bold text-white">ElectrumX</h1>
|
||||
<span class="version-text">v1.18.0</span>
|
||||
</div>
|
||||
<p class="text-white-70">Bitcoin Electrum server for wallet connections</p>
|
||||
</div>
|
||||
<div class="info-card flex items-center gap-3">
|
||||
<div id="statusDot" class="status-dot bg-yellow"></div>
|
||||
@@ -97,7 +123,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="glass-card p-6">
|
||||
<!-- Sync Status -->
|
||||
<div class="glass-card p-6 mb-6">
|
||||
<div class="flex items-start gap-4 mb-4">
|
||||
<div class="icon-box-sm flex-shrink-0">
|
||||
<svg id="syncIcon" style="width:1.5rem;height:1.5rem;color:#f97316" class="animate-spin-slow" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
@@ -139,17 +166,215 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Connection Details -->
|
||||
<div class="glass-card p-6">
|
||||
<h2 class="text-xl font-semibold text-white mb-1">Connect Your Wallet</h2>
|
||||
<p class="text-white-70 text-sm mb-4" id="connSubtitle">Use the following details to connect your wallet or application to ElectrumX.</p>
|
||||
|
||||
<div class="conn-tabs">
|
||||
<button class="conn-tab active" id="tabLocal" onclick="switchTab('local')">Local Network</button>
|
||||
<button class="conn-tab" id="tabTor" onclick="switchTab('tor')">Tor</button>
|
||||
</div>
|
||||
|
||||
<!-- Local Network Tab -->
|
||||
<div id="panelLocal" class="conn-layout">
|
||||
<div class="qr-box" id="qrLocalBox"></div>
|
||||
<div class="conn-fields">
|
||||
<div>
|
||||
<div class="field-label">Address</div>
|
||||
<div class="field-row">
|
||||
<span class="field-value" id="localAddress">-</span>
|
||||
<button class="copy-btn" onclick="copyField('localAddress', this)" title="Copy">
|
||||
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke-width="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke-width="2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-row-split">
|
||||
<div>
|
||||
<div class="field-label">Port</div>
|
||||
<div class="field-row">
|
||||
<span class="field-value">50001</span>
|
||||
<button class="copy-btn" onclick="copyText('50001', this)" title="Copy">
|
||||
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke-width="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke-width="2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="field-label">SSL</div>
|
||||
<div class="field-row">
|
||||
<span class="field-value">Disabled</span>
|
||||
<button class="copy-btn" onclick="copyText('Disabled', this)" title="Copy">
|
||||
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke-width="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke-width="2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tor Tab -->
|
||||
<div id="panelTor" style="display:none">
|
||||
<div id="torAvailable" class="conn-layout" style="display:none">
|
||||
<div class="qr-box" id="qrTorBox"></div>
|
||||
<div class="conn-fields">
|
||||
<div>
|
||||
<div class="field-label">Onion Address</div>
|
||||
<div class="field-row">
|
||||
<span class="field-value" id="torAddress" style="font-size:0.75rem">-</span>
|
||||
<button class="copy-btn" onclick="copyField('torAddress', this)" title="Copy">
|
||||
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke-width="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke-width="2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field-row-split">
|
||||
<div>
|
||||
<div class="field-label">Port</div>
|
||||
<div class="field-row">
|
||||
<span class="field-value">50001</span>
|
||||
<button class="copy-btn" onclick="copyText('50001', this)" title="Copy">
|
||||
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke-width="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke-width="2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="field-label">SSL</div>
|
||||
<div class="field-row">
|
||||
<span class="field-value">Disabled</span>
|
||||
<button class="copy-btn" onclick="copyText('Disabled', this)" title="Copy">
|
||||
<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke-width="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke-width="2"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="torUnavailable" class="conn-disabled">
|
||||
<svg style="width:2.5rem;height:2.5rem;color:rgba(255,255,255,0.25);margin:0 auto 0.75rem" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
|
||||
</svg>
|
||||
<p class="text-white-70" style="font-size:0.9375rem">Tor hidden service not configured for ElectrumX.</p>
|
||||
<p class="text-white-60 text-sm" style="margin-top:0.375rem">Enable Tor for ElectrumX in Settings to connect remotely.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="help-text">
|
||||
Connect using <strong style="color:rgba(255,255,255,0.8)">Sparrow Wallet</strong>, <strong style="color:rgba(255,255,255,0.8)">Electrum</strong>, or any Electrum-protocol compatible wallet. Set the server to the address and port shown above with SSL disabled.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="qrcode.js"></script>
|
||||
<script>
|
||||
var currentTab = 'local';
|
||||
var torOnion = null;
|
||||
|
||||
function renderQR(containerId, text) {
|
||||
var container = document.getElementById(containerId);
|
||||
if (!container) return;
|
||||
container.innerHTML = '';
|
||||
try {
|
||||
var qr = qrcode(0, 'M');
|
||||
qr.addData(text);
|
||||
qr.make();
|
||||
container.innerHTML = qr.createImgTag(5, 0);
|
||||
} catch(e) {
|
||||
container.innerHTML = '<div style="color:#999;font-size:12px;text-align:center;padding:2rem">QR unavailable</div>';
|
||||
}
|
||||
}
|
||||
|
||||
function switchTab(tab) {
|
||||
currentTab = tab;
|
||||
document.getElementById('tabLocal').classList.toggle('active', tab === 'local');
|
||||
document.getElementById('tabTor').classList.toggle('active', tab === 'tor');
|
||||
document.getElementById('panelLocal').style.display = tab === 'local' ? '' : 'none';
|
||||
document.getElementById('panelTor').style.display = tab === 'tor' ? '' : 'none';
|
||||
}
|
||||
|
||||
var COPY_SVG = '<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke-width="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke-width="2"/></svg>';
|
||||
var CHECK_SVG = '<svg width="16" height="16" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>';
|
||||
|
||||
function flashCopied(btn) {
|
||||
btn.classList.add('copied');
|
||||
var orig = btn.innerHTML;
|
||||
btn.innerHTML = CHECK_SVG;
|
||||
setTimeout(function() {
|
||||
btn.classList.remove('copied');
|
||||
btn.innerHTML = orig;
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
function copyField(id, btn) {
|
||||
var text = document.getElementById(id).textContent.trim();
|
||||
if (!text || text === '-') return;
|
||||
navigator.clipboard.writeText(text).then(function() { flashCopied(btn); });
|
||||
}
|
||||
|
||||
function copyText(text, btn) {
|
||||
navigator.clipboard.writeText(text).then(function() { flashCopied(btn); });
|
||||
}
|
||||
|
||||
function copyConnStr(type) {
|
||||
var id = type === 'tor' ? 'torConnStr' : 'localConnStr';
|
||||
var btn = type === 'tor' ? document.querySelector('#torAvailable .conn-string-copy') : document.getElementById('localCopyAll');
|
||||
var text = document.getElementById(id).textContent.trim();
|
||||
if (!text || text === '-') return;
|
||||
navigator.clipboard.writeText(text).then(function() {
|
||||
btn.classList.add('copied');
|
||||
var orig = btn.textContent;
|
||||
btn.textContent = 'Copied!';
|
||||
setTimeout(function() {
|
||||
btn.classList.remove('copied');
|
||||
btn.textContent = orig;
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
|
||||
function updateConnectionInfo() {
|
||||
var host = window.location.hostname;
|
||||
document.getElementById('localAddress').textContent = host;
|
||||
renderQR('qrLocalBox', host + ':50001:t');
|
||||
|
||||
if (torOnion) {
|
||||
document.getElementById('torAvailable').style.display = '';
|
||||
document.getElementById('torUnavailable').style.display = 'none';
|
||||
document.getElementById('torAddress').textContent = torOnion;
|
||||
renderQR('qrTorBox', torOnion + ':50001:t');
|
||||
} else {
|
||||
document.getElementById('torAvailable').style.display = 'none';
|
||||
document.getElementById('torUnavailable').style.display = '';
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchTorInfo() {
|
||||
try {
|
||||
var resp = await fetch('/rpc/v1', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ method: 'tor.list-services', params: {} })
|
||||
});
|
||||
var data = await resp.json();
|
||||
if (data.result && data.result.services) {
|
||||
var svc = data.result.services.find(function(s) {
|
||||
return s.name === 'electrumx' || s.name === 'electrs' || s.local_port === 50001;
|
||||
});
|
||||
if (svc && svc.onion_address) {
|
||||
torOnion = svc.onion_address;
|
||||
updateConnectionInfo();
|
||||
}
|
||||
}
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
async function updateStatus() {
|
||||
try {
|
||||
const resp = await fetch('electrs-status');
|
||||
const data = await resp.json();
|
||||
var resp = await fetch('electrs-status');
|
||||
var data = await resp.json();
|
||||
|
||||
const indexedH = data.indexed_height ?? 0;
|
||||
const networkH = data.network_height ?? 0;
|
||||
const pct = data.progress_pct ?? 0;
|
||||
var indexedH = data.indexed_height || 0;
|
||||
var networkH = data.network_height || 0;
|
||||
var pct = data.progress_pct || 0;
|
||||
|
||||
document.getElementById('indexedHeight').textContent = indexedH > 0 ? indexedH.toLocaleString() : (data.status === 'indexing' ? 'Building...' : '-');
|
||||
document.getElementById('networkHeight').textContent = networkH > 0 ? networkH.toLocaleString() : '-';
|
||||
@@ -159,35 +384,39 @@
|
||||
document.getElementById('syncPercentage').textContent = pct > 0 ? pct.toFixed(1) + '%' : '0%';
|
||||
document.getElementById('syncProgressBar').style.width = Math.max(pct, 0.5) + '%';
|
||||
|
||||
const statusText = document.getElementById('syncStatusText');
|
||||
const statusDot = document.getElementById('statusDot');
|
||||
const syncIcon = document.getElementById('syncIcon');
|
||||
var statusTextEl = document.getElementById('syncStatusText');
|
||||
var statusDot = document.getElementById('statusDot');
|
||||
var syncIcon = document.getElementById('syncIcon');
|
||||
|
||||
if (data.status === 'indexing') {
|
||||
statusText.textContent = data.error || 'Building index...';
|
||||
statusText.style.color = '#fbbf24';
|
||||
statusTextEl.textContent = data.error || 'Building index...';
|
||||
statusTextEl.style.color = '#fbbf24';
|
||||
statusDot.className = 'status-dot bg-amber animate-pulse';
|
||||
document.getElementById('statusText').textContent = 'Indexing';
|
||||
syncIcon.classList.add('animate-spin-slow');
|
||||
document.getElementById('connSubtitle').textContent = 'Connections will be available once ElectrumX has completed syncing.';
|
||||
} else if (data.status === 'error') {
|
||||
statusText.textContent = data.error || 'Unknown error';
|
||||
statusText.style.color = '#f87171';
|
||||
statusTextEl.textContent = data.error || 'Unknown error';
|
||||
statusTextEl.style.color = '#f87171';
|
||||
statusDot.className = 'status-dot bg-red';
|
||||
document.getElementById('statusText').textContent = 'Error';
|
||||
document.getElementById('connSubtitle').textContent = 'Connections will be available once ElectrumX has completed syncing.';
|
||||
} else if (data.status === 'synced') {
|
||||
statusText.textContent = 'Fully synchronized with the network';
|
||||
statusText.style.color = '#4ade80';
|
||||
statusTextEl.textContent = 'Fully synchronized with the network';
|
||||
statusTextEl.style.color = '#4ade80';
|
||||
statusDot.className = 'status-dot bg-green';
|
||||
document.getElementById('statusText').textContent = 'Synced';
|
||||
syncIcon.classList.remove('animate-spin-slow');
|
||||
syncIcon.style.color = '#4ade80';
|
||||
document.getElementById('connSubtitle').textContent = 'Use the following details to connect your wallet or application to ElectrumX.';
|
||||
} else {
|
||||
const remaining = networkH - indexedH;
|
||||
statusText.textContent = 'Syncing... ' + remaining.toLocaleString() + ' blocks remaining';
|
||||
statusText.style.color = '#fb923c';
|
||||
var remaining = networkH - indexedH;
|
||||
statusTextEl.textContent = 'Syncing... ' + remaining.toLocaleString() + ' blocks remaining';
|
||||
statusTextEl.style.color = '#fb923c';
|
||||
statusDot.className = 'status-dot bg-yellow';
|
||||
document.getElementById('statusText').textContent = 'Syncing';
|
||||
syncIcon.classList.add('animate-spin-slow');
|
||||
document.getElementById('connSubtitle').textContent = 'Connections will be available once ElectrumX has completed syncing.';
|
||||
}
|
||||
} catch (e) {
|
||||
document.getElementById('syncStatusText').textContent = 'Unable to fetch status: ' + e.message;
|
||||
@@ -196,6 +425,8 @@
|
||||
}
|
||||
|
||||
updateStatus();
|
||||
updateConnectionInfo();
|
||||
fetchTorInfo();
|
||||
setInterval(updateStatus, 5000);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user