mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-02 00:22:12 +03:00
Compare commits
3 Commits
improve_fi
...
fix_warns
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac6b9a4dad | ||
|
|
225e2c5096 | ||
|
|
674d68b7d9 |
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-livesync",
|
||||
"name": "Self-hosted LiveSync",
|
||||
"version": "0.25.70-patch1",
|
||||
"version": "0.25.70-patch2",
|
||||
"minAppVersion": "1.7.2",
|
||||
"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
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.25.70-patch1",
|
||||
"version": "0.25.70-patch2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.25.70-patch1",
|
||||
"version": "0.25.70-patch2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.808.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "obsidian-livesync",
|
||||
"version": "0.25.70-patch1",
|
||||
"version": "0.25.70-patch2",
|
||||
"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",
|
||||
|
||||
2
src/lib
2
src/lib
Submodule src/lib updated: b143cf887b...6f977537f4
@@ -1,21 +1,17 @@
|
||||
import { delay, fireAndForget } from "octagonal-wheels/promises";
|
||||
import { __onMissingTranslation } from "../../lib/src/common/i18n";
|
||||
import { AbstractObsidianModule } from "../AbstractObsidianModule.ts";
|
||||
import { LOG_LEVEL_NOTICE, LOG_LEVEL_VERBOSE, Logger } from "octagonal-wheels/common/logger";
|
||||
import { LOG_LEVEL_VERBOSE } from "octagonal-wheels/common/logger";
|
||||
import { eventHub } from "../../common/events";
|
||||
import { enableTestFunction } from "./devUtil/testUtils.ts";
|
||||
import { TestPaneView, VIEW_TYPE_TEST } from "./devUtil/TestPaneView.ts";
|
||||
import { writable } from "svelte/store";
|
||||
import type { CouchDBCredentials, FilePathWithPrefix } from "../../lib/src/common/types.ts";
|
||||
import type { FilePathWithPrefix } from "../../lib/src/common/types.ts";
|
||||
import type { LiveSyncCore } from "../../main.ts";
|
||||
import { getConfiguredFunctionsForEncryption } from "@/lib/src/pouchdb/encryption.ts";
|
||||
import { AuthorizationHeaderGenerator } from "@/lib/src/replication/httplib.ts";
|
||||
import { fetchChangesForInitialSync } from "@/lib/src/pouchdb/StreamingFetch.ts";
|
||||
import { PouchDB } from '@lib/pouchdb/pouchdb-browser.ts';
|
||||
import { sizeToHumanReadable } from "octagonal-wheels/number";
|
||||
|
||||
export class ModuleDev extends AbstractObsidianModule {
|
||||
_everyOnloadStart(): Promise<boolean> {
|
||||
__onMissingTranslation(() => { });
|
||||
__onMissingTranslation(() => {});
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
async onMissingTranslation(key: string): Promise<void> {
|
||||
@@ -102,75 +98,7 @@ export class ModuleDev extends AbstractObsidianModule {
|
||||
});
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
async _runBulkCopyTest() {
|
||||
const settings = this.settings;
|
||||
const dummyLocalDatabaseForDrop = new PouchDB("dummy-local");
|
||||
await dummyLocalDatabaseForDrop.destroy();
|
||||
const dummyLocalDatabase = new PouchDB("dummy-local");
|
||||
const replicator = await this.core.services.replicator.getNewReplicator();
|
||||
if (!replicator) {
|
||||
return;
|
||||
}
|
||||
const salt = () => replicator.getReplicationPBKDF2Salt(settings);
|
||||
const enc = getConfiguredFunctionsForEncryption(settings.passphrase,
|
||||
false,
|
||||
false,
|
||||
salt,
|
||||
settings.E2EEAlgorithm,
|
||||
);
|
||||
|
||||
const auth = (
|
||||
settings.useJWT
|
||||
? {
|
||||
jwtAlgorithm: settings.jwtAlgorithm,
|
||||
jwtKey: settings.jwtKey,
|
||||
jwtExpDuration: settings.jwtExpDuration,
|
||||
jwtKid: settings.jwtKid,
|
||||
jwtSub: settings.jwtSub,
|
||||
type: "jwt",
|
||||
}
|
||||
: {
|
||||
username: settings.couchDB_USER,
|
||||
password: settings.couchDB_PASSWORD,
|
||||
type: "basic",
|
||||
}
|
||||
) satisfies CouchDBCredentials;
|
||||
const authHeader = await (new AuthorizationHeaderGenerator().getAuthorizationHeader(auth));
|
||||
const remote =
|
||||
settings.couchDB_URI.replace(/\/+$/, "") +
|
||||
(settings.couchDB_DBNAME == "" ? "" : "/" + settings.couchDB_DBNAME);
|
||||
//
|
||||
const ret = fetchChangesForInitialSync(
|
||||
dummyLocalDatabase,
|
||||
remote,
|
||||
authHeader,
|
||||
enc.outgoing,
|
||||
"0",
|
||||
(progress) => {
|
||||
Logger(`Initial sync progress: ${progress.totalValidFetched} / ${progress.docsToFetch}
|
||||
Total bytes fetched: ${sizeToHumanReadable(progress.totalBytes)}`,
|
||||
LOG_LEVEL_NOTICE, "fetch-init-progress"
|
||||
);
|
||||
|
||||
}
|
||||
);
|
||||
await ret;
|
||||
|
||||
const allDocs = await dummyLocalDatabase.allDocs({ include_docs: false });
|
||||
Logger(`Bulk copy test completed. Total documents in local database: ${allDocs.total_rows}`, LOG_LEVEL_NOTICE, "fetch-init-complete");
|
||||
await dummyLocalDatabase.destroy();
|
||||
Logger(`Dummy local database has been destroyed after test.`, LOG_LEVEL_NOTICE);
|
||||
}
|
||||
async _everyOnLayoutReady(): Promise<boolean> {
|
||||
|
||||
this.addCommand({
|
||||
"id": "bulk-copy-test",
|
||||
"name": "(DEBUG) Bulk copy test",
|
||||
"callback": async () => {
|
||||
await this._runBulkCopyTest();
|
||||
}
|
||||
})
|
||||
|
||||
if (!this.settings.enableDebugTools) return Promise.resolve(true);
|
||||
// if (await this.core.storageAccess.isExistsIncludeHidden("_SHOWDIALOGAUTO.md")) {
|
||||
// void this.core.$$showView(VIEW_TYPE_TEST);
|
||||
|
||||
@@ -262,7 +262,7 @@ export class ModuleLog extends AbstractObsidianModule {
|
||||
this.statusDiv.remove();
|
||||
// this.statusDiv.pa();
|
||||
const container = mdv.view.containerEl;
|
||||
container.insertBefore(this.statusDiv, container.lastChild);
|
||||
container.appendChild(this.statusDiv);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,12 +466,14 @@ ${stringifyYaml(info)}
|
||||
|
||||
this.observeForLogs();
|
||||
|
||||
this.statusDiv = this.app.workspace.containerEl.createDiv({ cls: "livesync-status" });
|
||||
this.statusLine = this.statusDiv.createDiv({ cls: "livesync-status-statusline" });
|
||||
this.messageArea = this.statusDiv.createDiv({ cls: "livesync-status-messagearea" });
|
||||
this.logMessage = this.statusDiv.createDiv({ cls: "livesync-status-logmessage" });
|
||||
this.logHistory = this.statusDiv.createDiv({ cls: "livesync-status-loghistory" });
|
||||
this.statusDiv.style.display = this.settings?.showStatusOnEditor ? "" : "none";
|
||||
if (this.settings.showStatusOnEditor) {
|
||||
this.statusDiv = this.app.workspace.containerEl.createDiv({ cls: "livesync-status" });
|
||||
this.statusLine = this.statusDiv.createDiv({ cls: "livesync-status-statusline" });
|
||||
this.messageArea = this.statusDiv.createDiv({ cls: "livesync-status-messagearea" });
|
||||
this.logMessage = this.statusDiv.createDiv({ cls: "livesync-status-logmessage" });
|
||||
this.logHistory = this.statusDiv.createDiv({ cls: "livesync-status-loghistory" });
|
||||
this.statusDiv.style.display = this.settings?.showStatusOnEditor ? "" : "none";
|
||||
}
|
||||
eventHub.onEvent(EVENT_LAYOUT_READY, () => this.adjustStatusDivPosition());
|
||||
if (this.settings?.showStatusOnStatusbar) {
|
||||
this.statusBar = this.services.API.addStatusBarItem();
|
||||
|
||||
@@ -3,12 +3,12 @@ Since 19th July, 2025 (beta1 in 0.25.0-beta1, 13th July, 2025)
|
||||
|
||||
The head note of 0.25 is now in [updates_old.md](https://github.com/vrtmrz/obsidian-livesync/blob/main/updates_old.md). Because 0.25 got a lot of updates, thankfully, compatibility is kept and we do not need breaking changes! In other words, when get enough stabled. The next version will be v1.0.0. Even though it my hope.
|
||||
|
||||
## Unreleased
|
||||
## 0.25.70-patch2
|
||||
|
||||
### Under development
|
||||
1st June, 2026
|
||||
|
||||
- Bulk database fetching is now work in progress. This feature is expected to speed up rebuilds and setups.
|
||||
Another feature that is needed is the ability to enforce a specific order during the initial comparison between the storage and the local database.
|
||||
### Fixed
|
||||
- No longer does the status element break other plugins' interaction (#930).
|
||||
|
||||
## 0.25.70-patch1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user