buddy-tunnel
Advanced tools
Comparing version 1.7.25-dev to 1.7.26-dev
{ | ||
"name": "buddy-tunnel", | ||
"preferGlobal": false, | ||
"version": "1.7.25-dev", | ||
"version": "1.7.26-dev", | ||
"type": "commonjs", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -28,3 +28,4 @@ const { | ||
TUNNEL_SSH, | ||
createSshHostKey | ||
createSshHostKey, | ||
isDocker | ||
} = require('../utils'); | ||
@@ -38,2 +39,3 @@ const AgentOsx = require('./osx'); | ||
const AgentWindows = require('./windows'); | ||
const AgentDocker = require('./docker'); | ||
@@ -52,3 +54,5 @@ class AgentManagerClass { | ||
this.ws = null; | ||
if (isOsx()) { | ||
if (isDocker()) { | ||
this.system = new AgentDocker(); | ||
} else if (isOsx()) { | ||
this.system = new AgentOsx(); | ||
@@ -55,0 +59,0 @@ } else if (isLinux()) { |
@@ -34,2 +34,3 @@ const { Command } = require('commander'); | ||
} | ||
// todo command to stop docker container | ||
Output.exitSuccess(TXT_AGENT_DISABLED); | ||
@@ -36,0 +37,0 @@ }); |
@@ -28,2 +28,3 @@ const { Command } = require('commander'); | ||
} = require('../../texts'); | ||
const { isDocker } = require('../../utils'); | ||
@@ -101,4 +102,5 @@ const removeAllAndExit = async (txt, id, host, token) => { | ||
await Output.spinner(TXT_ENABLING_AGENT); | ||
if (process.env.DEBUG === '1') { | ||
if (process.env.DEBUG === '1' || isDocker()) { | ||
AgentManager.start(id, host, token, port, !!options.start); | ||
Output.normal(TXT_AGENT_ENABLED); | ||
return; | ||
@@ -105,0 +107,0 @@ } |
@@ -20,2 +20,3 @@ const { Command } = require('commander'); | ||
commandAgentUpdate.action(async () => { | ||
// todo command to run to restart agent | ||
const hasAdminRights = await AgentManager.system.hasAdminRights(); | ||
@@ -22,0 +23,0 @@ if (!hasAdminRights) { |
@@ -13,9 +13,7 @@ const { | ||
try { | ||
if (!isDocker()) { | ||
const isEnabled = await AgentManager.system.isEnabled(); | ||
if (isEnabled) { | ||
const json = AgentManager.system.loadSystemConfig(); | ||
const api = new ApiAgent(json.port); | ||
command.agentStatus = await api.fetchStatus(); | ||
} | ||
const isEnabled = await AgentManager.system.isEnabled(); | ||
if (isEnabled) { | ||
const json = AgentManager.system.loadSystemConfig(); | ||
const api = new ApiAgent(json.port); | ||
command.agentStatus = await api.fetchStatus(); | ||
} | ||
@@ -22,0 +20,0 @@ } catch { |
@@ -13,3 +13,2 @@ const { Command } = require('commander'); | ||
const stream = require('stream'); | ||
const { isDocker } = require('./utils'); | ||
@@ -30,5 +29,5 @@ stream.setDefaultHighWaterMark(false, 67108864); | ||
program.addCommand(commandStart); | ||
if (!isDocker()) program.addCommand(commandAgent); | ||
program.addCommand(commandAgent); | ||
program.addCommand(commandVersion); | ||
program.parse(); |
@@ -189,5 +189,4 @@ const { resolve } = require('path'); | ||
const getHomeDirectory = () => { | ||
let r; | ||
if (isDocker()) r = '/buddy'; | ||
else r = homedir(); | ||
if (isDocker()) return '/buddy'; | ||
const r = homedir(); | ||
const p = path.join(r, '.buddy-tunnel'); | ||
@@ -194,0 +193,0 @@ if (!existsSync(p)) mkdirSync(p, { recursive: true }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
353869
96
8437
17