Compare commits

...

2 Commits

Author SHA1 Message Date
vorotamoroz
4835fce62a bump 2023-09-21 09:44:50 +01:00
vorotamoroz
ff814be4a0 Fixed:
- Now the synchronisation will begin without our interaction.
- No longer puts the configuration of the remote database into the log while checking configuration.
- Some outdated description notes have been removed.
- Options that are meaningless depending on other settings configured are now hidden.
2023-09-21 09:44:07 +01:00
6 changed files with 46 additions and 36 deletions

View File

@@ -1,7 +1,7 @@
{
"id": "obsidian-livesync",
"name": "Self-hosted LiveSync",
"version": "0.19.21",
"version": "0.19.22",
"minAppVersion": "0.9.12",
"description": "Community implementation of self-hosted livesync. Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.",
"author": "vorotamoroz",

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "obsidian-livesync",
"version": "0.19.21",
"version": "0.19.22",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "obsidian-livesync",
"version": "0.19.21",
"version": "0.19.22",
"license": "MIT",
"dependencies": {
"diff-match-patch": "^1.0.5",

View File

@@ -1,6 +1,6 @@
{
"name": "obsidian-livesync",
"version": "0.19.21",
"version": "0.19.22",
"description": "Reflect your vault changes to some other devices immediately. Please make sure to disable other synchronize solutions to avoid content corruption or duplication.",
"main": "main.js",
"type": "module",

View File

@@ -1,5 +1,5 @@
import { App, PluginSettingTab, Setting, sanitizeHTMLToDom, TextAreaComponent, MarkdownRenderer, stringifyYaml } from "./deps";
import { DEFAULT_SETTINGS, type ObsidianLiveSyncSettings, type ConfigPassphraseStore, type RemoteDBSettings, type FilePathWithPrefix, type HashAlgorithm, type DocumentID, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE } from "./lib/src/types";
import { DEFAULT_SETTINGS, type ObsidianLiveSyncSettings, type ConfigPassphraseStore, type RemoteDBSettings, type FilePathWithPrefix, type HashAlgorithm, type DocumentID, LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE, LOG_LEVEL_INFO } from "./lib/src/types";
import { delay } from "./lib/src/utils";
import { Semaphore } from "./lib/src/semaphore";
import { versionNumberString2Number } from "./lib/src/strbin";
@@ -303,6 +303,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
.setDisabled(false)
.onClick(async () => {
const checkConfig = async () => {
Logger(`Checking database configuration`, LOG_LEVEL_INFO);
try {
if (isCloudantURI(this.plugin.settings.couchDB_URI)) {
Logger("This feature cannot be used with IBM Cloudant.", LOG_LEVEL_NOTICE);
@@ -311,8 +312,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
const r = await requestToCouchDB(this.plugin.settings.couchDB_URI, this.plugin.settings.couchDB_USER, this.plugin.settings.couchDB_PASSWORD, window.origin);
Logger(JSON.stringify(r.json, null, 2));
const responseConfig = r.json;
const emptyDiv = createDiv();
@@ -333,16 +332,15 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
tmpDiv.innerHTML = `<label>${title}</label><button>Fix</button>`;
const x = checkResultDiv.appendChild(tmpDiv);
x.querySelector("button").addEventListener("click", async () => {
console.dir({ key, value });
Logger(`CouchDB Configuration: ${title} -> Set ${key} to ${value}`)
const res = await requestToCouchDB(this.plugin.settings.couchDB_URI, this.plugin.settings.couchDB_USER, this.plugin.settings.couchDB_PASSWORD, undefined, key, value);
console.dir(res);
if (res.status == 200) {
Logger(`${title} successfully updated`, LOG_LEVEL_NOTICE);
Logger(`CouchDB Configuration: ${title} successfully updated`, LOG_LEVEL_NOTICE);
checkResultDiv.removeChild(x);
checkConfig();
} else {
Logger(`${title} failed`, LOG_LEVEL_NOTICE);
Logger(res.text);
Logger(`CouchDB Configuration: ${title} failed`, LOG_LEVEL_NOTICE);
Logger(res.text, LOG_LEVEL_VERBOSE);
}
});
};
@@ -352,7 +350,6 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
["ob-btn-config-info"]
);
addResult("Your configuration is dumped to Log", ["ob-btn-config-info"]);
addResult("--Config check--", ["ob-btn-config-head"]);
// Admin check
@@ -453,6 +450,7 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
}
addResult("--Done--", ["ob-btn-config-head"]);
addResult("If you have some trouble with Connection-check even though all Config-check has been passed, Please check your reverse proxy's configuration.", ["ob-btn-config-info"]);
Logger(`Checking configuration done`, LOG_LEVEL_INFO);
} catch (ex) {
Logger(`Checking configuration failed`, LOG_LEVEL_NOTICE);
Logger(ex);
@@ -1183,19 +1181,20 @@ export class ObsidianLiveSyncSettingTab extends PluginSettingTab {
});
}
new Setting(containerSyncSettingEl)
.setName("Scan for hidden files before replication")
.setDesc("This configuration will be ignored if monitoring changes is enabled.")
.setClass("wizardHidden")
.addToggle((toggle) =>
toggle.setValue(this.plugin.settings.syncInternalFilesBeforeReplication).onChange(async (value) => {
this.plugin.settings.syncInternalFilesBeforeReplication = value;
await this.plugin.saveSettings();
})
);
if (!this.plugin.settings.watchInternalFileChanges) {
new Setting(containerSyncSettingEl)
.setName("Scan for hidden files before replication")
.setClass("wizardHidden")
.addToggle((toggle) =>
toggle.setValue(this.plugin.settings.syncInternalFilesBeforeReplication).onChange(async (value) => {
this.plugin.settings.syncInternalFilesBeforeReplication = value;
await this.plugin.saveSettings();
})
);
}
new Setting(containerSyncSettingEl)
.setName("Scan hidden files periodically")
.setDesc("Seconds, 0 to disable. This configuration will be ignored if monitoring changes is enabled.")
.setDesc("Seconds, 0 to disable")
.setClass("wizardHidden")
.addText((text) => {
text.setPlaceholder("")
@@ -1861,16 +1860,18 @@ ${stringifyYaml(pluginConfig)}`;
})
);
new Setting(containerPluginSettings)
.setName("Scan customization periodically")
.setDesc("Scan customization every 1 minute. This configuration will be ignored if monitoring changes of hidden files has been enabled.")
.addToggle((toggle) =>
toggle.setValue(this.plugin.settings.autoSweepPluginsPeriodic).onChange(async (value) => {
this.plugin.settings.autoSweepPluginsPeriodic = value;
updateDisabledOfDeviceAndVaultName();
await this.plugin.saveSettings();
})
);
if (!this.plugin.settings.watchInternalFileChanges) {
new Setting(containerPluginSettings)
.setName("Scan customization periodically")
.setDesc("Scan customization every 1 minute.")
.addToggle((toggle) =>
toggle.setValue(this.plugin.settings.autoSweepPluginsPeriodic).onChange(async (value) => {
this.plugin.settings.autoSweepPluginsPeriodic = value;
updateDisabledOfDeviceAndVaultName();
await this.plugin.saveSettings();
})
);
}
new Setting(containerPluginSettings)
.setName("Notify customized")

View File

@@ -64,7 +64,7 @@ export default class ObsidianLiveSyncPlugin extends Plugin
replicator!: LiveSyncDBReplicator;
statusBar?: HTMLElement;
suspended: boolean = true;
suspended: boolean = false;
deviceAndVaultName: string = "";
isMobile = false;
isReady = false;
@@ -459,8 +459,8 @@ export default class ObsidianLiveSyncPlugin extends Plugin
return false;
}
}
await this.realizeSettingSyncMode();
this.registerWatchEvents();
await this.realizeSettingSyncMode();
this.swapSaveCommand();
if (this.settings.syncOnStart) {
this.replicator.openReplication(this.settings, false, false);

View File

@@ -50,4 +50,13 @@ I hope you will give it a try.
- Report from `Making report` fixed
- No longer contains customisation sync information.
- Version of LiveSync has been added.
- 0.19.22
Fixed:
- Now the synchronisation will begin without our interaction.
- No longer puts the configuration of the remote database into the log while checking configuration.
- Some outdated description notes have been removed.
- Options that are meaningless depending on other settings configured are now hidden.
- Scan for hidden files before replication
- Scan customization periodically
... To continue on to `updates_old.md`.