Plugin Demo#
This solution is based on the livesync plugin + Synology Docker. You need to be able to access your own NAS and have a domain name~
Official project address Official Chinese instructions
Experience#
I've been using it for almost two months, and the synchronization is smooth. It feels like using cloud note-taking software~~
Setting up a database with Synology Docker#
Installation#
Search for couchdb in Docker and download it
Double-click on the downloaded image to install it, click on Advanced Settings, and enter the configuration page
Configuration#
General: Check the option for automatic restart (optional)
Save this official code to a text document and rename it to local.ini
[couchdb]
single_node=true
max_document_size = 50000000
[chttpd]
require_valid_user = true
max_http_request_size = 4294967296
enable_cors = true
[chttpd_auth]
require_valid_user = true
authentication_redirect = /_utils/session.html
[httpd]
WWW-Authenticate = Basic realm="couchdb"
bind_address = 0.0.0.0
[cors]
origins = app://obsidian.md, capacitor://localhost, http://localhost
credentials = true
headers = accept, authorization, content-type, origin, referer
methods = GET,PUT,POST,HEAD,DELETE
max_age = 3600
Then upload local.ini
to the corresponding NAS path. This is the official documentation page
I usually manually set the port to match the container, but the local port should be customizable and untested~
In the environment, you need to manually add two configurations:
COUCHDB_PASSWORD
Set the value to your password
COUCHDB_USER
Set the value to your username
After configuring, start Docker and access http://your IP:your port
For example: http://192.168.31.2:5984
If successful, a string of characters will be displayed, indicating that it's working~
Client Configuration#
Next, configure the client plugin
URL
: Fill in the website address you just tested, remember to include the port number
Username and Password
: The account and password you added to Docker earlier
Database Name
: You can choose any name that is convenient for you to identify
Once filled in, you can click Test to test the connection. If successful, there will be a prompt
By the way, it is recommended to enable End to End Encryption
for end-to-end encryption
Then configure the synchronization. It is recommended to select LiveSync
for real-time synchronization~
After all, we installed this plugin for this feature~
One thing to note is that this plugin is not compatible with other synchronization plugins, including the official synchronization. It is recommended to disable all other synchronization settings, otherwise there may be problems~
You can also synchronize client settings and other plugins, but this is a test feature and can be enabled as needed~
You must name the current device before you can enable it
It is recommended to enable "notify customized". This way, when there is a new configuration, the software will display a reminder. Clicking on it will take you to the configuration page, where you can manually select which content to synchronize
Adding Synology Reverse Proxy, Enabling HTTPS, and Setting up External Access#
After configuring the previous steps, you can start the synchronization, but currently, it can only be accessed within the local network, so the experience is not perfect
Next, we will configure external access
In my home, I have already configured [[DDNS]] and the corresponding [[domain certificate]] for my NAS. If you are not familiar with this knowledge, please study it on your own. I will write a separate configuration tutorial in the future
Here, it is assumed that you can already access your NAS from the external network and have configured an SSL certificate
Setting up Synology Reverse Proxy#
- Open the Synology Control Panel and click on Application Portal
- Click on Reverse Proxy Server and then click on Add
- Configure as shown in the following image
Enable port forwarding in the router's backend. Here is an image borrowed from the internet
Name: Fill in any name
Protocol: Just use the default TCP
External Port: Fill in any port number, it is recommended to match the port number set for the Synology Reverse Proxy Server earlier
Internal IP Address: The address of your NAS
Internal Port: The port number set for the Synology Reverse Proxy Server (not the default Docker port 5984)
After adding, save and apply the changes
Then, in the client, fill in the corresponding URI address with your own domain name and the corresponding access port, and you're done!
Finally#
This is a synchronization plugin, not a backup plugin. If you have Synology, it is recommended to use it with Drive for automatic backups. I mainly use this plugin for synchronization on iOS and iPad. Apple's iCloud synchronization has some issues. If you are using a PC or Android, it feels better to use Synology's Drive suite for synchronization and version control~
References:
不使用第三方软件实现 Obsidian 多平台实时同步 - 经验分享 - Obsidian 中文论坛