From c7974c7aa94fb7e2ea26fe4ad8c01328672006da Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 20:32:05 +0000 Subject: [PATCH] simplify onboarding Step 3 port forwarding to clean static list - Replace complex per-service/health-check UI with a clear, hardcoded table of required ports (80, 443, 22, 8448) and an optional Element Calling section (7881 TCP, 7882-7894 UDP, 5349 TCP, 3478 UDP, 30000-40000 TCP/UDP). - Add totals line: 4 openings without Element Calling, 9 with. - Drop /api/ports/health fetch and all dynamic breakdowns (affected services loop, closed-port warnings, "View All Required Ports" table). - Keep internal-IP display box, SSL-cert warning, and "How to set up port forwarding" collapsible section. - Add prominent note that each port only needs to be forwarded once. - Update Step 3 header description in onboarding.html to match. Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/523e0770-f144-4f47-932b-c0d40782a35b Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- app/sovran_systemsos_web/static/onboarding.js | 135 +++++++----------- .../templates/onboarding.html | 5 +- 2 files changed, 52 insertions(+), 88 deletions(-) diff --git a/app/sovran_systemsos_web/static/onboarding.js b/app/sovran_systemsos_web/static/onboarding.js index da9e7fa..d66ecd7 100644 --- a/app/sovran_systemsos_web/static/onboarding.js +++ b/app/sovran_systemsos_web/static/onboarding.js @@ -228,114 +228,79 @@ async function loadStep3() { body.innerHTML = '

Checking ports…

'; var networkData = null; - var portHealth = null; try { - var results = await Promise.all([ - apiFetch("/api/network"), - apiFetch("/api/ports/health"), - ]); - networkData = results[0]; - portHealth = results[1]; + networkData = await apiFetch("/api/network"); } catch (err) { - body.innerHTML = '

⚠ Could not load port data: ' + escHtml(err.message) + '

'; + body.innerHTML = '

⚠ Could not load network data: ' + escHtml(err.message) + '

'; return; } var internalIp = (networkData && networkData.internal_ip) || "unknown"; - var html = '
' - + '⚠ IMPORTANT: Ports 80 (HTTP) and 443 (HTTPS) MUST be forwarded first.
' - + 'Caddy uses these ports to obtain SSL certificates from Let\'s Encrypt. ' - + 'If these ports are closed, certificate authentication will fail and ' - + 'none of your domain-based services will work over HTTPS.' - + '
'; + var ip = escHtml(internalIp); + + var html = '

' + + '⚠ Each port only needs to be forwarded once — all services share the same ports.' + + '

'; html += '
'; html += ' Forward ports to this machine\'s internal IP:'; - html += ' ' + escHtml(internalIp) + ''; + html += ' ' + ip + ''; html += '
'; + // Required ports table + html += '
'; + html += '
Required Ports — open these on your router:
'; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += '
PortProtocolForward toPurpose
80TCP' + ip + 'HTTP
443TCP' + ip + 'HTTPS
22TCP' + ip + 'SSH Remote Access
8448TCP' + ip + 'Matrix Federation
'; + html += '
'; + + // Optional ports table + html += '
'; + html += '
Optional — Only needed if you enable Element Calling:
'; + html += '
These 5 additional port openings are required on top of the 4 required ports above.
'; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += '
PortProtocolForward toPurpose
7881TCP' + ip + 'LiveKit WebRTC signalling
7882–7894UDP' + ip + 'LiveKit media streams
5349TCP' + ip + 'TURN over TLS
3478UDP' + ip + 'TURN (STUN/relay)
30000–40000TCP/UDP' + ip + 'TURN relay (WebRTC)
'; + html += '
'; + + // Totals + html += '
'; + html += 'Total port openings: 4 (without Element Calling)
'; + html += 'Total port openings: 9 (with Element Calling — 4 required + 5 optional)'; + html += '
'; + + html += '
' + + '⚠ Ports 80 and 443 must be forwarded first. ' + + 'Caddy uses these to obtain SSL certificates from Let\'s Encrypt. ' + + 'If they are closed, HTTPS will not work and your services will be unreachable from outside your network.' + + '
'; + html += '
' + 'How to set up port forwarding' + '
    ' + '
  1. Open your router\'s admin panel — usually http://192.168.1.1 or http://192.168.0.1
  2. ' + '
  3. Look for "Port Forwarding", "NAT", or "Virtual Server" in the settings
  4. ' - + '
  5. Create a new rule for each port listed below
  6. ' - + '
  7. Set the destination/internal IP to ' + escHtml(internalIp) + '
  8. ' + + '
  9. Create a new rule for each port listed above
  10. ' + + '
  11. Set the destination/internal IP to ' + ip + '
  12. ' + '
  13. Set both internal and external port to the same number
  14. ' + '
  15. Save and apply changes
  16. ' + '
' + '
'; - var status = (portHealth && portHealth.status) || "ok"; - var totalPorts = (portHealth && portHealth.total_ports) || 0; - var closedPorts = (portHealth && portHealth.closed_ports) || 0; - - if (totalPorts === 0) { - html += '

No port requirements detected for your current role.

'; - } else if (status === "ok") { - html += '

✅ All ' + totalPorts + ' required ports are open and ready.

'; - } else { - html += '
'; - html += '⚠ ' + closedPorts + ' of ' + totalPorts + ' ports appear closed. '; - html += 'You can continue, but affected services may not work until ports are forwarded.'; - html += '
'; - } - - // Show per-service breakdown - var affectedSvcs = (portHealth && portHealth.affected_services) || []; - if (affectedSvcs.length > 0) { - html += '
'; - html += '
Affected Services
'; - affectedSvcs.forEach(function(svc) { - html += '
'; - html += '
' + escHtml(svc.name) + '
'; - (svc.closed_ports || []).forEach(function(p) { - html += '
'; - html += ' 🔴'; - html += ' ' + escHtml(p.port) + '/' + escHtml(p.protocol) + ''; - if (p.description) html += ' ' + escHtml(p.description) + ''; - html += '
'; - }); - html += '
'; - }); - html += '
'; - } - - // Full port table from services - if (_servicesData) { - // Collect all unique port requirements - var allPorts = []; - var seen = new Set(); - (_servicesData || []).forEach(function(svc) { - (svc.port_requirements || []).forEach(function(p) { - var key = p.port + "/" + p.protocol; - if (!seen.has(key)) { - seen.add(key); - allPorts.push(p); - } - }); - }); - - if (allPorts.length > 0) { - html += '
'; - html += 'View All Required Ports'; - html += ''; - html += ''; - html += ''; - allPorts.forEach(function(p) { - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - }); - html += '
PortProtocolPurpose
' + escHtml(p.port) + '' + escHtml(p.protocol) + '' + escHtml(p.description || "") + '
'; - html += '
'; - } - } - body.innerHTML = html; } diff --git a/app/sovran_systemsos_web/templates/onboarding.html b/app/sovran_systemsos_web/templates/onboarding.html index 440255e..09b9dbf 100644 --- a/app/sovran_systemsos_web/templates/onboarding.html +++ b/app/sovran_systemsos_web/templates/onboarding.html @@ -93,9 +93,8 @@ 🔌

Port Forwarding Check

- Your home router must forward specific ports to this machine before your services will work. - Ports 80 and 443 must be open before Caddy can authenticate your SSL certificates. - Without these ports forwarded, HTTPS will not work and your services will be unreachable from outside your network. + Forward these ports on your router to this machine. Each port only needs to be opened once — they are shared across all your services. + Ports 80 and 443 must be open for SSL certificates to work.