tabby-rdp 0.5.5 → 0.5.7
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/CHANGELOG.md +55 -0
- package/README.md +15 -5
- package/dist/desktop.service.js +201 -26
- package/dist/desktops.js +46 -11
- package/dist/diagnosticLog.js +106 -0
- package/dist/ironrdp.js +3 -2
- package/dist/rdpProfile.js +14 -6
- package/dist/sessionLog.js +5 -0
- package/dist/settingsPage.js +17 -0
- package/dist/signin.js +56 -31
- package/dist/ui.js +3 -0
- package/package.json +5 -3
- package/vendor/SHA256SUMS +6 -3
- package/vendor/iron-remote-desktop-rdp.js +297 -297
- package/vendor/ironrdp-factory.js +299 -299
- package/vendor/ironrdp_web_bg.wasm +0 -0
- package/npm-shrinkwrap.json +0 -53
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiagnosticLog = exports.MAX_BYTES = exports.MAX_LINE = exports.DIAGNOSTIC_LEVELS = void 0;
|
|
4
|
+
exports.diagnosticLevel = diagnosticLevel;
|
|
5
|
+
exports.logDirectory = logDirectory;
|
|
6
|
+
exports.washed = washed;
|
|
7
|
+
exports.logFileName = logFileName;
|
|
8
|
+
/**
|
|
9
|
+
* A desktop's diagnostic log file (Settings › Remote Desktop › Settings › Diagnostics): what the connection does, from
|
|
10
|
+
* the plugin and from IronRDP at its debug or trace level, for a bug report. One file per desktop opened while the
|
|
11
|
+
* setting is on, named after the time and the desktop, in a folder of the user's own, readable by the user alone
|
|
12
|
+
* (mode 600 in a 700 folder; on Windows, the roaming profile's own permissions).
|
|
13
|
+
*
|
|
14
|
+
* What is written is washed first (see `washed`): IronRDP's licensing and security PDUs print their keying material
|
|
15
|
+
* as its length only (its patch 56), and anything that still looks like a key, a token or a blob of bytes is replaced
|
|
16
|
+
* with its length here too, so a trace a user hands over carries the shape of the exchange and not its secrets.
|
|
17
|
+
*/
|
|
18
|
+
const fs = require("fs");
|
|
19
|
+
const os = require("os");
|
|
20
|
+
const path = require("path");
|
|
21
|
+
exports.DIAGNOSTIC_LEVELS = ['off', 'debug', 'trace'];
|
|
22
|
+
function diagnosticLevel(value) {
|
|
23
|
+
return value === 'debug' || value === 'trace' ? value : 'off';
|
|
24
|
+
}
|
|
25
|
+
/** Where the files go: next to Tabby's config (its own, per-user folder), or in the home folder without one. */
|
|
26
|
+
function logDirectory(configPath) {
|
|
27
|
+
return configPath ? path.join(path.dirname(configPath), 'tabby-rdp-logs') : path.join(os.homedir(), '.tabby-rdp-logs');
|
|
28
|
+
}
|
|
29
|
+
/** The longest a line is kept (a PDU printed whole can run to megabytes). */
|
|
30
|
+
exports.MAX_LINE = 4096;
|
|
31
|
+
/** The most a file takes; past it, a last line says so and the rest is dropped. */
|
|
32
|
+
exports.MAX_BYTES = 32 * 1024 * 1024;
|
|
33
|
+
/**
|
|
34
|
+
* `line` with what could be a secret taken out: a list of bytes as Rust prints one (`[12, 34, …]`, eight or more),
|
|
35
|
+
* a run of 32 or more hex digits (a key, a token, a fingerprint), and the proxy's token where one is given. Each is
|
|
36
|
+
* replaced with its length, so that the shape of what was logged stays.
|
|
37
|
+
*/
|
|
38
|
+
function washed(line, token) {
|
|
39
|
+
if (token) {
|
|
40
|
+
line = line.split(token).join('<token withheld>');
|
|
41
|
+
}
|
|
42
|
+
line = line.replace(/\[\s*(?:\d{1,3}\s*,\s*){7,}\d{1,3}\s*,?\s*\]/g, list => `<${(list.match(/\d{1,3}/g) ?? []).length} bytes withheld>`);
|
|
43
|
+
line = line.replace(/\b[0-9A-Fa-f]{32,}\b/g, hex => `<${hex.length} hex digits withheld>`);
|
|
44
|
+
return line;
|
|
45
|
+
}
|
|
46
|
+
/** What the log file is named: the moment it was opened and the desktop, as a file name can have them. */
|
|
47
|
+
function logFileName(name, at = new Date()) {
|
|
48
|
+
const stamp = at.toISOString().replace(/\.\d+Z$/, '').replace('T', '_').replace(/:/g, '-');
|
|
49
|
+
const safe = name.replace(/[^\p{L}\p{N}._@-]+/gu, '_').replace(/^[._]+|[._]+$/g, '').slice(0, 60) || 'desktop';
|
|
50
|
+
return `tabby-rdp_${stamp}_${safe}.log`;
|
|
51
|
+
}
|
|
52
|
+
class DiagnosticLog {
|
|
53
|
+
constructor(dir, name, level, token = () => null, header = []) {
|
|
54
|
+
this.level = level;
|
|
55
|
+
this.token = token;
|
|
56
|
+
this.tail = Promise.resolve();
|
|
57
|
+
this.written = 0;
|
|
58
|
+
this.full = false;
|
|
59
|
+
this.closed = false;
|
|
60
|
+
/** Why the file couldn't be opened, if it couldn't. */
|
|
61
|
+
this.failure = null;
|
|
62
|
+
this.file = path.join(dir, logFileName(name));
|
|
63
|
+
this.handle = fs.promises.mkdir(dir, { recursive: true, mode: 0o700 })
|
|
64
|
+
.then(() => fs.promises.open(this.file, 'a', 0o600))
|
|
65
|
+
.catch((error) => {
|
|
66
|
+
this.failure = error?.message ?? String(error);
|
|
67
|
+
return null;
|
|
68
|
+
});
|
|
69
|
+
this.line('log', `tabby-rdp diagnostic log, level ${level}: ${name}`);
|
|
70
|
+
for (const text of header) {
|
|
71
|
+
this.line('log', text);
|
|
72
|
+
}
|
|
73
|
+
this.line('log', 'Keys, passwords, licenses, tokens and other byte strings are left out of this file (shown as their length).');
|
|
74
|
+
}
|
|
75
|
+
/** Writes a line as `<time> <source> <text>`, washed and cut; from the plugin (`source` 'plugin') or IronRDP. */
|
|
76
|
+
line(source, text) {
|
|
77
|
+
if (this.closed || this.full) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const cut = text.length > exports.MAX_LINE ? `${text.slice(0, exports.MAX_LINE)}… (${text.length - exports.MAX_LINE} characters more)` : text;
|
|
81
|
+
const entry = `${new Date().toISOString()} ${source} ${washed(cut, this.token())}\n`;
|
|
82
|
+
this.written += entry.length;
|
|
83
|
+
let out = entry;
|
|
84
|
+
if (this.written > exports.MAX_BYTES) {
|
|
85
|
+
this.full = true;
|
|
86
|
+
out = `${new Date().toISOString()} log The log has reached ${exports.MAX_BYTES / 1024 / 1024} MB; nothing more is written.\n`;
|
|
87
|
+
}
|
|
88
|
+
this.tail = this.tail.then(async () => {
|
|
89
|
+
const handle = await this.handle;
|
|
90
|
+
await handle?.appendFile(out);
|
|
91
|
+
}).catch(() => undefined);
|
|
92
|
+
}
|
|
93
|
+
/** Writes what is queued and closes the file. */
|
|
94
|
+
close() {
|
|
95
|
+
if (this.closed) {
|
|
96
|
+
return this.tail;
|
|
97
|
+
}
|
|
98
|
+
this.closed = true;
|
|
99
|
+
this.tail = this.tail.then(async () => {
|
|
100
|
+
const handle = await this.handle;
|
|
101
|
+
await handle?.close();
|
|
102
|
+
}).catch(() => undefined);
|
|
103
|
+
return this.tail;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.DiagnosticLog = DiagnosticLog;
|
package/dist/ironrdp.js
CHANGED
|
@@ -7,7 +7,8 @@ class IronRDPLoader {
|
|
|
7
7
|
this.load = load;
|
|
8
8
|
this.source = null;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/** `logSink`: given each of the instance's log lines in place of the console (the diagnostic log file). */
|
|
11
|
+
async create(level, logSink) {
|
|
11
12
|
const pending = this.source ??= this.load();
|
|
12
13
|
let source;
|
|
13
14
|
try {
|
|
@@ -20,7 +21,7 @@ class IronRDPLoader {
|
|
|
20
21
|
throw error;
|
|
21
22
|
}
|
|
22
23
|
// A failed/trapped instance does not invalidate shared compiled code or another desktop's instance.
|
|
23
|
-
return source.createBackend(source.module, level);
|
|
24
|
+
return source.createBackend(source.module, level, logSink);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
exports.IronRDPLoader = IronRDPLoader;
|
package/dist/rdpProfile.js
CHANGED
|
@@ -135,7 +135,7 @@ let RDPProfileSettingsComponent = class RDPProfileSettingsComponent {
|
|
|
135
135
|
const o = this.profile.options;
|
|
136
136
|
const account = () => `${o.username ?? ''}\n${o.domain ?? ''}\n${o.account ?? ''}`;
|
|
137
137
|
// No id for a new profile (no address yet): it has nothing saved to take along.
|
|
138
|
-
this.before = { id: o.host ? (0, desktops_1.desktopIdOf)(o) : '', account: account(), via: o.via ?? '', gateway: o.gateway ?? '' };
|
|
138
|
+
this.before = { id: o.host ? (0, desktops_1.desktopIdOf)(o) : '', account: account(), user: (0, desktops_1.signsInAs)(o), via: o.via ?? '', gateway: o.gateway ?? '' };
|
|
139
139
|
const root = this.element.nativeElement;
|
|
140
140
|
root.innerHTML = `
|
|
141
141
|
<div class="mb-3">
|
|
@@ -285,7 +285,9 @@ let RDPProfileSettingsComponent = class RDPProfileSettingsComponent {
|
|
|
285
285
|
}
|
|
286
286
|
o.gateway = gatewayText;
|
|
287
287
|
}
|
|
288
|
-
const { id, account, via, gateway } = this.before;
|
|
288
|
+
const { id, account, user, via, gateway } = this.before;
|
|
289
|
+
// Another profile for the same address keeps what it signs in with there (see RemoteDesktopService.directInUse).
|
|
290
|
+
const users = { user, except: this.profile.id };
|
|
289
291
|
if (!id) {
|
|
290
292
|
return;
|
|
291
293
|
}
|
|
@@ -294,7 +296,7 @@ let RDPProfileSettingsComponent = class RDPProfileSettingsComponent {
|
|
|
294
296
|
// (see RDPProfilesService.deleteProfile). Not for the type's or a group's defaults, which have no id of
|
|
295
297
|
// their own (an empty address is useful there): profiles that name that address keep what is saved for it.
|
|
296
298
|
if (!via && this.profile.id) {
|
|
297
|
-
this.injector.get(desktop_service_1.RemoteDesktopService).forgetDesktop(id, true, `"${this.profile.name}"
|
|
299
|
+
this.injector.get(desktop_service_1.RemoteDesktopService).forgetDesktop(id, true, `"${this.profile.name}"`, users).catch(() => null);
|
|
298
300
|
}
|
|
299
301
|
return;
|
|
300
302
|
}
|
|
@@ -303,13 +305,13 @@ let RDPProfileSettingsComponent = class RDPProfileSettingsComponent {
|
|
|
303
305
|
// it had before included) and certificate were its own; one behind a host shares them with that host's
|
|
304
306
|
// desktop at the same address, so they stay.
|
|
305
307
|
if (!via) {
|
|
306
|
-
this.injector.get(desktop_service_1.RemoteDesktopService).forgetDesktop(id, true, `"${this.profile.name}"
|
|
308
|
+
this.injector.get(desktop_service_1.RemoteDesktopService).forgetDesktop(id, true, `"${this.profile.name}"`, users).catch(() => null);
|
|
307
309
|
}
|
|
308
310
|
return;
|
|
309
311
|
}
|
|
310
312
|
// Its saved password goes with its way there (see desktopEdited): another gateway is asked for again.
|
|
311
313
|
const accountChanged = `${o.username ?? ''}\n${o.domain ?? ''}\n${o.account ?? ''}` !== account;
|
|
312
|
-
this.injector.get(desktop_service_1.RemoteDesktopService).desktopEdited(id, (0, desktops_1.desktopIdOf)(o), accountChanged, !via, { from: gateway, to: o.gateway }).catch(() => null);
|
|
314
|
+
this.injector.get(desktop_service_1.RemoteDesktopService).desktopEdited(id, (0, desktops_1.desktopIdOf)(o), accountChanged, !via, { from: gateway, to: o.gateway }, via ? undefined : { from: user, to: (0, desktops_1.signsInAs)(o), except: this.profile.id }).catch(() => null);
|
|
313
315
|
}
|
|
314
316
|
};
|
|
315
317
|
exports.RDPProfileSettingsComponent = RDPProfileSettingsComponent;
|
|
@@ -406,7 +408,13 @@ let RDPProfilesService = class RDPProfilesService extends tabby_core_1.QuickConn
|
|
|
406
408
|
// its own; one behind a host shares them with that host's desktop at the same address. A profile without an
|
|
407
409
|
// address of its own leads to no desktop of its own: desktopIdOf would name 127.0.0.1:3389 for it.
|
|
408
410
|
if (!profile.options.via && (0, desktops_1.configText)(profile.options.host)) {
|
|
409
|
-
|
|
411
|
+
// Its user as it signed in, its group's defaults included; other profiles for the address keep theirs.
|
|
412
|
+
let options = profile.options;
|
|
413
|
+
try {
|
|
414
|
+
options = this.injector.get(tabby_core_1.ProfilesService).getConfigProxyForProfile(profile).options;
|
|
415
|
+
}
|
|
416
|
+
catch { }
|
|
417
|
+
this.injector.get(desktop_service_1.RemoteDesktopService).forgetDesktop((0, desktops_1.desktopIdOf)(profile.options), true, `"${profile.name}"`, { user: (0, desktops_1.signsInAs)(options), except: profile.id }).catch(() => null);
|
|
410
418
|
}
|
|
411
419
|
}
|
|
412
420
|
};
|
package/dist/sessionLog.js
CHANGED
|
@@ -25,6 +25,8 @@ class SessionLog extends Array {
|
|
|
25
25
|
super(...arguments);
|
|
26
26
|
/** How many lines were left out so far. */
|
|
27
27
|
this.dropped = 0;
|
|
28
|
+
/** Given each line as it is pushed, whole (the diagnostic log file, while one is written). */
|
|
29
|
+
this.tee = null;
|
|
28
30
|
}
|
|
29
31
|
// What is made from the log (filter, slice, map) is a plain array.
|
|
30
32
|
static get [Symbol.species]() {
|
|
@@ -33,6 +35,9 @@ class SessionLog extends Array {
|
|
|
33
35
|
push(...lines) {
|
|
34
36
|
const { FIRST, LATEST, MAX_LINE } = SessionLog;
|
|
35
37
|
super.push(...lines.map(line => typeof line === 'string' ? copied(line.length > MAX_LINE ? `${line.slice(0, MAX_LINE)}…` : line) : line));
|
|
38
|
+
if (this.tee) {
|
|
39
|
+
lines.forEach(line => this.tee(String(line)));
|
|
40
|
+
}
|
|
36
41
|
// Once the latest lines are twice as many as are kept, the older half of them goes in one step: each line then
|
|
37
42
|
// costs the same however many come.
|
|
38
43
|
const said = this.dropped ? 1 : 0;
|
package/dist/settingsPage.js
CHANGED
|
@@ -319,6 +319,22 @@ let RemoteDesktopSettingsComponent = class RemoteDesktopSettingsComponent {
|
|
|
319
319
|
</select>
|
|
320
320
|
</div>
|
|
321
321
|
|
|
322
|
+
<h5>Diagnostics</h5>
|
|
323
|
+
<div class="form-line">
|
|
324
|
+
<div class="header">
|
|
325
|
+
<div class="title">Write a log file</div>
|
|
326
|
+
<div class="description">For a bug report: each desktop opened from now on writes what its connection does, with
|
|
327
|
+
IronRDP's log at this level, to a file of its own in <a data-action="logs">the log folder</a>, readable by you
|
|
328
|
+
alone. Debug is what a report needs; Trace is far larger.
|
|
329
|
+
${this.info('Keys, passwords, licenses, tokens and other byte strings are left out of the file, shown as their length. Names (yours, the desktop\'s, its address) stay: look through the file before you attach it to a report.')}</div>
|
|
330
|
+
</div>
|
|
331
|
+
<select class="form-control" data-setting="diagnosticLog">
|
|
332
|
+
<option value="off">Off</option>
|
|
333
|
+
<option value="debug">Debug</option>
|
|
334
|
+
<option value="trace">Trace</option>
|
|
335
|
+
</select>
|
|
336
|
+
</div>
|
|
337
|
+
|
|
322
338
|
</section>
|
|
323
339
|
|
|
324
340
|
<section data-topic="osd">
|
|
@@ -470,6 +486,7 @@ let RemoteDesktopSettingsComponent = class RemoteDesktopSettingsComponent {
|
|
|
470
486
|
desktop: () => this.newProfile(),
|
|
471
487
|
folder: () => this.shareFolder(),
|
|
472
488
|
profiles: () => this.showTabbySettings('profiles'),
|
|
489
|
+
logs: () => this.desktop.showLogFolder(),
|
|
473
490
|
'osd-white': () => this.changeOsd({ color: '' }),
|
|
474
491
|
'osd-try': () => {
|
|
475
492
|
if (!this.desktop.showOsdEverywhere()) {
|
package/dist/signin.js
CHANGED
|
@@ -18,6 +18,7 @@ exports.gatewayScope = gatewayScope;
|
|
|
18
18
|
exports.isFor = isFor;
|
|
19
19
|
exports.forgetCredentialsFor = forgetCredentialsFor;
|
|
20
20
|
exports.moveCredentialsFor = moveCredentialsFor;
|
|
21
|
+
exports.adoptCredentials = adoptCredentials;
|
|
21
22
|
exports.forgetFormerKey = forgetFormerKey;
|
|
22
23
|
exports.askCredentials = askCredentials;
|
|
23
24
|
/**
|
|
@@ -68,8 +69,9 @@ function vaultKey(key) {
|
|
|
68
69
|
return { key };
|
|
69
70
|
}
|
|
70
71
|
function vaultName(key) {
|
|
71
|
-
const { target, desktopId, gateway } = (0, desktops_1.keyParts)(key);
|
|
72
|
-
const
|
|
72
|
+
const { target, desktopId, user, gateway } = (0, desktops_1.keyParts)(key);
|
|
73
|
+
const as = user ? ` as ${user.slice('@user#'.length).replace(/%([0-9A-F]{2})/g, (_, hex) => String.fromCharCode(parseInt(hex, 16)))}` : '';
|
|
74
|
+
const where = `${desktopId}${as}${gateway ? gateway.replace('@gateway#', ' through gateway ') : ''}`;
|
|
73
75
|
return target === 'account' ? `saved account` : target === desktops_1.DIRECT_KEY ? `${where} (direct)` : desktopId ? `${where} behind ${target}` : target;
|
|
74
76
|
}
|
|
75
77
|
// The system keychain can keep a call waiting indefinitely: on Linux, a locked or missing keyring waits for an unlock
|
|
@@ -208,12 +210,6 @@ async function keychainOnce(mark, forgets) {
|
|
|
208
210
|
await keychain(store => store.setPassword(KEYCHAIN_SERVICE, mark, 'done'));
|
|
209
211
|
return true;
|
|
210
212
|
}
|
|
211
|
-
/**
|
|
212
|
-
* Forgets that couldn't be done when they were asked for (see forgetLater), each of one store's part: the Vault's
|
|
213
|
-
* (`inVault`), or the keychain's. Each is done the next time its store is used and can be read (see used, doLater),
|
|
214
|
-
* and what it would forget isn't looked up in that store meanwhile (see withheld). `saved`: keys a password was saved
|
|
215
|
-
* under in that store since, which is a new one, and stays. Kept in this window's memory, for as long as it is open.
|
|
216
|
-
*/
|
|
217
213
|
const later = [];
|
|
218
214
|
let laterRunning = null;
|
|
219
215
|
/**
|
|
@@ -318,20 +314,17 @@ async function loadCredentials(key) {
|
|
|
318
314
|
return null;
|
|
319
315
|
}
|
|
320
316
|
async function loadSaved(key) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
return found;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
catch { }
|
|
330
|
-
}
|
|
331
|
-
if (withheld(key, false)) {
|
|
317
|
+
return await loadIn(true, key) ?? await loadIn(false, key);
|
|
318
|
+
}
|
|
319
|
+
/** What one store (the Vault while it is on, or with `inVault` false the keychain) has under `key`, or null. */
|
|
320
|
+
async function loadIn(inVault, key) {
|
|
321
|
+
if (withheld(key, inVault)) {
|
|
332
322
|
return null;
|
|
333
323
|
}
|
|
334
324
|
try {
|
|
325
|
+
if (inVault) {
|
|
326
|
+
return vaultOn() ? parseCredentials((await vault.getSecret(exports.VAULT_SECRET_TYPE, vaultKey(key)))?.value) : null;
|
|
327
|
+
}
|
|
335
328
|
return parseCredentials(await keychain(store => store.getPassword(KEYCHAIN_SERVICE, key)));
|
|
336
329
|
}
|
|
337
330
|
catch {
|
|
@@ -532,8 +525,13 @@ async function entriesOf(inVault) {
|
|
|
532
525
|
*/
|
|
533
526
|
async function forgetListed(inVault, entries, forgets, kept) {
|
|
534
527
|
let done = true;
|
|
535
|
-
|
|
536
|
-
|
|
528
|
+
const seen = new Set();
|
|
529
|
+
for (const { account: key, password } of entries) {
|
|
530
|
+
if (seen.has(key)) {
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
seen.add(key);
|
|
534
|
+
if (!kept?.has(key) && forgets(key, password)) {
|
|
537
535
|
try {
|
|
538
536
|
await forgetIn(inVault, key);
|
|
539
537
|
}
|
|
@@ -556,14 +554,17 @@ function gatewayScope(gateway) {
|
|
|
556
554
|
return parsed ? `@gateway#${parsed.host}:${parsed.port}` : '';
|
|
557
555
|
}
|
|
558
556
|
/**
|
|
559
|
-
* Whether a credential key is one of a desktop's saved passwords (see SavedFor)
|
|
560
|
-
*
|
|
561
|
-
* matched; a gateway suffix on the key
|
|
557
|
+
* Whether a credential key is one of a desktop's saved passwords (see SavedFor), with `stored`, the login saved there,
|
|
558
|
+
* where it is at hand (see Forgets). Anchored on the key's parts, so an unrelated key that merely ends in `#<id>` (a
|
|
559
|
+
* gateway pin, or a desktop whose own id is a suffix of another's) isn't matched; a user or gateway suffix on the key
|
|
560
|
+
* doesn't change the id.
|
|
562
561
|
*/
|
|
563
|
-
function isFor(account, desktopId, which) {
|
|
564
|
-
const { target, desktopId: id, gateway } = (0, desktops_1.keyParts)(account);
|
|
562
|
+
function isFor(account, desktopId, which, stored) {
|
|
563
|
+
const { target, desktopId: id, user, gateway } = (0, desktops_1.keyParts)(account);
|
|
564
|
+
const unscoped = user === '' && which.user !== undefined && which.user !== '';
|
|
565
|
+
const owned = !unscoped || !which.owns || stored === undefined || (c => !!c && which.owns(c))(parseCredentials(stored));
|
|
565
566
|
return id === desktopId && (which.direct ? target === desktops_1.DIRECT_KEY : target !== desktops_1.DIRECT_KEY && target !== 'gateway' && target !== 'account') &&
|
|
566
|
-
(which.scope === undefined || gateway === which.scope);
|
|
567
|
+
(which.user === undefined || user === which.user || unscoped) && owned && (which.scope === undefined || gateway === which.scope) && !which.keep?.has(account);
|
|
567
568
|
}
|
|
568
569
|
/**
|
|
569
570
|
* Forgets a desktop's saved passwords (see SavedFor; by default those behind any SSH host, for any gateway), from each
|
|
@@ -573,7 +574,7 @@ function isFor(account, desktopId, which) {
|
|
|
573
574
|
* Returns the stores whose part waits (none, as a rule).
|
|
574
575
|
*/
|
|
575
576
|
async function forgetCredentialsFor(desktopId, which = {}) {
|
|
576
|
-
const forgets = (key) => isFor(key, desktopId, which);
|
|
577
|
+
const forgets = (key, stored) => isFor(key, desktopId, which, stored);
|
|
577
578
|
noteForget(forgets);
|
|
578
579
|
await used();
|
|
579
580
|
const waiting = [];
|
|
@@ -609,7 +610,7 @@ async function forgetCredentialsFor(desktopId, which = {}) {
|
|
|
609
610
|
* certificate stays (see RemoteDesktopService.desktopEdited).
|
|
610
611
|
*/
|
|
611
612
|
async function moveCredentialsFor(fromId, toId, which = {}, known = () => false) {
|
|
612
|
-
const forgets = (key) => isFor(key, fromId, which);
|
|
613
|
+
const forgets = (key, stored) => isFor(key, fromId, which, stored);
|
|
613
614
|
noteForget(forgets);
|
|
614
615
|
await used();
|
|
615
616
|
const stores = [];
|
|
@@ -623,8 +624,8 @@ async function moveCredentialsFor(fromId, toId, which = {}, known = () => false)
|
|
|
623
624
|
for (const { account, password } of entries ?? []) {
|
|
624
625
|
const credentials = parseCredentials(password);
|
|
625
626
|
const { target, gateway } = (0, desktops_1.keyParts)(account);
|
|
626
|
-
if (forgets(account) && credentials) {
|
|
627
|
-
const to = `${target}#${toId}${gateway}`;
|
|
627
|
+
if (forgets(account, password) && credentials) {
|
|
628
|
+
const to = `${target}#${toId}${(0, desktops_1.keyParts)(account).user}${gateway}`;
|
|
628
629
|
const pinned = target === desktops_1.DIRECT_KEY || known(`${target}#${fromId}`);
|
|
629
630
|
try {
|
|
630
631
|
if (!taken.has(to) && !known(`${target}#${toId}`) && pinned && !withheld(account, inVault)) {
|
|
@@ -648,6 +649,30 @@ async function moveCredentialsFor(fromId, toId, which = {}, known = () => false)
|
|
|
648
649
|
}
|
|
649
650
|
return waiting;
|
|
650
651
|
}
|
|
652
|
+
/**
|
|
653
|
+
* A direct desktop's saved password from before passwords were kept for each user at an address (0.5.6): under the
|
|
654
|
+
* address alone (`from`), where any profile for that address found it, whoever it was for. Taken to `to`, the key of
|
|
655
|
+
* the desktop's own user (see userScope), where `ours` says it is for that user, and forgotten at `from` in the store
|
|
656
|
+
* it was found in only: the other store (the keychain beside a synced Vault, say) can hold another user's there. Left
|
|
657
|
+
* where it is otherwise, for the desktop it is for. Null where there is none to take.
|
|
658
|
+
*/
|
|
659
|
+
async function adoptCredentials(from, to, ours) {
|
|
660
|
+
await used();
|
|
661
|
+
for (const inVault of [true, false]) {
|
|
662
|
+
const found = await loadIn(inVault, from);
|
|
663
|
+
if (found && ours(found)) {
|
|
664
|
+
// Forgotten there only once saved here: should the store refuse, it is found there again next time.
|
|
665
|
+
try {
|
|
666
|
+
await saveCredentials(to, found);
|
|
667
|
+
noteForget(key => key === from);
|
|
668
|
+
await forgetIn(inVault, from);
|
|
669
|
+
}
|
|
670
|
+
catch { }
|
|
671
|
+
return found;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return null;
|
|
675
|
+
}
|
|
651
676
|
/**
|
|
652
677
|
* A target's key changed from `from`, a key no target has any more, whose saved passwords nothing moves (see
|
|
653
678
|
* RemoteTargets.keyChanged): those under it (its own desktop's and those of the desktops behind it, see rekeyed) are
|
package/dist/ui.js
CHANGED
|
@@ -100,6 +100,9 @@ let RemoteDesktopConfig = class RemoteDesktopConfig extends tabby_core_1.ConfigP
|
|
|
100
100
|
checkUpdates: true,
|
|
101
101
|
// Minutes without a desktop open after which a VM the plugin started is shut down again: 0 (never), 5, 15, 60.
|
|
102
102
|
shutDownIdle: 0,
|
|
103
|
+
// Write each desktop's connection log to a file for a bug report, with IronRDP's log at that level: 'off' |
|
|
104
|
+
// 'debug' | 'trace' (see diagnosticLog.ts).
|
|
105
|
+
diagnosticLog: 'off',
|
|
103
106
|
// The newer version a note was shown for (once per version).
|
|
104
107
|
updateNoted: '',
|
|
105
108
|
// The tip shown the first time a desktop connects (see help.ts) has been shown.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tabby-rdp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Remote desktops in Tabby's SSH tabs: Linux (GNOME) and Windows, through the SSH connection, with clipboard, files and sound. Built on IronRDP.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tabby-plugin",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"!dist/**/*.map",
|
|
30
30
|
"vendor",
|
|
31
31
|
"remote",
|
|
32
|
-
"npm-shrinkwrap.json",
|
|
33
32
|
"LICENSE",
|
|
34
33
|
"CHANGELOG.md",
|
|
35
34
|
"TROUBLESHOOTING.md",
|
|
@@ -38,6 +37,9 @@
|
|
|
38
37
|
"engines": {
|
|
39
38
|
"node": ">=18"
|
|
40
39
|
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"test": "tsx test/run.ts"
|
|
42
|
+
},
|
|
41
43
|
"dependencies": {
|
|
42
44
|
"semver": "7.8.5",
|
|
43
45
|
"ws": "8.21.3"
|
|
@@ -45,6 +47,6 @@
|
|
|
45
47
|
"tabbyRdp": {
|
|
46
48
|
"minimumTabbyVersion": "1.0.236",
|
|
47
49
|
"rollbackFloor": "0.5.3",
|
|
48
|
-
"packageFormat":
|
|
50
|
+
"packageFormat": 3
|
|
49
51
|
}
|
|
50
52
|
}
|
package/vendor/SHA256SUMS
CHANGED
|
@@ -50,8 +50,11 @@ c1cbc903a6f4e5b2261fbfc6d5ef6b5381d441e9360d0358d3151415788432c3 ironrdp/patche
|
|
|
50
50
|
26c833bd77c828f6068be971d217ed79a1a8ffa51093fd4677a51f12f1a5c0e6 ironrdp/patches/0052-fix-graphics-tighten-history-and-fallible-grid-pointer.patch
|
|
51
51
|
b51d75e037581e272cdeb81d16dd02c87b696b9598ec003acb0810878871ec10 ironrdp/patches/0053-fix-egfx-bound-callback-pixels-readback-count-and-retirement.patch
|
|
52
52
|
f32621b910292284f25a1ac7ca38a01d1561f0c1f0c6e29f71b936140a6e31ed ironrdp/patches/0054-fix-web-configure-decoder-cap-and-defer-until-keyframe.patch
|
|
53
|
+
1d035a5fd7e9168bd6fcafbce88cada31c1998a1cc9632bf9cb506c7cf04d7fb ironrdp/patches/0055-fix-connector-answer-Auto-Detect-Requests-that-come-.patch
|
|
54
|
+
5f02fe4afbc2ee3e4c260b9859f6911e3877f8ffa64030f893aba890b637fd6b ironrdp/patches/0056-fix-pdu-keep-license-keying-material-and-licenses-ou.patch
|
|
55
|
+
bcfcd0e1e098093f66ea031a414224945cd694572e74e46e76bd9158cf59da1d ironrdp/patches/0057-feat-web-let-the-host-take-the-log-lines-init-logLev.patch
|
|
53
56
|
08ccf512db2cfe21b16f958eda6fa4b23e052a0c0e91829a4fc2657f8bd8dd4d vendor/IRONRDP-LICENSE
|
|
54
|
-
|
|
57
|
+
a8853ad26ba4a83992861730ffafe403f2be370da21de0328a1494bb5ebe5810 vendor/iron-remote-desktop-rdp.js
|
|
55
58
|
5a6363b9140a5a2abf0218aa39edb38f10445e8d7e9c5a798c321772e1f07c11 vendor/iron-remote-desktop.js
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
512dfaab5d7f8134715d34897603d8c1658fd5375c45241d8db15b90e669bae6 vendor/ironrdp_web_bg.wasm
|
|
60
|
+
72bcfc83321dedd08a3627a4fcf7b220a64bf3376983579267621f5ef6fc0cd5 vendor/ironrdp-factory.js
|