mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-06 15:51:51 +00:00
Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d324f08240 | ||
|
|
0b526e9cea | ||
|
|
07535eb3fc | ||
|
|
9965d123bd | ||
|
|
b1c045937b | ||
|
|
a4fdcf9540 | ||
|
|
a9f06a3ae7 | ||
|
|
0946b1e012 | ||
|
|
ccbf1b2ffe | ||
|
|
a01079d4b1 | ||
|
|
1d71870fa3 | ||
|
|
0587a52d22 | ||
|
|
6c37f7bb05 | ||
|
|
d746c1cb52 | ||
|
|
39e2eab023 | ||
|
|
20bdf057fe | ||
|
|
531fb97cd9 | ||
|
|
518ae46cf9 | ||
|
|
57187a0926 | ||
|
|
f3f0639d95 | ||
|
|
531cf0d8a4 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,7 +7,7 @@ node_modules
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
# build
|
# build
|
||||||
# main.js
|
main.js
|
||||||
*.js.map
|
*.js.map
|
||||||
|
|
||||||
# obsidian
|
# obsidian
|
||||||
|
|||||||
88
README.md
88
README.md
@@ -1,31 +1,82 @@
|
|||||||
# obsidian-livesync
|
# Self-hosted LiveSync
|
||||||
|
**Renamed from: obsidian-livesync**
|
||||||
|
|
||||||
This is the obsidian plugin that enables livesync between multi terminals.
|
This is the obsidian plugin that enables livesync between multi-devices with self-hosted database.
|
||||||
Runs in Mac, Android, Windows, and iOS.
|
Runs in Mac, Android, Windows, and iOS.
|
||||||
|
Community implementation, not compatible with official "Sync".
|
||||||
|
|
||||||
<!-- <div><video controls src="https://user-images.githubusercontent.com/45774780/137352386-a274736d-a38b-4069-ac41-759c73e36a23.mp4" muted="false"></video></div> -->
|
<!-- <div><video controls src="https://user-images.githubusercontent.com/45774780/137352386-a274736d-a38b-4069-ac41-759c73e36a23.mp4" muted="false"></video></div> -->
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
**It's getting almost stable now, But Please make sure to back your vault up!**
|
||||||
|
|
||||||
**It's beta. Please make sure back your vault up!**
|
Limitations: Folder deletion handling is not completed.
|
||||||
|
|
||||||
Limitations: File deletion handling is not completed.
|
|
||||||
|
|
||||||
## This plugin enables..
|
## This plugin enables..
|
||||||
|
|
||||||
- Live sync
|
- Live Sync
|
||||||
- Self-Hosted data synchronization with conflict detection and resolving in Obsidian.
|
- Self-Hosted data synchronization with conflict detection and resolving in Obsidian.
|
||||||
|
- Off-line sync is also available.
|
||||||
|
- Receive WebClip from [obsidian-livesync-webclip](https://chrome.google.com/webstore/detail/obsidian-livesync-webclip/jfpaflmpckblieefkegjncjoceapakdf)
|
||||||
|
|
||||||
## How to use the beta build
|
## IMPORTANT NOTICE
|
||||||
|
|
||||||
|
**Please make sure to disable other synchronize solutions to avoid content corruption or duplication.**
|
||||||
|
If you want to synchronize to both backend, sync one by one, please.
|
||||||
|
|
||||||
|
## How to use
|
||||||
|
|
||||||
|
1. Install from Obsidian, or clone this repo and run `npm run build` ,copy `main.js`, `styles.css` and `manifest.json` into `[your-vault]/.obsidian/plugins/` (PC, Mac and Android will work)
|
||||||
|
2. Enable Self-hosted LiveSync in the settings dialog.
|
||||||
|
3. If you use your self-hosted CouchDB, set your server's info.
|
||||||
|
4. or Use [IBM Cloudant](https://www.ibm.com/cloud/cloudant), take an account and enable **Cloudant** in [Catalog](https://cloud.ibm.com/catalog#services)
|
||||||
|
Note please choose "IAM and legacy credentials" for the Authentication method
|
||||||
|
Setup details are in Couldant Setup Section.
|
||||||
|
5. Setup LiveSync or SyncOnSave or SyncOnStart as you like.
|
||||||
|
|
||||||
|
## Test Server
|
||||||
|
|
||||||
|
Setting up an instance of Cloudant or local CouchDB is a little complicated, so I made the [Tasting server of self-hosted-livesync](https://olstaste.vrtmrz.net/) up. Try free!
|
||||||
|
Note: Please read "Limitations" carefully. Do not send your private vault.
|
||||||
|
|
||||||
|
## WebClipper is also available.
|
||||||
|
|
||||||
|
Available from on Chrome Web Store:[obsidian-livesync-webclip](https://chrome.google.com/webstore/detail/obsidian-livesync-webclip/jfpaflmpckblieefkegjncjoceapakdf)
|
||||||
|
Repo is here: [obsidian-livesync-webclip](https://github.com/vrtmrz/obsidian-livesync-webclip). (Docs are work in progress.)
|
||||||
|
|
||||||
|
## When your database looks corrupted or too heavy to replicate to a new device.
|
||||||
|
|
||||||
|
self-hosted-livesync changes data treatment of markdown files since 0.1.0
|
||||||
|
When you are troubled with synchronization, **Please reset local and remote databases**.
|
||||||
|
_Note: Without synchronization, your files won't be deleted._
|
||||||
|
|
||||||
|
1. Update plugin on all devices.
|
||||||
|
1. Disable any synchronizations on all devices.
|
||||||
|
1. From the most reliable device<sup>(_The device_)</sup>, back your vault up.
|
||||||
|
1. Press "Drop History"-> "Execute" button from _The device_.
|
||||||
|
1. Wait for a while, so self-hosted-livesync will say "completed."
|
||||||
|
1. In other devices, replication will be canceled automatically. Click "Reset local database" and click "I'm ready, mark this device 'resolved'" on all devices.
|
||||||
|
If it doesn't be shown. replicate once.
|
||||||
|
1. It's all done. But if you are sure to resolve all devices and the warning is noisy, click "I'm ready, unlock the database". it unlocks the database completely.
|
||||||
|
|
||||||
|
# Designed architecture
|
||||||
|
|
||||||
|
## How does this plugin synchronize.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
1. When notes are created or modified, Obsidian raises some events. obsidian-live-sync catch these events and reflect changes into Local PouchDB.
|
||||||
|
2. PouchDB automatically or manually replicates changes to remote CouchDB.
|
||||||
|
3. Another device is watching remote CouchDB's changes, so retrieve new changes.
|
||||||
|
4. obsidian-live-sync reflects replicated changeset into Obsidian's vault.
|
||||||
|
|
||||||
|
Note: The figure is drawn as single-directional, between two devices. But everything occurs bi-directionally between many devices at once in real.
|
||||||
|
|
||||||
|
## Techniques to keep bandwidth low.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
1. download this repo and expand `[your-vault]/.obsidian/plugins/` (PC, Mac and Android will work)
|
|
||||||
1. enable obsidian livesync in the settings dialog.
|
|
||||||
1. If you use your self-hosted CouchDB, set your server's info.
|
|
||||||
1. or Use [IBM Cloudant](https://www.ibm.com/cloud/cloudant), take an account and enable **Cloudant** in [Catalog](https://cloud.ibm.com/catalog#services)
|
|
||||||
Note please choose "IAM and legacy credentials" for the Authentication method
|
|
||||||
Setup details are in Couldant Setup Section.
|
|
||||||
1. Setup LiveSync or SyncOnSave or SyncOnStart as you like.
|
|
||||||
|
|
||||||
## Cloudant Setup
|
## Cloudant Setup
|
||||||
|
|
||||||
@@ -37,7 +88,7 @@ Limitations: File deletion handling is not completed.
|
|||||||
1. In IBM Cloud Catalog, search "Cloudant".
|
1. In IBM Cloud Catalog, search "Cloudant".
|
||||||

|

|
||||||
|
|
||||||
1. You can choise "Lite plan" in free.
|
1. You can choose "Lite plan" for free.
|
||||||

|

|
||||||
|
|
||||||
Select Multitenant(it's the default) and the region as you like.
|
Select Multitenant(it's the default) and the region as you like.
|
||||||
@@ -53,7 +104,7 @@ Select Multitenant(it's the default) and the region as you like.
|
|||||||
6. When all of the above steps have been done, Open "Resource list" on the left pane. you can see the Cloudant instance in the "Service and software". Click it.
|
6. When all of the above steps have been done, Open "Resource list" on the left pane. you can see the Cloudant instance in the "Service and software". Click it.
|
||||||

|

|
||||||
|
|
||||||
7. In resource details, there's information to connect from obsidian-livesync.
|
7. In resource details, there's information to connect from self-hosted-livesync.
|
||||||
Copy the "External Endpoint(preferred)" address. <sup>(\*1)</sup>
|
Copy the "External Endpoint(preferred)" address. <sup>(\*1)</sup>
|
||||||

|

|
||||||
|
|
||||||
@@ -84,7 +135,7 @@ Select Multitenant(it's the default) and the region as you like.
|
|||||||
1. The dialog to create a credential will be shown.
|
1. The dialog to create a credential will be shown.
|
||||||
type any name or leave it default, hit the "Add" button.
|
type any name or leave it default, hit the "Add" button.
|
||||||

|

|
||||||
_NOTE: This "name" is not related to your username that uses in Obsidian-livesync._
|
_NOTE: This "name" is not related to your username that uses in self-hosted-livesync._
|
||||||
|
|
||||||
1. Back to "Service credentials", the new credential should be created.
|
1. Back to "Service credentials", the new credential should be created.
|
||||||
open details.
|
open details.
|
||||||
@@ -94,7 +145,7 @@ Select Multitenant(it's the default) and the region as you like.
|
|||||||
follow the figure, it's
|
follow the figure, it's
|
||||||
"apikey-v2-2unu15184f7o8emr90xlqgkm2ncwhbltml6tgnjl9sd5"<sup>(\*3)</sup> and "c2c11651d75497fa3d3c486e4c8bdf27"<sup>(\*4)</sup>
|
"apikey-v2-2unu15184f7o8emr90xlqgkm2ncwhbltml6tgnjl9sd5"<sup>(\*3)</sup> and "c2c11651d75497fa3d3c486e4c8bdf27"<sup>(\*4)</sup>
|
||||||
|
|
||||||
### obsidian-livesync setting
|
### self-hosted-livesync setting
|
||||||
|
|
||||||

|

|
||||||
example values.
|
example values.
|
||||||
@@ -106,4 +157,5 @@ example values.
|
|||||||
| CouchDB Password | (\*4) | c2c11651d75497fa3d3c486e4c8bdf27 |
|
| CouchDB Password | (\*4) | c2c11651d75497fa3d3c486e4c8bdf27 |
|
||||||
|
|
||||||
# License
|
# License
|
||||||
|
|
||||||
The source code is licensed MIT.
|
The source code is licensed MIT.
|
||||||
BIN
images/1.png
Normal file
BIN
images/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
BIN
images/2.png
Normal file
BIN
images/2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 223 KiB |
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"id": "obsidian-livesync",
|
"id": "obsidian-livesync",
|
||||||
"name": "Obsidian Live sync",
|
"name": "Self-hosted LiveSync",
|
||||||
"version": "0.0.7",
|
"version": "0.1.10",
|
||||||
"minAppVersion": "0.9.12",
|
"minAppVersion": "0.9.12",
|
||||||
"description": "obsidian Live synchronization plugin.",
|
"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",
|
"author": "vorotamoroz",
|
||||||
"authorUrl": "https://github.com/vrtmrz",
|
"authorUrl": "https://github.com/vrtmrz",
|
||||||
"isDesktopOnly": false
|
"isDesktopOnly": false
|
||||||
|
|||||||
17
package-lock.json
generated
17
package-lock.json
generated
@@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-livesync",
|
"name": "obsidian-livesync",
|
||||||
"version": "0.0.6",
|
"version": "0.1.10",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "obsidian-livesync",
|
"name": "obsidian-livesync",
|
||||||
"version": "0.0.6",
|
"version": "0.1.10",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"diff-match-patch": "^1.0.5"
|
"diff-match-patch": "^1.0.5",
|
||||||
|
"xxhash-wasm": "^0.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^18.0.0",
|
"@rollup/plugin-commonjs": "^18.0.0",
|
||||||
@@ -539,6 +540,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
"dev": true
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/xxhash-wasm": {
|
||||||
|
"version": "0.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-0.4.2.tgz",
|
||||||
|
"integrity": "sha512-/eyHVRJQCirEkSZ1agRSCwriMhwlyUcFkXD5TPVSLP+IPzjsqMVzZwdoczLp1SoQU0R3dxz1RpIK+4YNQbCVOA=="
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -975,6 +981,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
"dev": true
|
"dev": true
|
||||||
|
},
|
||||||
|
"xxhash-wasm": {
|
||||||
|
"version": "0.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-0.4.2.tgz",
|
||||||
|
"integrity": "sha512-/eyHVRJQCirEkSZ1agRSCwriMhwlyUcFkXD5TPVSLP+IPzjsqMVzZwdoczLp1SoQU0R3dxz1RpIK+4YNQbCVOA=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "obsidian-livesync",
|
"name": "obsidian-livesync",
|
||||||
"version": "0.0.7",
|
"version": "0.1.10",
|
||||||
"description": "obsidian Live synchronization plugin.",
|
"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",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "rollup --config rollup.config.js -w",
|
"dev": "rollup --config rollup.config.js -w",
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
"typescript": "^4.2.4"
|
"typescript": "^4.2.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"diff-match-patch": "^1.0.5"
|
"diff-match-patch": "^1.0.5",
|
||||||
|
"xxhash-wasm": "^0.4.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,3 +18,12 @@
|
|||||||
.op-pre {
|
.op-pre {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
.op-warn {
|
||||||
|
border: 1px solid salmon;
|
||||||
|
padding: 2px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.syncstatusbar {
|
||||||
|
-webkit-filter: grayscale(100%);
|
||||||
|
filter: grayscale(100%);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user