mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 12:40:28 +00:00
Gateway: harden Compose-style gateway port parsing
This commit is contained in:
committed by
Peter Steinberger
parent
b665749e9f
commit
ac7ca52090
@@ -3,8 +3,7 @@ import { spawnSync } from "node:child_process";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { forceFreePort, type PortProcess } from "../src/cli/ports.js";
|
||||
|
||||
const DEFAULT_PORT = 18789;
|
||||
import { resolveGatewayPort } from "../src/config/config.js";
|
||||
|
||||
function killGatewayListeners(port: number): PortProcess[] {
|
||||
try {
|
||||
@@ -44,7 +43,7 @@ function runTests() {
|
||||
}
|
||||
|
||||
function main() {
|
||||
const port = Number.parseInt(process.env.OPENCLAW_GATEWAY_PORT ?? `${DEFAULT_PORT}`, 10);
|
||||
const port = resolveGatewayPort(undefined, process.env);
|
||||
|
||||
console.log(`🧹 test:force - clearing gateway on port ${port}`);
|
||||
const killed = killGatewayListeners(port);
|
||||
|
||||
Reference in New Issue
Block a user