fix(server): respect externally set PAPERCLIP_API_URL env var

Previously the server unconditionally overwrote PAPERCLIP_API_URL on
startup, clobbering any value set externally (e.g., via Kubernetes
ConfigMap). Now only sets the default if the env var is not already set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-12 09:02:42 -04:00
parent 8b64cf10ef
commit 6b30178766
+3 -1
View File
@@ -553,7 +553,9 @@ export async function startServer(): Promise<StartedServer> {
: runtimeListenHost;
process.env.PAPERCLIP_LISTEN_HOST = runtimeListenHost;
process.env.PAPERCLIP_LISTEN_PORT = String(listenPort);
process.env.PAPERCLIP_API_URL = `http://${runtimeApiHost}:${listenPort}`;
if (!process.env.PAPERCLIP_API_URL) {
process.env.PAPERCLIP_API_URL = `http://${runtimeApiHost}:${listenPort}`;
}
setupLiveEventsWebSocketServer(server, db as any, {
deploymentMode: config.deploymentMode,