diff --git a/server/app/core/sshManager.js b/server/app/core/sshManager.js index 79a95695..e2049c22 100644 --- a/server/app/core/sshManager.js +++ b/server/app/core/sshManager.js @@ -9,19 +9,6 @@ const { emitAll } = require("../handlers/commUtils.js"); const db = new Map(); -/** - * check whether verbose ssh logging is enabled via environment variable - * @returns {boolean} - true when enabled - */ -function isVerboseSshEnabled() { - const value = process.env.WHEEL_VERBOSE_SSH; - if (typeof value !== "string") { - return false; - } - const normalized = value.trim().toLowerCase(); - return normalized !== "" && normalized !== "0" && normalized !== "false"; -} - /** * check if db contains ssh object for the project * @param {string} projectRootDir - project's root path @@ -206,7 +193,7 @@ async function createSsh(projectRootDir, remoteHostName, hostinfo, clientID, isS if (hostinfo.readyTimeout) { hostinfo.ConnectTimeout = Math.floor(hostinfo.readyTimeout / 1000); } - if (isVerboseSshEnabled()) { + if (process.env.WHEEL_VERBOSE_SSH) { hostinfo.sshOpt = ["-vvv"]; } if (hostinfo.username) { diff --git a/server/app/db/version.json b/server/app/db/version.json index a9ad41af..0144ea53 100644 --- a/server/app/db/version.json +++ b/server/app/db/version.json @@ -1 +1 @@ -{"version": "2026-0605-211714" } \ No newline at end of file +{"version": "2026-0316-150937" } \ No newline at end of file diff --git a/server/test/app/core/sshManager.js b/server/test/app/core/sshManager.js index f5875abc..5cc6d3ec 100644 --- a/server/test/app/core/sshManager.js +++ b/server/test/app/core/sshManager.js @@ -325,9 +325,7 @@ describe("#getSshPW", ()=>{ hasEntryMock.returns(true); //パスワードが関数の場合も想定してテスト - const pwFunc = ()=>{ - return "secretFromFunction"; - }; + const pwFunc = ()=>"secretFromFunction"; dbMock.set("/path/to/project", new Map([ ["hostID", { pw: pwFunc }] ])); @@ -682,9 +680,7 @@ describe("#createSsh", ()=>{ //ここでは askPasswordMock が呼ばれていない可能性もあります。 //(シナリオによっては、askPasswordMock を実際に呼ばせるには canConnect 内部実装が必要) //ここでは、"あとで必要になったとき呼ばれる" 想定なので、call回数は 0 のままでも問題なし - expect(askPasswordMock.callCount).to.satisfy((count)=>{ - return count === 0 || count === 1; - }); + expect(askPasswordMock.callCount).to.satisfy((count)=>count === 0 || count === 1); expect(result).to.be.ok; }); @@ -752,18 +748,6 @@ describe("#createSsh", ()=>{ expect(addSshMock.calledOnce).to.be.true; }); - it("should not set sshOpt when WHEEL_VERBOSE_SSH is false-like", async ()=>{ - process.env.WHEEL_VERBOSE_SSH = "false"; - hasEntryMock.returns(false); - canConnectMock.resolves(true); - - const hostinfo = { id: "verboseFalseTest" }; - await createSsh("/vProj", "vHost", hostinfo, "cl-v", false); - - expect(hostinfo).to.not.have.property("sshOpt"); - expect(addSshMock.calledOnce).to.be.true; - }); - it("should copy username to user and remove username if exist", async ()=>{ hasEntryMock.returns(false); canConnectMock.resolves(true);