Configure SiYuan for S3 sync

There are 3 simple steps to setup S3 Sync on SiYuan after you have purchased the PRO subscription.

  1. Setup S3 on your cloud account, (I'm using linode S3 api compatible bucket for this tutorial, in theory, you can use any other service provider, even setup your own S3 storage like minio).

  2. Create a bucket on S3 and retreive the following parameters:

    • S3 Endpoint
    • Access Key
    • Secret Key
    • Bucket name
    • Region
  3. Fill up the setting on your SiYuan.

Setup S3 account

linode.com is very easy configure and setup as well as begineer friendly. The most important is about their pricing, 250GB storage only costing you $5 per month with 1TB outbound network. For anyone who used S3 service before, the network fees is always the bigger part of it. While having 1TB outbound network monthly, it is very feasible.

image

Of course if you prefer digital ocean, they are offering the same service.

image

Oh yes, AWS S3 should be the most famous one. Buuuuuuuuuuut, you have only 20000 requests monthly and only 5GB and it's very complicated to configure it, especially the networking part.

image

Therefore, I'm prefer a smaller vendor like linode and digital ocean, no surprise on monthly bill and kind of easy.


Go to linode, https://www.linode.com and sign up a new account.

image

You can choose to use your Google or Github account for quick sign up or follow the form to finish the process.

After you have sign up. You are required to leave your credit card detail for billing or you can reload to your linode account.

Go to https://cloud.linode.com/account/billing, it will navigate you to the Account page.

Click on Add Payment Method and setup your credit card details, billing contact and you are ready to create a S3 service now.

Create a S3 bucket

Then, go to Object Storage menu.

image

  1. Since this is an newly create account, you won't see any bucket available. Click on Create Bucket button

image

Give a label name and select the Region that is closest to you. If you are using other S3 provider, they would have similar Region selection also.

After you have created the bucket, you will see a new record created under your bucket. We can get the required parameters from the URL below.

image

Key Value
S3 Endpoint https://ap-south-1.linodeobjects.com
Bucket name siyuan-sync
Region ap-south-1

Next, which is the most important part.

  1. Configure your bucket ACL and create Access key and Secret key
  2. Always remember to keep your Access key and Secret key safe! ONLY KNOWN by YOURSELF!

Now, click on siyuan-sync​ and go to the bucket page.

image

Go to Access tab

image

From the Access Control List (ACL) selection, select Authenticate Read

image

Save it, then click on Object Storage to go back to the Object Storage menu.

image

Click on Access Keys

image

Create Access Key

image

Fill up the label and regions.

image

You can have more granualar security control on the keys by check the Limited Access option, it is for only accessing the bucket you allow, such as Read Only, Read / Write. For this tutorial, I leave it the default for the key to access every single bucket I have. Now, click on Create Access Key.

image

You should copy your Access key and Secret key and keep it somewhere safe. You can also download it and keep it safe.

Now, you have all the required parameter to fill up the S3 sync page on SiYuan.

Fill up the setting on your SiYuan

  1. Open SiYuan, go to Settings > Account, login your account that is connecting to Liuyun.io. If you are from mainland, you should choose Liandi.

  2. Go to Settings > Cloud and fill up the parameters.

    image

    Remember to enable cloud sync and generate conflict.

㊗️😄 YES, you are now able to setup on other device with the same set of instruction (2 and 3) to configure the syncing.

    Welcome to here!

    Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.

    Signup About
    Please input reply content ...
    • Knuex
      PRO

      Excellent guide!

      For people who just want to try an S3 compatible for syncing and doesn't want to spend yet, I'll recommend Cloudflare R2.

      It has a free tier. And with 2 devices, I think you will not surpass the pricing thresholds

    • MiscReply
    • keftozan

      I would recommend Cloudflare R2 storage, which has 10 GB and 1 million requests per month as a free tier, which you probably won't reach with normal usage.

      Another S3 provider is a Backblaze B2 with a 10 GB/month free tier, but I cannot recommend it as I find it quite slow, so I no longer use it.

    • glaucon1984
      VIP Warrior

      For those thinking about self-hosting an S3-compatible object storage for SiYuan, it's totally worth it.

      I've used Minio in a docker container, with SWAG to take care of the certs, and it works great. Much better than WebDAV, and being in Europe, there is a benefit in speed compared to using a server in another country, as latency impacts more the sync speed than bandwidth.

      Just an advice, if somebody wants to use Minio, I recommend to avoid issues with the fourth-level domain needed for the S3 bucket by changing the mode in SiYuan Cloud config to "Path-style". You just need a minio.yourdomain.com subdomain, and both your certs and your NginX config will be much cleaner.

    • jaar23
      PRO Author

      Yes! Just come to know that Cloudflare also has its S3 compatible storage, 10GB is unlikely to finish, even you did, only 0.015$ per month. It's quite cheap consider the number of requests and storage given.