mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-23 17:43:20 +00:00
Add opt-in Unicode NFC path identity for CouchDB
This commit is contained in:
1 parent
72dc88c7ef
commit
ddb4d52931
39 files changed
+2245
-97
No files matched your search
@@ -139,6 +139,7 @@
|
||||
"Copy Report to clipboard": "Copy Report to clipboard",
|
||||
"CouchDB Configuration": "CouchDB Configuration",
|
||||
"CouchDB Connection Tweak": "CouchDB Connection Tweak",
|
||||
"CouchDB only. Version 0 preserves legacy path identity; version 1 uses Unicode NFC. Physical file names stay unchanged. Update every device and stop synchronisation, then Rebuild both databases from a complete authoritative Vault and Fetch on the other devices. Resolve colliding file names first. P2P and Object Storage do not support version 1.": "CouchDB only. Version 0 preserves legacy path identity; version 1 uses Unicode NFC. Physical file names stay unchanged. Update every device and stop synchronisation, then Rebuild both databases from a complete authoritative Vault and Fetch on the other devices. Resolve colliding file names first. P2P and Object Storage do not support version 1.",
|
||||
"CouchDB validates the database name when you connect. The name must not be empty.": "CouchDB validates the database name when you connect. The name must not be empty.",
|
||||
"Create or connect to database and continue": "Create or connect to database and continue",
|
||||
"Create P2P remote": "Create P2P remote",
|
||||
@@ -404,6 +405,7 @@
|
||||
"lang-zh": "简体中文",
|
||||
"lang-zh-tw": "繁體中文",
|
||||
"Later": "Later",
|
||||
"Legacy path identity": "Legacy path identity",
|
||||
"Limit: {datetime} ({timestamp})": "Limit: {datetime} ({timestamp})",
|
||||
"live": "live",
|
||||
"LiveSync could not handle multiple vaults which have same name without different prefix, This should be automatically configured.": "LiveSync could not handle multiple vaults which have same name without different prefix, This should be automatically configured.",
|
||||
@@ -792,6 +794,7 @@
|
||||
"Paste a connection string": "Paste a connection string",
|
||||
"Paste the Setup URI generated from one of your active devices.": "Paste the Setup URI generated from one of your active devices.",
|
||||
"Path": "Path",
|
||||
"Path identity mode": "Path identity mode",
|
||||
"Path Obfuscation": "Path Obfuscation",
|
||||
"Patterns to match files for overwriting instead of merging": "Patterns to match files for overwriting instead of merging",
|
||||
"Patterns to match files for syncing": "Patterns to match files for syncing",
|
||||
@@ -1449,6 +1452,7 @@
|
||||
"Ui.SetupWizard.SetupRemote.ProceedCouchDb": "Continue to CouchDB setup",
|
||||
"Ui.SetupWizard.SetupRemote.ProceedP2P": "Continue to P2P setup",
|
||||
"Ui.SetupWizard.SetupRemote.Title": "Choose a synchronisation remote",
|
||||
"Unicode NFC path identity": "Unicode NFC path identity",
|
||||
"Unique name between all synchronized devices. To edit this setting, please disable customization sync once.": "Unique name between all synchronized devices. To edit this setting, please disable customization sync once.",
|
||||
"Unless you are certain, selecting this options is bit dangerous. It assumes that the server configuration is compatible with this device. If this is not the case, data loss may occur. Please ensure you know what you are doing.": "Unless you are certain, selecting this options is bit dangerous. It assumes that the server configuration is compatible with this device. If this is not the case, data loss may occur. Please ensure you know what you are doing.",
|
||||
"Updating list...": "Updating list...",
|
||||
|
||||
@@ -169,6 +169,8 @@ Copy: Copy
|
||||
Copy Report to clipboard: Copy Report to clipboard
|
||||
CouchDB Configuration: CouchDB Configuration
|
||||
CouchDB Connection Tweak: CouchDB Connection Tweak
|
||||
"CouchDB only. Version 0 preserves legacy path identity; version 1 uses Unicode NFC. Physical file names stay unchanged. Update every device and stop synchronisation, then Rebuild both databases from a complete authoritative Vault and Fetch on the other devices. Resolve colliding file names first. P2P and Object Storage do not support version 1.":
|
||||
"CouchDB only. Version 0 preserves legacy path identity; version 1 uses Unicode NFC. Physical file names stay unchanged. Update every device and stop synchronisation, then Rebuild both databases from a complete authoritative Vault and Fetch on the other devices. Resolve colliding file names first. P2P and Object Storage do not support version 1."
|
||||
CouchDB validates the database name when you connect. The name must not be empty.:
|
||||
CouchDB validates the database name when you connect. The name must not be
|
||||
empty.
|
||||
@@ -556,6 +558,7 @@ lang-ru: Русский
|
||||
lang-zh: 简体中文
|
||||
lang-zh-tw: 繁體中文
|
||||
Later: Later
|
||||
Legacy path identity: Legacy path identity
|
||||
"Limit: {datetime} ({timestamp})": "Limit: {datetime} ({timestamp})"
|
||||
live: live
|
||||
LiveSync could not handle multiple vaults which have same name without different prefix, This should be automatically configured.:
|
||||
@@ -1251,6 +1254,7 @@ password: password
|
||||
Password: Password
|
||||
Paste a connection string: Paste a connection string
|
||||
Path: Path
|
||||
Path identity mode: Path identity mode
|
||||
Path Obfuscation: Path Obfuscation
|
||||
Patterns to match files for overwriting instead of merging: Patterns to match files for overwriting instead of merging
|
||||
Patterns to match files for syncing: Patterns to match files for syncing
|
||||
@@ -2042,6 +2046,7 @@ TweakMismatchResolve:
|
||||
TweakResolving: Configuration Mismatch Detected
|
||||
UseRemoteConfig: Use Remote Configuration
|
||||
AutoAcceptCompatible: Auto-Accept Available
|
||||
Unicode NFC path identity: Unicode NFC path identity
|
||||
Unique name between all synchronized devices. To edit this setting, please disable customization sync once.:
|
||||
Unique name between all synchronized devices. To edit this setting, please
|
||||
disable customization sync once.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { RemoteDBSettings } from "@vrtmrz/livesync-commonlib/compat/common/types";
|
||||
import { usesEncryptedInternalMetadata } from "@vrtmrz/livesync-commonlib/replication";
|
||||
import { getPathNormalizationVersion } from "@vrtmrz/livesync-commonlib/settings";
|
||||
|
||||
type EndpointProjection = readonly [kind: "url" | "invalid-url", value: string];
|
||||
|
||||
@@ -44,17 +45,18 @@ function projectHeaders(value: string): readonly (readonly [name: string, value:
|
||||
|
||||
function projectRemoteSecurity(settings: RemoteDBSettings) {
|
||||
return [
|
||||
getPathNormalizationVersion(settings),
|
||||
settings.idDerivationVersion,
|
||||
settings.idDerivationKey,
|
||||
settings.encrypt
|
||||
? ([
|
||||
"encrypted",
|
||||
settings.passphrase,
|
||||
settings.useDynamicIterationCount,
|
||||
settings.E2EEAlgorithm,
|
||||
settings.permitEmptyPassphrase,
|
||||
] as const)
|
||||
: (["plain"] as const),
|
||||
? ([
|
||||
"encrypted",
|
||||
settings.passphrase,
|
||||
settings.useDynamicIterationCount,
|
||||
settings.E2EEAlgorithm,
|
||||
settings.permitEmptyPassphrase,
|
||||
] as const)
|
||||
: (["plain"] as const),
|
||||
] as const;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,30 @@ import {
|
||||
} from "./replicatorConfigurationIdentity";
|
||||
|
||||
describe("active Replicator configuration identity", () => {
|
||||
it("replaces a connection when the path identity mode changes", () => {
|
||||
const previous = configuredSettings({ pathNormalizationVersion: 0 });
|
||||
const next = { ...previous, pathNormalizationVersion: 1 as const };
|
||||
expect(getCouchDBReplicatorConfigurationIdentity(next)).not.toBe(
|
||||
getCouchDBReplicatorConfigurationIdentity(previous)
|
||||
);
|
||||
expect(getObjectStorageReplicatorConfigurationIdentity(next)).not.toBe(
|
||||
getObjectStorageReplicatorConfigurationIdentity(previous)
|
||||
);
|
||||
});
|
||||
|
||||
it("treats a missing path identity mode as version 0", () => {
|
||||
const missingVersion = configuredSettings();
|
||||
Reflect.deleteProperty(missingVersion, "pathNormalizationVersion");
|
||||
const explicitVersion0 = { ...missingVersion, pathNormalizationVersion: 0 as const };
|
||||
|
||||
expect(getCouchDBReplicatorConfigurationIdentity(explicitVersion0)).toBe(
|
||||
getCouchDBReplicatorConfigurationIdentity(missingVersion)
|
||||
);
|
||||
expect(getObjectStorageReplicatorConfigurationIdentity(explicitVersion0)).toBe(
|
||||
getObjectStorageReplicatorConfigurationIdentity(missingVersion)
|
||||
);
|
||||
});
|
||||
|
||||
function configuredSettings(overrides: Partial<ObsidianLiveSyncSettings> = {}): ObsidianLiveSyncSettings {
|
||||
return Object.assign(createNewVaultSettings(), {
|
||||
activeConfigurationId: "profile-a",
|
||||
|
||||
Reference in new issue
Block a user