Use existing Setup URI and QR sharing for TURN settings

This commit is contained in:
vorotamoroz
2026-09-15 17:18:40 +00:00
parent 93bc161f20
commit ab55eb5aff
20 changed files with 89 additions and 116 deletions
@@ -16,8 +16,8 @@ export const liveSyncProvisionalEnglishMessages = {
"TURN Key ID": "TURN Key ID",
"TURN Key API Token": "TURN Key API Token",
"Unsupported TURN configuration": "Unsupported TURN configuration",
"The API token is saved with this profile and included in encrypted Setup URI sharing. Temporary TURN credentials are kept in memory only.":
"The API token is saved with this profile and included in encrypted Setup URI sharing. Temporary TURN credentials are kept in memory only.",
"The API token is saved with this profile and included in Setup URI and QR code sharing. Temporary TURN credentials are kept in memory only.":
"The API token is saved with this profile and included in Setup URI and QR code sharing. Temporary TURN credentials are kept in memory only.",
"TURN relay only requires a TURN server or a configured credential source under Advanced Settings.":
"TURN relay only requires a TURN server or a configured credential source under Advanced Settings.",
"TURN relay only requires TURN configuration. Connection path has been restored to Automatic.":
+2 -2
View File
@@ -23,7 +23,7 @@ describe("TURN credentials in diagnostic reports", () => {
id: "inactive",
name: "Inactive TURN",
isEncrypted: false,
uri: `sls+p2p-v2://room?source=${encodeURIComponent(JSON.stringify(source))}`,
uri: `sls+p2p://room?source=${encodeURIComponent(JSON.stringify(source))}`,
},
},
};
@@ -34,7 +34,7 @@ describe("TURN credentials in diagnostic reports", () => {
expect(text).not.toContain(encodeURIComponent(token));
expect(text).not.toContain("private-key");
expect(text).not.toContain("encrypted-private-copy");
expect(report.pluginConfig.remoteConfigurations.inactive.uri).toBe("sls+p2p-v2://");
expect(report.pluginConfig.remoteConfigurations.inactive.uri).toBe("sls+p2p://");
expect(settings.P2P_iceServerSource).toEqual(source);
expect(settings.encryptedP2PIceServerSource).toBe("encrypted-private-copy");
});
+1 -1
View File
@@ -21,7 +21,7 @@ export function redactTurnSourceForReport(settings: Partial<ObsidianLiveSyncSett
}
}
/** Managed connection profiles are shared through encrypted Setup URIs. */
/** Managed connection profiles are shared through Setup URIs and QR codes. */
export function omitManagedTurnProfilesFromMarkdown(settings: Partial<ObsidianLiveSyncSettings>): void {
if (!hasManagedTurnSettings(settings)) return;
delete settings.P2P_iceServerSource;
+2 -2
View File
@@ -20,7 +20,7 @@ function configuredSettings() {
id: "managed",
name: "Managed TURN",
isEncrypted: false,
uri: "sls+p2p-v2://room?source=private-token",
uri: "sls+p2p://room?source=private-token",
},
},
activeConfigurationId: "central",
@@ -42,7 +42,7 @@ describe("managed TURN settings privacy", () => {
settings.P2P_iceServerSource.id = "manual";
expect(hasManagedTurnSettings(settings)).toBe(true);
omitManagedTurnProfilesFromMarkdown(settings);
expect(JSON.stringify(settings)).not.toMatch(/private-token|private-key-id|sls\+p2p-v2/);
expect(JSON.stringify(settings)).not.toMatch(/private-token|private-key-id|sls\+p2p/);
expect(settings).not.toHaveProperty("remoteConfigurations");
expect(settings).not.toHaveProperty("activeConfigurationId");
expect(settings).not.toHaveProperty("P2P_ActiveRemoteConfigurationId");
+1 -1
View File
@@ -51,7 +51,7 @@ export type queueItem = {
export const FileWatchEventQueueMax = 10;
export { configURIBase, configURIBaseV2, configURIBaseQR } from "@vrtmrz/livesync-commonlib/compat/common/types";
export { configURIBase, configURIBaseQR } from "@vrtmrz/livesync-commonlib/compat/common/types";
export {
CHeader,