From 91a3e9b4b08b32fd1bbbb90d48e1abf60b25f915 Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Sun, 12 Mar 2023 14:43:04 -0700 Subject: [PATCH] fix(kopiaui): fixed '' in the tray menu. (#2813) The fix is to use `127.0.0.1` instead of `localhost` when starting the server and polling for the server status. This resolves an issue where KopiaUI can't connect to the server which only listens on IPv4 localhost (127.0.0.1) but the Javascript client prefers IPv6 (::1) and fails to connect. --- app/public/server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/public/server.js b/app/public/server.js index 6a880ee60..db4240938 100644 --- a/app/public/server.js +++ b/app/public/server.js @@ -36,13 +36,13 @@ function newServerForRepo(repoID) { args.push('server', '--ui', '--tls-print-server-cert', - '--tls-generate-cert-name=localhost', + '--tls-generate-cert-name=127.0.0.1', '--random-password', '--random-server-control-password', '--tls-generate-cert', '--async-repo-connect', '--shutdown-on-stdin', // shutdown the server when parent dies - '--address=localhost:0'); + '--address=127.0.0.1:0'); args.push("--config-file", path.resolve(configDir(), repoID + ".config")); @@ -74,7 +74,7 @@ function newServerForRepo(repoID) { const req = https.request({ ca: [runningServerCertificate], - host: "localhost", + host: "127.0.0.1", port: parseInt(new URL(runningServerAddress).port), method: "GET", path: "/api/v1/control/status",