Files
Live_RC/src/public_url.js
T
larssandandClaude Opus 5.5 533f59adf9 feat(settings): one public address (domain / DynDNS) for all mobile profiles
Moves the public address from each driver's share panel to Settings ->
System & backup, with Save and Detect public IP. The share panel shows
the address in use and links to the setting; empty keeps using the
local network address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:45:53 +02:00

12 lines
482 B
JavaScript

// The address phones and other networks use to reach this server (a domain or DynDNS name,
// optionally with a port), e.g. "https://club.dyndns.org:8443". Only the origin is kept;
// "" when empty or invalid - links and QR codes then use the local network address.
export function normalizePublicBaseUrl(value) {
try {
const url = new URL(String(value || "").trim());
return ["http:", "https:"].includes(url.protocol) ? url.origin : "";
} catch {
return "";
}
}