Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

fix(dev): dev.ps1 honors SERVERKIT_KILL_PORTS=0; print localhost URL under WSL

Juan Denis5ecf1bb8c958
diff --git a/dev.ps1 b/dev.ps1
index 10f3110f..c16cd236 100644
--- a/dev.ps1
+++ b/dev.ps1
@@ -133,6 +133,9 @@ function Stop-WindowsListenersOnPort {
[string]$Label
)
+ # Parity with dev.sh: SERVERKIT_KILL_PORTS=0 opts out of port cleanup.
+ if ($env:SERVERKIT_KILL_PORTS -eq '0') { return }
+
$listeners = @(Get-NetTCPConnection -LocalPort $Port -State Listen -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty OwningProcess -Unique |
Where-Object { $_ -and $_ -ne 0 -and $_ -ne $PID })
diff --git a/dev/dev.sh b/dev/dev.sh
index a75af39a..2a5136b4 100644
--- a/dev/dev.sh
+++ b/dev/dev.sh
@@ -563,7 +563,15 @@ print_dev_summary() {
echo
echo -e "${CYAN}${title}${NC}"
- echo " Open app: $FRONTEND_URL"
+ # Under WSL the FRONTEND_URL host is the WSL interface IP (reachable from
+ # Windows even when localhost forwarding dies), but localhost is the one
+ # people expect — print both and let either work.
+ if is_wsl && [[ "$FRONTEND_URL" != *"://localhost"* && "$FRONTEND_URL" != *"://127."* ]]; then
+ echo " Open app: http://localhost:$FRONTEND_ACTUAL_PORT"
+ echo " (fallback: $FRONTEND_URL)"
+ else
+ echo " Open app: $FRONTEND_URL"
+ fi
echo " Backend: $BACKEND_URL"
echo " Health: $API_URL/system/health"
echo " API env: VITE_API_URL=$API_URL"