Loading...
Tech / Jul 06 2023

Set up a Cloud Sync to Koofr in SiYuan Using WebDAV

SiYuan is a privacy-first and open-source personal knowledge management system that offers great features like end-to-end encrypted data sync. Here's how to set it up by using Koofr cloud storage as a data repository.

Written by human for humans

Created by two Chinese software developers and other community contributors, SiYuan is a privacy-oriented alternative to notes and knowledge management apps like Obsidian and Notion that has steadily been gaining popularity with the open source community. It works by breaking down your content into blocks that can be moved around and reorganized into different levels without affecting existing links. It is available to download for free for Windows, macOS, and Linux, as well as Android and iOS.

An example screenshot of the SiYuan desktop app.

If, like us, you're wondering as to what the word "SiYuan" means, the app's creators offer an intriguing explanation in the FAQ:

The name "SiYuan" comes from the Chinese idiom "饮水思源", which means "when drinking water, one should remember where it comes from" and is used to describe the virtues of not forgetting one's roots and gratitude.

One of SiYuan's defining features is that it lets you sync your data across multiple devices, which we love. In this tutorial, we'll show you how you can set up a WebDAV connection to your Koofr cloud storage account and use it as a data repo for cloud sync. We will cover setup for Windows and Android, but similar steps should work for other operating systems as well.

Downloading and installing SiYuan on Windows

Start by downloading and installing SiYuan to your PC. You can download the installer found on this page if you want to be able to choose the location where the app will be installed. For a quick and easy one-click install, use the Microsoft Store.

Once the application has been installed, go ahead and open it. You can learn about the app and how to use it in the documentation that comes pre-loaded with it.

Setting up a WebDAV connection

Before proceeding with WebDAV setup, make sure you generate an application-specific password in the Koofr web application. You can do this by opening the main menu in the top-right corner and clicking on Preferences, then navigating to Password in the left sidebar. Type in the name of the app you'll be using (this is just for your future reference), then click Generate. If you're stuck, watch this video on how to generate an app-specific password in Koofr.

Generating an application-specific password in Koofr to set up cloud sync in SiYuan.

While you're in Koofr, you should also create a folder called SiYuan to contain the data repository.

To connect SiYuan to your Koofr cloud storage account, click on Documents in the left-hand corner, then open Settings. Click on Cloud in the left sidebar menu to access the cloud storage panel. By default, this is set to SiYuan's subscription service, so use the drop-down menu in the top right corner of the window to select WebDAV.

Setting up a WebDAV connection with Koofr in SiYuan.

Next, you'll enter Koofr's WebDAV endpoint.

Note: If you named your repo folder something other than SiYuan, edit the path below accordingly.

https://app.koofr.net/dav/Koofr/SiYuan/

Fill in your username and the app-specific password you generated earlier, then toggle the Enable cloud sync switch.

Enabling end-to-end encryption

SiYuan lets you encrypt your data repository and save data snapshots using a Data repo key. By encrypting your cloud data, you can make sure that nobody can access or read the data without the key. If you don't feel the need to encrypt your data, you can skip this step.

You will need to use the same key on all your devices for the data to be synced to the cloud. You can generate your key on any of your devices first and then enter the same key into your other devices. We'll show you how to generate the key on the desktop and add it to the Android device, but you could do it the other way around using similar steps.

Generating a Data repo key in SiYuan.

Start by opening your Settings and navigating to the last tab in the left-hand sidebar, About. Here, look for the Data repo key section.

You now have two options: either let SiYuan auto-generate a key, or generate a key with a passphrase. We chose to auto-generate the key, which we recommend you save to your preferred password manager in case you ever need to reimport the key.

Once you choose a Data repo key, your SiYuan data repository will be encrypted.

How to sync your SiYuan data

Whether you chose to enable end-to-end encryption (e2ee) or not, at this point, you're ready to trigger your first synchronization. You can trigger a sync by clicking on the cloud icon in the title bar of the app window. This will set up the data repo and, if you set up e2ee, ensure that it is encrypted.

Setting up SiYuan on your mobile device

Now it's time to set up SiYuan on your mobile device. Start by searching for SiYuan in the Google Play store or the App Store, depending on your device, and install the app.

Once the app is installed, the WebDAV setup is basically the same as it was for the desktop app. You can use the same app-specific password you used before or generate another one.

You can use the same endpoint address and credentials to set up WebDAV on mobile devices.

Open the main menu by tapping the kebab icon (…). Find or scroll to the Cloud option and tap it to display the cloud storage panel. In the drop-down menu, choose WebDAV again, then enter the endpoint address and your credentials.

Don't forget to toggle the Enable cloud sync switch as well.

To sync with your repo and bring any synced documents you created in the desktop app to your mobile device, go back to the main menu, then tap the Sync now option. Wait a few moments and SiYuan will load up everything from your cloud sync.

Importing a Data repo key in SiYuan.

If you enabled encryption in your desktop app, you'll need to import your Data repo key before syncing your mobile device. To do this, first copy the key in your desktop application, then either use a secure channel to send it to your mobile device or type it in by hand. We used Signal's Note to Self feature to avoid any errors. Make sure you delete the message with the key once you don't need it anymore!

Navigate to Data repo key, which can be found in the About panel of the Settings menu, just like in the desktop app. Tap on Import key and enter your key into the pop-up, then press Confirm.

You can now head back to the main menu and tap Sync now to trigger a sync.

Other security and privacy options

You can configure SiYuan to require password authentication on every launch. This setting is found in the About panel under Access authorization code. Click/tap on the Settings button to open a popup that lets you enter an authorization code.

Setting up an authorization code in SiYuan to require authentication on every app launch.

If an authorization code is set, SiYuan will ask you to enter a password when you open the desktop app.

Lock screen in SiYuan desktop application.

On the mobile app, it works a bit differently: you can enable the Lock Screen option from the main menu, but it won't automatically lock the app when you close it or switch between apps.

Final note: If you were paying close attention to our screenshots, you might have noticed that SiYuan uses Google Analytics to collect data about how and when the app was opened. The app's Privacy Policy states that they do not collect user data or operations with it. If you're uncomfortable with this, you can disable Google Analytics in the About panel.


Have you tried SiYuan yet? Join the discussion in our Reddit community!