Default the dashboard to port 11340

New installs use 11340 instead of 8080, which is often taken by other
dev servers. Existing installs keep their saved port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
This commit is contained in:
neil 2026-11-02 07:24:03 -08:00
parent 0611efd154
commit c08a548fe0
2 changed files with 8 additions and 6 deletions

View file

@ -14,6 +14,8 @@ from . import hfcache, hw, opencode, paths, plan, service
from .backends import vllm as vllm_backend # stdlib-only module; safe to import anywhere
VERSION = "0.1.0"
DEFAULT_API_PORT = 8000
DEFAULT_WEB_PORT = 11340
def say(msg=""):
@ -147,13 +149,13 @@ def cmd_setup(a):
# Stopping returns before the old processes have let go of their ports (launchd
# especially), so wait for our own ports to close before checking what's free.
if old.get("api_port"):
ours = list(range(old["api_port"], old["api_port"] + api_span)) + [old.get("web_port", 8080)]
ours = list(range(old["api_port"], old["api_port"] + api_span)) + ([old["web_port"]] if old.get("web_port") else [])
wait_ports_free(ours, timeout=30)
# Ports saved by an earlier setup are pinned: clients are configured with them, so a
# busy saved port is an error, never a reason to move. Only a first install auto-picks.
api_port = choose_port("API", a.api_port, old.get("api_port", 8000), api_span, a.no_start,
api_port = choose_port("API", a.api_port, old.get("api_port", DEFAULT_API_PORT), api_span, a.no_start,
avoid=set(), pinned="api_port" in old)
web_port = choose_port("dashboard", a.web_port, old.get("web_port", 8080), 1, a.no_start,
web_port = choose_port("dashboard", a.web_port, old.get("web_port", DEFAULT_WEB_PORT), 1, a.no_start,
avoid=set(range(api_port, api_port + api_span)), pinned="web_port" in old)
say(f"\n== Installing {p['backend']} (this can take several minutes) ==")