bdy 1.22.20-dev → 1.22.22-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/distTs/package.json +1 -1
- package/distTs/src/texts.js +6 -3
- package/distTs/src/tunnel/server/ssh.js +17 -12
- package/package.json +1 -1
package/distTs/package.json
CHANGED
package/distTs/src/texts.js
CHANGED
|
@@ -20,7 +20,7 @@ const utils_1 = require("./utils");
|
|
|
20
20
|
exports.ERR_REST_API_GENERAL_ERROR = 'Something went wrong';
|
|
21
21
|
exports.ERR_REST_API_NOT_RESPONDING = 'Api endpoint not responding. Try again later...';
|
|
22
22
|
exports.ERR_REST_API_CONNECT_ERROR = 'Connection refused. Check selected endpoint';
|
|
23
|
-
exports.ERR_REST_API_WRONG_TOKEN =
|
|
23
|
+
exports.ERR_REST_API_WRONG_TOKEN = "Unauthorized (401): Invalid or missing token. Run 'buddy login' to authenticate";
|
|
24
24
|
exports.ERR_REST_API_RESOURCE_NOT_FOUND = 'Resource not found';
|
|
25
25
|
const ERR_REST_API_RATE_LIMIT = (rateLimitReset) => {
|
|
26
26
|
if (rateLimitReset) {
|
|
@@ -812,6 +812,9 @@ const ERR_API_MESSAGE_REPLACER = (message, path, baseUrl, rateLimitTs) => {
|
|
|
812
812
|
workspaceUrl = (0, utils_1.getAppWorkspaceSettingsUrl)(baseUrl, m[1]);
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
+
if (message === 'Rate limit exceeded') {
|
|
816
|
+
return (0, exports.ERR_REST_API_RATE_LIMIT)(rateLimitTs);
|
|
817
|
+
}
|
|
815
818
|
if (message === 'API is disabled in this workspace') {
|
|
816
819
|
message =
|
|
817
820
|
'API is disabled in this workspace. To enable it, ask a workspace admin to update the settings';
|
|
@@ -819,8 +822,8 @@ const ERR_API_MESSAGE_REPLACER = (message, path, baseUrl, rateLimitTs) => {
|
|
|
819
822
|
message += `: ${workspaceUrl}`;
|
|
820
823
|
}
|
|
821
824
|
}
|
|
822
|
-
if (message === '
|
|
823
|
-
|
|
825
|
+
else if (message === 'Access denied') {
|
|
826
|
+
message = "You don't have permission to perform this action";
|
|
824
827
|
}
|
|
825
828
|
return message;
|
|
826
829
|
};
|
|
@@ -40,7 +40,7 @@ class ServerSsh extends events_1.default {
|
|
|
40
40
|
this.password = password;
|
|
41
41
|
this.server = new ssh2_1.default.Server({
|
|
42
42
|
hostKeys: [hostKey],
|
|
43
|
-
highWaterMark:
|
|
43
|
+
highWaterMark: 65536,
|
|
44
44
|
ident: 'ssh2 server',
|
|
45
45
|
}, (client) => this.processClient(client));
|
|
46
46
|
this.server.listen();
|
|
@@ -251,20 +251,25 @@ class ServerSsh extends events_1.default {
|
|
|
251
251
|
session.on('close', () => closeSession());
|
|
252
252
|
session.on('end', () => closeSession());
|
|
253
253
|
session.on('eof', () => {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
// fix for sftp/scp exit status -1: send exit-status before EOF https://github.com/mscdex/ssh2/pull/1492
|
|
255
|
+
if (sftp) {
|
|
256
|
+
try {
|
|
257
|
+
logger_1.default.debug('sftp eof: sending exit-status 0');
|
|
258
|
+
session.exit(0);
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
// do nothing
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// @ts-ignore fix for sftp channel not ending properly https://github.com/mscdex/ssh2/pull/1111
|
|
265
|
+
if (session._channel) {
|
|
266
|
+
try {
|
|
262
267
|
// @ts-ignore
|
|
263
268
|
session._channel.end();
|
|
264
269
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
270
|
+
catch {
|
|
271
|
+
// do nothing
|
|
272
|
+
}
|
|
268
273
|
}
|
|
269
274
|
});
|
|
270
275
|
session.on('pty', (accept, reject, info) => {
|