How does Storage work?
wchorski opened this issue · comments
This may be a misunderstanding, but I assume the storage
functionality houses and syncs all vault files on a server?
Could you provide a Docker file structure example? This quote from the read me is what I'm trying to understand
storage folder have to start with "data/" to be in the volume
Livesync between Obisidian Clients
I've gotten the live sync working between clients (both connected to the same self hosted CouchDB). Works very well to sync both from phone and PC when editing notes.
When I spin up this livesync-bridge, I'm not sure how or what works.
Config
I'm running this as a container on my Server
With this config I assume the server will get a copy and sync the same vault files as my PC and Phone.
{
"peers": [
{
"type": "couchdb",
"name": "obsidianDB",
"database": "obsidianDB",
"username": "admin",
"password": "***",
"url": "https://DOMAIN",
"customChunkSize": 100,
"minimumChunkSize": 20,
"passphrase": "",
"obfuscatePassphrase": "",
"baseDir": ""
},
{
"type": "storage",
"name": "obsidian-storage",
"baseDir": "./vault/",
"scanOfflineChanges": true
}
]
}
logs
LiveSync Bridge is now starting...
LiveSync Bridge is now started!
2/10/2024, 8:11:50 PM 1 Cache initialized 300 / 10000000000000
2/10/2024, 8:11:50 PM 1 Cache initialized 300 / 50000000
2/10/2024, 8:11:50 PM 1 Cache initialized 300 / 10000000000000
2/10/2024, 8:11:50 PM -1 Requesting ... get https://DOMAIN/obsidianDB/_local%2Fobsydian_livesync_milestone
2/10/2024, 8:11:50 PM 10 [obsidian-storage] Scan offline changes: Enabled, now starting...
2/10/2024, 8:11:51 PM 10 [pywriter] Watch starting from 2161-g1AAAACReJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCScyJNX___8_K4M5iYGBRT8XKMZuYGpkbGRsia4ehwl5LECSoQFI_UcY5AQ2KDnZ1MTIJBVdWxYAx2Iqlw
2/10/2024, 8:11:51 PM 10 WATCH: START: (since:2161-g1AAAACReJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCScyJNX___8_K4M5iYGBRT8XKMZuYGpkbGRsia4ehwl5LECSoQFI_UcY5AQ2KDnZ1MTIJBVdWxYAx2Iqlw)
2/10/2024, 8:11:51 PM -1 Requesting ... get https://DOMAIN/obsidianDB/_changes?style=all_docs&filter=replicate%2Fpull&include_docs=true&since=2161-g1AAAACReJzLYWBgYMpgTmHgzcvPy09JdcjLz8gvLskBCScyJNX___8_K4M5iYGBRT8XKMZuYGpkbGRsia4ehwl5LECSoQFI_UcY5AQ2KDnZ1MTIJBVdWxYAx2Iqlw&feed=continuous&timeout=100000&heartbeat=5000
2/10/2024, 8:11:51 PM 10 [obsidian-storage] Scan offline changes: Finished
My Server repo
Here is my folder structure. The vault
folder is a clone of my obsidian vault root that's on my PC and Phone
Whenever I make a change on PC or Phone Obsidian, this change does not reflect to the Server side vault
. Is this a wrong assumption of what livesync-bridge
can do?
I even manually copied over files from the obsidian into the Server's vault
folder to see if that would help. Also, I remember on the older version of livesync
I could run docker compose restart
and that would kick the sync back into gear and get the server files up to date.
So the README is correct, but I got tripped up at the examples since I'm using the Docker version.
Docker
config.json
{
"type": "storage",
"name": "obsidian-storage",
"baseDir": "./data/vault/",
"scanOfflineChanges": true
}
then create a directory ./data/vault
. As soon as I spun up the container the vault automatically pulled down the vault files
recursive git clone
also note for Docker users you want to clone the repo like git clone --recursive https://github.com/vrtmrz/livesync-bridge
as the container also relies on the lib
submodule
Thanks for this very useful library