bdy 1.7.57-dev → 1.7.58-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bdy",
3
3
  "preferGlobal": false,
4
- "version": "1.7.57-dev",
4
+ "version": "1.7.58-dev",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "dependencies": {
package/src/agent.js CHANGED
@@ -62,14 +62,22 @@ class Agent extends EventEmitter {
62
62
  this.destroyTunnel(data.id);
63
63
  if (!this.service && this.tunnels.length <= 0) Output.exitError(ERR_TUNNEL_REMOVED);
64
64
  } else {
65
+ logger.debug('Socket fetch tunnel after sync push');
65
66
  this.socket.fetch(this.started, null, false, []);
66
67
  }
67
68
  }
68
69
 
69
- _onSocketAgent(_, action) {
70
+ async _onSocketAgent(data, action) {
70
71
  if (action === 'DEL') {
71
72
  if (this.manager) return this.manager.disableAgentAndExit(ERR_AGENT_REMOVED);
72
73
  Output.exitError(ERR_AGENT_REMOVED);
74
+ } else if (data.action) {
75
+ try {
76
+ await this.makeAction(data.action);
77
+ } catch (err) {
78
+ logger.error('Agent sync error');
79
+ logger.error(err);
80
+ }
73
81
  }
74
82
  }
75
83
 
@@ -86,7 +94,7 @@ class Agent extends EventEmitter {
86
94
  if (data.agent.action) await this.makeAction(data.agent.action);
87
95
  this.refreshTunnels(data.tunnels || []);
88
96
  } catch (err) {
89
- logger.error('fetch error');
97
+ logger.error('Fetch error');
90
98
  logger.error(err);
91
99
  }
92
100
  }
package/src/api/socket.js CHANGED
@@ -130,9 +130,11 @@ class ApiSocketClass extends EventEmitter {
130
130
  this.emit(SOCKET_IO_EVENT_DISCONNECTED);
131
131
  });
132
132
  this.socket.on('fetchTunnelAgentSuccess', (data) => {
133
+ logger.debug('Socket fetch success');
133
134
  this.emit(SOCKET_IO_EVENT_FETCH_SUCCESS, data);
134
135
  });
135
136
  this.socket.on('fetchTunnelAgentFailed', (code) => {
137
+ logger.debug('Socket fetch failed');
136
138
  this.emit(SOCKET_IO_EVENT_FETCH_FAILED, apiErrorCodeToClass(code, host));
137
139
  });
138
140
  this.socket.on('sync', (data) => this.onSync(data));
@@ -35,8 +35,6 @@ const commandPre = async (_, command) => {
35
35
  const newAgent = command.agentStatus && command.agentStatus.version !== command.latestVersion;
36
36
  if (isDocker() && newCli) {
37
37
  Output.newCliDockerVersion(command.latestVersion);
38
- } else if (newCli && newAgent) {
39
- Output.newCliAgentVersion(command.latestVersion);
40
38
  } else if (newCli) {
41
39
  Output.newCliVersion(command.latestVersion);
42
40
  } else if (newAgent) {
package/src/output.js CHANGED
@@ -5,7 +5,6 @@ const OutputNoninteractiveConfigTunnel = require('./output/noninteractive/config
5
5
  const OutputNoninteractiveConfigTunnels = require('./output/noninteractive/config/tunnels.js');
6
6
  const {
7
7
  TXT_NEW_AGENT_VERSION,
8
- TXT_NEW_CLI_AGENT_VERSION,
9
8
  TXT_NEW_CLI_VERSION
10
9
  } = require('./texts.js');
11
10
  const OutputNoninteractiveAgentTunnels = require('./output/noninteractive/agent/tunnels.js');
@@ -77,10 +76,6 @@ class Output {
77
76
  terminal.gray(TXT_NEW_CLI_DOCKER_VERSION(version));
78
77
  }
79
78
 
80
- static newCliAgentVersion(version) {
81
- terminal.gray(TXT_NEW_CLI_AGENT_VERSION(version));
82
- }
83
-
84
79
  static newAgentVersion(version) {
85
80
  terminal.gray(TXT_NEW_AGENT_VERSION(version));
86
81
  }
package/src/texts.js CHANGED
@@ -37,7 +37,7 @@ 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';
38
38
  const ERR_FAILED_TO_CONNECT = (host) => `Failed to connect to '${host}'`;
39
39
  const ERR_AGENT_REMOVED = 'Agent has been removed';
40
- const ERR_SUBDOMAIN_TAKEN = 'Subdomain name unavailable70342556';
40
+ const ERR_SUBDOMAIN_TAKEN = 'Subdomain name unavailable';
41
41
  const ERR_TUNNEL_LIMIT_REACHED = 'Tunnels limit reached';
42
42
  const ERR_AGENT_LIMIT_REACHED = 'Agents limit reached';
43
43
  const ERR_TUNNELS_DISABLED = 'Tunnels disabled';
@@ -122,10 +122,9 @@ const DESC_COMMAND_TCP = 'Starts a tunnel which forwards all TCP traffic on a pu
122
122
  const DESC_COMMAND_TLS = 'Starts a tunnel listening for TLS traffic on port 443 with a specific hostname.';
123
123
  const DESC_PROGRAM = 'Buddy exposes local networked services behinds NATs and firewalls to the public internet over a secure tunnel. Share local websites, build/test webhook consumers, and self-host personal services.';
124
124
 
125
- const TXT_NEW_CLI_DOCKER_VERSION = (version) => `New CLI Docker image: ${version}\n\n`;
126
- const TXT_NEW_CLI_VERSION = (version) => `New CLI version: ${version}\n\n`;
127
- const TXT_NEW_AGENT_VERSION = (version) => `Agent update required. Update to ${version}:\n\`bdy agent update\`\n\n`;
128
- const TXT_NEW_CLI_AGENT_VERSION = (version) => `New CLI version (${version}). Update:\n\`bdy agent update\`\n\n`;
125
+ const TXT_NEW_CLI_DOCKER_VERSION = (version) => `A new version of bdy Docker image is available! (${version})\n\n`;
126
+ const TXT_NEW_CLI_VERSION = (version) => `A new version of bdy is available! (${version})\n\n`;
127
+ const TXT_NEW_AGENT_VERSION = () => 'Agent upgrade required. Update the agent by running:\n`bdy agent update`\n\n';
129
128
  const TXT_DISABLING_AGENT = 'Uninstalling agent...';
130
129
  const TXT_ENABLING_AGENT = 'Installing agent...';
131
130
  const TXT_UPDATING_AGENT = 'Updating agent...';
@@ -413,7 +412,6 @@ module.exports = {
413
412
  TXT_NEW_CLI_DOCKER_VERSION,
414
413
  TXT_NEW_CLI_VERSION,
415
414
  TXT_NEW_AGENT_VERSION,
416
- TXT_NEW_CLI_AGENT_VERSION,
417
415
  ERR_WHITELIST_IS_NOT_VALID,
418
416
  ERR_USER_AGENT_IS_NOT_VALID,
419
417
  ERR_AGENT_ADMIN_RIGHTS,