bdy 1.7.55-dev → 1.7.57-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/command/agent/tunnel/{stop.js → remove.js} +5 -5
- package/src/command/agent/tunnel.js +2 -2
- package/src/command/agent/uninstall.js +1 -1
- package/src/command/config/set/token.js +3 -2
- package/src/output/noninteractive/config/tunnel.js +0 -1
- package/src/texts.js +20 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const Output = require('../../../output.js');
|
|
2
2
|
const {
|
|
3
|
-
|
|
3
|
+
DESC_COMMAND_AGENT_TUNNEL_REMOVE,
|
|
4
4
|
ERR_AGENT_NOT_ENABLED,
|
|
5
5
|
OPTION_ID,
|
|
6
6
|
TXT_TUNNEL_STOPPED
|
|
@@ -9,9 +9,9 @@ const ApiAgent = require('../../../api/agent.js');
|
|
|
9
9
|
const AgentManager = require('../../../agent/manager');
|
|
10
10
|
const { newCommand } = require('../../../utils');
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const commandAgentTunnelRemove = newCommand('rm', DESC_COMMAND_AGENT_TUNNEL_REMOVE);
|
|
13
|
+
commandAgentTunnelRemove.argument('<id>', OPTION_ID);
|
|
14
|
+
commandAgentTunnelRemove.action(async (id) => {
|
|
15
15
|
const isEnabled = await AgentManager.system.isEnabled();
|
|
16
16
|
if (!isEnabled) {
|
|
17
17
|
Output.exitError(ERR_AGENT_NOT_ENABLED);
|
|
@@ -26,4 +26,4 @@ commandAgentTunnelStop.action(async (id) => {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
module.exports =
|
|
29
|
+
module.exports = commandAgentTunnelRemove;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const commandAgentTunnelTcp = require('./tunnel/tcp.js');
|
|
2
2
|
const commandAgentTunnelList = require('./tunnel/list.js');
|
|
3
|
-
const
|
|
3
|
+
const commandAgentTunnelRemove = require('./tunnel/remove.js');
|
|
4
4
|
const commandAgentTunnelTls = require('./tunnel/tls.js');
|
|
5
5
|
const commandAgentTunnelHttp = require('./tunnel/http.js');
|
|
6
6
|
const commandAgentTunnelStart = require('./tunnel/start.js');
|
|
@@ -13,7 +13,7 @@ commandAgentTunnel.addCommand(commandAgentTunnelTcp);
|
|
|
13
13
|
commandAgentTunnel.addCommand(commandAgentTunnelTls);
|
|
14
14
|
commandAgentTunnel.addCommand(commandAgentTunnelHttp);
|
|
15
15
|
commandAgentTunnel.addCommand(commandAgentTunnelStart);
|
|
16
|
-
commandAgentTunnel.addCommand(
|
|
16
|
+
commandAgentTunnel.addCommand(commandAgentTunnelRemove);
|
|
17
17
|
commandAgentTunnel.addCommand(commandAgentTunnelList);
|
|
18
18
|
commandAgentTunnel.addCommand(commandAgentTunnelStatus);
|
|
19
19
|
|
|
@@ -8,7 +8,7 @@ const ApiBuddy = require('../../api/buddy.js');
|
|
|
8
8
|
const { ERR_AGENT_ADMIN_RIGHTS } = require('../../texts');
|
|
9
9
|
const { newCommand } = require('../../utils');
|
|
10
10
|
|
|
11
|
-
const commandAgentUninstall = newCommand('
|
|
11
|
+
const commandAgentUninstall = newCommand('uninstall', DESC_COMMAND_AGENT_UNINSTALL);
|
|
12
12
|
commandAgentUninstall.action(async () => {
|
|
13
13
|
const hasAdminRights = await AgentManager.system.hasAdminRights();
|
|
14
14
|
if (!hasAdminRights) {
|
|
@@ -3,7 +3,8 @@ const Output = require('../../../output.js');
|
|
|
3
3
|
const {
|
|
4
4
|
DESC_COMMAND_CONFIG_SET_TOKEN,
|
|
5
5
|
OPTION_TOKEN,
|
|
6
|
-
TXT_TOKEN_SAVED
|
|
6
|
+
TXT_TOKEN_SAVED,
|
|
7
|
+
TXT_TOKEN_REMOVED
|
|
7
8
|
} = require('../../../texts.js');
|
|
8
9
|
const { newCommand } = require('../../../utils');
|
|
9
10
|
|
|
@@ -11,7 +12,7 @@ const commandConfigSetToken = newCommand('token', DESC_COMMAND_CONFIG_SET_TOKEN)
|
|
|
11
12
|
commandConfigSetToken.argument('[token]', OPTION_TOKEN, '');
|
|
12
13
|
commandConfigSetToken.action((token) => {
|
|
13
14
|
Cfg.setToken(token);
|
|
14
|
-
Output.exitSuccess(TXT_TOKEN_SAVED);
|
|
15
|
+
Output.exitSuccess(!token ? TXT_TOKEN_REMOVED : TXT_TOKEN_SAVED);
|
|
15
16
|
});
|
|
16
17
|
|
|
17
18
|
module.exports = commandConfigSetToken;
|
|
@@ -21,7 +21,6 @@ class OutputNoninteractiveConfigTunnel {
|
|
|
21
21
|
data.push(['Target', Format.target(this.tunnel.type, this.tunnel.target)]);
|
|
22
22
|
}
|
|
23
23
|
data.push(['Region', Format.tunnelRegion(this.tunnel.region)]);
|
|
24
|
-
data.push(['Server ID', this.tunnel.sshId]);
|
|
25
24
|
data.push(['Timeout', Format.tunnelTimeout(this.tunnel.timeout)]);
|
|
26
25
|
data.push(['Whitelist', Format.tunnelWhitelist(this.tunnel.whitelist)]);
|
|
27
26
|
data.push(['Domain', Format.tunnelDomain(this.tunnel.domain)]);
|
package/src/texts.js
CHANGED
|
@@ -25,13 +25,13 @@ const ERR_BA_IS_NOT_VALID = (auth) => `HTTP BA '${auth}' invalid`;
|
|
|
25
25
|
const ERR_USER_AGENT_IS_NOT_VALID = (ua) => `Invalid User-Agent regex: '${ua}'`;
|
|
26
26
|
const ERR_WHITELIST_IS_NOT_VALID = (wh) => `Invalid CIDR: '${wh}'`;
|
|
27
27
|
const ERR_TUNNEL_NOT_FOUND = (name) => `Tunnel '${name}' not found`;
|
|
28
|
-
const ERR_AGENT_NOT_ENABLED = 'Agent not
|
|
28
|
+
const ERR_AGENT_NOT_ENABLED = 'Agent not installed';
|
|
29
29
|
const ERR_AGENT_NOT_RUNNING = 'Agent not running';
|
|
30
30
|
const ERR_AGENT_NOT_FOUND = 'Agent not found';
|
|
31
|
-
const ERR_SWW_AGENT_ENABLING = 'Failed
|
|
32
|
-
const ERR_SWW_AGENT_DISABLING = 'Failed
|
|
31
|
+
const ERR_SWW_AGENT_ENABLING = 'Failed installing agent';
|
|
32
|
+
const ERR_SWW_AGENT_DISABLING = 'Failed uninstalling agent';
|
|
33
33
|
const ERR_SWW_AGENT_UPDATING = 'Failed updating agent';
|
|
34
|
-
const ERR_AGENT_ENABLE = 'Agent disabled:
|
|
34
|
+
const ERR_AGENT_ENABLE = 'Agent disabled: install first';
|
|
35
35
|
const ERR_AGENT_ADMIN_RIGHTS = 'Command must be run with administrator rights';
|
|
36
36
|
const ERR_AGENT_NOT_SUPPORTED = 'Starting agent is not supported';
|
|
37
37
|
const ERR_TUNNEL_ALREADY_EXISTS = 'Tunnel name exists: change or use -f to overwrite';
|
|
@@ -58,20 +58,20 @@ const ERR_CONFIG_CORRUPTED = 'Config file is corrupted';
|
|
|
58
58
|
const TXT_AGENT_STOPPED = 'Agent stopped';
|
|
59
59
|
const TXT_AGENT_STARTED = 'Agent started';
|
|
60
60
|
const TXT_AGENT_RESTARTED = 'Agent restarted';
|
|
61
|
-
const TXT_AGENT_IS_ENABLED_AND_STARTED = 'Agent is
|
|
62
|
-
const TXT_AGENT_IS_ENABLED_AND_STOPPED = 'Agent is
|
|
63
|
-
const TXT_AGENT_IS_ENABLED_AND_INITIALIZING = 'Agent is
|
|
64
|
-
const TXT_AGENT_IS_ENABLED_AND_HAVE_TROUBLES = 'Agent is
|
|
65
|
-
const TXT_AGENT_IS_DISABLED = 'Agent is
|
|
66
|
-
const TXT_AGENT_ENABLED = 'Agent
|
|
61
|
+
const TXT_AGENT_IS_ENABLED_AND_STARTED = 'Agent is installed & started';
|
|
62
|
+
const TXT_AGENT_IS_ENABLED_AND_STOPPED = 'Agent is installed & stopped';
|
|
63
|
+
const TXT_AGENT_IS_ENABLED_AND_INITIALIZING = 'Agent is installed & initializing';
|
|
64
|
+
const TXT_AGENT_IS_ENABLED_AND_HAVE_TROUBLES = 'Agent is installed [connection issues detected]';
|
|
65
|
+
const TXT_AGENT_IS_DISABLED = 'Agent is not installed';
|
|
66
|
+
const TXT_AGENT_ENABLED = 'Agent installed';
|
|
67
67
|
const TXT_AGENT_UPDATED = 'Agent updated';
|
|
68
|
-
const TXT_AGENT_ALREADY_ENABLED = 'Agent already
|
|
69
|
-
const TXT_AGENT_DISABLED = 'Agent
|
|
70
|
-
const TXT_AGENT_ALREADY_DISABLED = 'Agent already disabled';
|
|
68
|
+
const TXT_AGENT_ALREADY_ENABLED = 'Agent already installed';
|
|
69
|
+
const TXT_AGENT_DISABLED = 'Agent uninstalled';
|
|
71
70
|
const TXT_TUNNEL_STARTED = (type) => `${type} tunnel started`;
|
|
72
71
|
const TXT_TUNNEL_STOPPED = 'Tunnel stopped';
|
|
73
72
|
const TXT_WHITELIST_SAVED = 'Whitelist saved';
|
|
74
73
|
const TXT_TOKEN_SAVED = 'Token saved';
|
|
74
|
+
const TXT_TOKEN_REMOVED = 'Token cleared';
|
|
75
75
|
const TXT_TIMEOUT_SAVED = 'Timeout saved';
|
|
76
76
|
const TXT_REGION_SAVED = 'Region saved';
|
|
77
77
|
const TXT_TUNNEL_REMOVED = 'Tunnel removed';
|
|
@@ -102,7 +102,7 @@ const DESC_COMMAND_AGENT_TUNNEL_HTTP = 'Manage agent\'s tunnels';
|
|
|
102
102
|
const DESC_COMMAND_AGENT_TUNNEL_LIST = 'Manage agent\'s tunnels';
|
|
103
103
|
const DESC_COMMAND_AGENT_TUNNEL_START = 'Manage agent\'s tunnels';
|
|
104
104
|
const DESC_COMMAND_AGENT_TUNNEL_STATUS = 'Manage agent\'s tunnels';
|
|
105
|
-
const
|
|
105
|
+
const DESC_COMMAND_AGENT_TUNNEL_REMOVE = 'Manage agent\'s tunnels';
|
|
106
106
|
const DESC_COMMAND_AGENT_TUNNEL_TCP = 'Manage agent\'s tunnels';
|
|
107
107
|
const DESC_COMMAND_AGENT_TUNNEL_TLS = 'Manage agent\'s tunnels';
|
|
108
108
|
const DESC_COMMAND_AGENT_UNINSTALL = 'Uninstall bdy service';
|
|
@@ -126,8 +126,8 @@ const TXT_NEW_CLI_DOCKER_VERSION = (version) => `New CLI Docker image: ${version
|
|
|
126
126
|
const TXT_NEW_CLI_VERSION = (version) => `New CLI version: ${version}\n\n`;
|
|
127
127
|
const TXT_NEW_AGENT_VERSION = (version) => `Agent update required. Update to ${version}:\n\`bdy agent update\`\n\n`;
|
|
128
128
|
const TXT_NEW_CLI_AGENT_VERSION = (version) => `New CLI version (${version}). Update:\n\`bdy agent update\`\n\n`;
|
|
129
|
-
const TXT_DISABLING_AGENT = '
|
|
130
|
-
const TXT_ENABLING_AGENT = '
|
|
129
|
+
const TXT_DISABLING_AGENT = 'Uninstalling agent...';
|
|
130
|
+
const TXT_ENABLING_AGENT = 'Installing agent...';
|
|
131
131
|
const TXT_UPDATING_AGENT = 'Updating agent...';
|
|
132
132
|
const TXT_OPENING_TUNNEL = 'Opening tunnel...';
|
|
133
133
|
|
|
@@ -177,10 +177,10 @@ const LOG_AGENT_SYSTEM_DIR = 'Creating agent system directory...';
|
|
|
177
177
|
const LOG_AGENT_DOWNLOADING_ARCHIVE = 'Downloading agent archive...';
|
|
178
178
|
const LOG_AGENT_EXTRACTING_ARCHIVE = 'Extracting agent archive...';
|
|
179
179
|
const LOG_AGENT_SYSTEM_SERVICE_CONFIG = 'Saving agent system service config...';
|
|
180
|
-
const LOG_AGENT_ENABLING_SYSTEM = '
|
|
180
|
+
const LOG_AGENT_ENABLING_SYSTEM = 'Installing agent in system...';
|
|
181
181
|
const LOG_AGENT_STOPPING_SYSTEM = 'Stopping agent in system...';
|
|
182
182
|
const LOG_AGENT_STARTING_SYSTEM = 'Starting agent in system...';
|
|
183
|
-
const LOG_AGENT_ENABLED = 'Agent
|
|
183
|
+
const LOG_AGENT_ENABLED = 'Agent installed in system';
|
|
184
184
|
const LOG_AGENT_NSSM_DOWNLOADING = 'Agent nssm downloading...';
|
|
185
185
|
const LOG_AGENT_NSSM_EXTRACTING = 'Agent nssm extracting...';
|
|
186
186
|
const LOG_AGENT_NSSM_CLEARING = 'Agent nssm clearing...';
|
|
@@ -315,7 +315,7 @@ module.exports = {
|
|
|
315
315
|
DESC_COMMAND_AGENT_UNINSTALL,
|
|
316
316
|
DESC_COMMAND_AGENT_TUNNEL_TLS,
|
|
317
317
|
DESC_COMMAND_AGENT_TUNNEL_TCP,
|
|
318
|
-
|
|
318
|
+
DESC_COMMAND_AGENT_TUNNEL_REMOVE,
|
|
319
319
|
DESC_COMMAND_AGENT_TUNNEL_STATUS,
|
|
320
320
|
DESC_COMMAND_AGENT_TUNNEL_START,
|
|
321
321
|
DESC_COMMAND_AGENT_TUNNEL_LIST,
|
|
@@ -363,6 +363,7 @@ module.exports = {
|
|
|
363
363
|
TXT_TUNNEL_ADDED,
|
|
364
364
|
TXT_TIMEOUT_SAVED,
|
|
365
365
|
TXT_TOKEN_SAVED,
|
|
366
|
+
TXT_TOKEN_REMOVED,
|
|
366
367
|
TXT_WHITELIST_SAVED,
|
|
367
368
|
TXT_TUNNEL_STOPPED,
|
|
368
369
|
TXT_TUNNEL_STARTED,
|
|
@@ -370,7 +371,6 @@ module.exports = {
|
|
|
370
371
|
TXT_AGENT_UPDATED,
|
|
371
372
|
TXT_AGENT_ALREADY_ENABLED,
|
|
372
373
|
TXT_AGENT_DISABLED,
|
|
373
|
-
TXT_AGENT_ALREADY_DISABLED,
|
|
374
374
|
TXT_AGENT_STARTED,
|
|
375
375
|
TXT_AGENT_RESTARTED,
|
|
376
376
|
TXT_AGENT_IS_DISABLED,
|