feat(config): default tcp/quic listen ports to mycelium standard 9651/9652

Pinning ephemeral ports made the existing field useful but left the
default behaviour (random port at every start) hostile to the
typical private-network setup, where the user pre-configures a
port-forward on their home router and expects mycelium to keep
using the same port.

Default to 9651 (TCP) and 9652 (QUIC), which match the public
mycelium convention. Clearing either field still falls back to
ephemeral. Help text updated; placeholder now says "leave empty
for ephemeral" instead of "ephemeral" so users understand the
field is currently filled with the default.
This commit is contained in:
syoul
2026-04-27 02:31:58 +02:00
parent a930c035c0
commit e4c91426be
2 changed files with 11 additions and 10 deletions

View File

@@ -8,14 +8,16 @@ const KEY = "sidecar";
// A private overlay has no Threefold-operated seed peer. The user must // A private overlay has no Threefold-operated seed peer. The user must
// declare bootstrap peers they trust (their own VPS, known friends…) // declare bootstrap peers they trust (their own VPS, known friends…)
// before the daemon can usefully start. // before the daemon can usefully start. Default to mycelium's
// well-known peer-listen ports (9651 TCP, 9652 QUIC) so port-forwards
// on a home router are predictable from the first run.
const DEFAULT_CONFIG: SidecarConfig = { const DEFAULT_CONFIG: SidecarConfig = {
peers: [], peers: [],
tunName: null, tunName: null,
noTun: false, noTun: false,
networkName: null, networkName: null,
tcpListenPort: null, tcpListenPort: 9651,
quicListenPort: null, quicListenPort: 9652,
}; };
function normalizePort(p: unknown): number | null { function normalizePort(p: unknown): number | null {

View File

@@ -412,7 +412,7 @@ onMounted(async () => {
type="text" type="text"
inputmode="numeric" inputmode="numeric"
class="mt-1 w-full rounded-md border border-input bg-background px-3 py-1.5 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring" class="mt-1 w-full rounded-md border border-input bg-background px-3 py-1.5 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring"
placeholder="ephemeral" placeholder="leave empty for ephemeral"
/> />
</div> </div>
<div> <div>
@@ -424,16 +424,15 @@ onMounted(async () => {
type="text" type="text"
inputmode="numeric" inputmode="numeric"
class="mt-1 w-full rounded-md border border-input bg-background px-3 py-1.5 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring" class="mt-1 w-full rounded-md border border-input bg-background px-3 py-1.5 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring"
placeholder="ephemeral" placeholder="leave empty for ephemeral"
/> />
</div> </div>
</div> </div>
<p class="text-[11px] text-muted-foreground"> <p class="text-[11px] text-muted-foreground">
Pin these to a fixed value (e.g. <code class="font-mono">9651</code> for Defaults are <code class="font-mono">9651</code> (TCP) and
TCP, <code class="font-mono">9652</code> for QUIC) when you port-forward <code class="font-mono">9652</code> (QUIC) the conventional mycelium
a stable port on your router so other private-network nodes can dial in peer-listen ports, predictable for port-forwarding on a home router.
across daemon restarts. Leave empty to keep using a different ephemeral Clear the field to fall back to a random ephemeral port at every start.
port at every start.
</p> </p>
<div class="flex justify-end gap-2 pt-2"> <div class="flex justify-end gap-2 pt-2">
<button <button