mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 10:50:38 +09:00
Fix agent API URL injection for auto-selected server ports
This commit is contained in:
parent
2e4481fc26
commit
778fc3416f
3 changed files with 78 additions and 1 deletions
|
|
@ -434,6 +434,15 @@ if (listenPort !== config.port) {
|
|||
logger.warn(`Requested port is busy; using next free port (requestedPort=${config.port}, selectedPort=${listenPort})`);
|
||||
}
|
||||
|
||||
const runtimeListenHost = config.host;
|
||||
const runtimeApiHost =
|
||||
runtimeListenHost === "0.0.0.0" || runtimeListenHost === "::"
|
||||
? "localhost"
|
||||
: runtimeListenHost;
|
||||
process.env.PAPERCLIP_LISTEN_HOST = runtimeListenHost;
|
||||
process.env.PAPERCLIP_LISTEN_PORT = String(listenPort);
|
||||
process.env.PAPERCLIP_API_URL = `http://${runtimeApiHost}:${listenPort}`;
|
||||
|
||||
setupLiveEventsWebSocketServer(server, db as any, {
|
||||
deploymentMode: config.deploymentMode,
|
||||
resolveSessionFromHeaders,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue