mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-08 08:52:12 +00:00
Refs #1083 (step A2). Debug now works on Python configurations whose run target is a Docker image or Compose service: the run starts the program in a new container under debugpy (the image's own, else the IDE's managed copy mounted read-only), publishes the debug port on 127.0.0.1 only, and the debugger attaches like a Python Remote Debug configuration with the project folder mapped. Console scripts (pytest) run as modules and `uv run` keeps the manager in front; shell command lines are refused. Container debug startup is bounded (error when the container exits early or debugpy isn't ready in 120 s) and stopping the debugger stops the container. Co-authored-by: andreabasile <[email protected]>
16 lines
642 B
TypeScript
16 lines
642 B
TypeScript
/**
|
|
* The HTTP port of a running Spring Boot application, from the embedded web
|
|
* server's startup line: "Tomcat started on port 8080 (http) with context path '/'",
|
|
* "Netty started on port 8080", "Undertow started on port(s) 8080 (http)",
|
|
* "Jetty started on port(s) 8080 (http/1.1)".
|
|
*/
|
|
const STARTED = /\b(?:Tomcat|Netty|Undertow|Jetty)\b.*?\bstarted on port(?:\(s\))?:?\s*(\d{1,5})/i;
|
|
|
|
export function startedPort(line: string): number | null {
|
|
if (!line.includes("tarted on port")) return null;
|
|
const m = STARTED.exec(line);
|
|
if (!m) return null;
|
|
const port = Number(m[1]);
|
|
return port > 0 && port < 65536 ? port : null;
|
|
}
|