Synology NAS mounts Alibaba cloud disk through alist and configures synchronization

Recently, I have been using docker version of messense/aliyundrive-webdav to synchronize the Alibaba cloud disk, but this docker version has bugs. When there are many files, there is often an endless loop. The infinite loop downloads and deletes local files, and the download can never be completed.

So consider replacing aliyundrive-webdav and use alist .

Install and configure alist

what is alist

alist is a file list program that supports multiple storages, official website address: https://alist.nn.ci/zh/

alist can mount various network disks, and can mount other open alist , such as Xiaoya, Brahma, etc.

The most important thing is that recently alist supports the official Alibaba Cloud Disk Open Interface [Alibaba Cloud Disk Open].

Reference document address: https://alist.nn.ci/zh/guide/drivers/aliyundrive_open.html

The open platform is still in the internal testing stage: https://www.yuque.com/aliyundrive/zpfszx

install alist

Here we choose the Mining God kit library (official website: https://imnks.com/), which can be installed more easily with a third-party kit library. If you have not configured a third-party package source, you can add it yourself :

Mining God: https://spk7.imnks.com/

image-20230301101504729

After configuring the package source, search for alist and install it

image-20230301101833104

Installing third-party packages generally has certain risks. The tips are as follows, and you must agree to install them. Please judge by yourself:

image-20230301102033029

Log in after installation, the default account is: admin , password: alist

After logging in, you can change the password and add other accounts. It is recommended to add an account instead of using admin directly.

Guest account processing

guest account can browse files by default and cannot be deleted, which needs attention.

Since it is a self-built alist , I don’t want to expose it. You can consider configuring the basic path of guest to the path of an empty folder (you must mount the storage first to select the path). I don’t know if there is a better way.

image-20230301102742568

Mount Alibaba Cloud DiskOpen

The latest is to use Alibaba Cloud Disk Open, and the previous Alibaba Cloud Disk is no longer recommended.

Basic instructions

Click [Add] under [Storage], you can see that there are three options related to Alibaba Cloud Disk in alist :

image-20230301103002522

Alibaba cloud disk – the old model, use token in the browser

Alibaba Cloud Disk Open – the latest open platform model of Alibaba Cloud Disk (choose it)

Alibaba cloud disk sharing – you can directly mount the address shared by others, the sharing may expire, it is not recommended to use, unless the capacity of your own Alibaba cloud disk is too small.

Mount cloud disk

After clicking [Alibaba Cloud Disk Open], the configuration interface will appear. There are mainly [Mount Path] and [Refresh Token] to pay attention to. If you want to configure synchronization, also pay attention to this [WebDAV Policy], which will be mentioned later.

[Mount Path] Define one by yourself, I use /aliyundrive here, and [Refresh Token] needs to be obtained on a separate page.

image-20230301103507321

get refresh token

Although they are both called refresh tokens, this token is different from refresh_token obtained in previous browsers, and the format is also different.

Reference document: https://alist.nn.ci/zh/guide/drivers/aliyundrive_open.html

Enter the page: https://alist.nn.ci/tool/aliyundrive/request.html, you can log in or scan the QR code :

After scanning the QR code and confirming the authorization on the mobile phone, click [I have scan]

image-20230301104023063

The new page that pops up has refresh_token , which is based on JWT Token format. The previous token is similar to a uuid :

image-20230301104151192

Copy token and fill it in the [Refresh Token] of the previous form, and fill in other options casually. After [Add], you can see that the status is work.

At this time, you can browse to the file by entering the home page.

image-20230301105025646

Configure Alibaba Cloud Disk Synchronization

Alibaba cloud disk has been mounted to alist , and alist itself also provides WebDAV service, the access address is: http://nas_ip:5244/dav

Although the Alibaba cloud disk can be directly accessed, some files may be easily stolen, so I still want to synchronize some required files to NAS

CloudSync synchronization error

However, using this directly to configure the synchronization service in Synology’s CloudSync will report an error.

download failed. Insufficient permissions

image-20230301110655135

This is mainly the WebDAV policy problem of the default configuration alist

The default WebDAV policy is [302 Redirection], related policy introduction: https://alist.nn.ci/zh/guide/drivers/common.html#webdav-%E7%AD%96%E7%95%A5

image-20230301110908876

  • 302 Redirect: Redirect to the real link (there is a problem with CloudSync synchronization, but there is no local transfer, and no local bandwidth when accessing from the external network)
  • Use proxy URL: Redirect to proxy URL (requires proxy address)
  • Local agent: return data directly through local transfer (for best compatibility, it needs to be transferred once from the local, and external access also needs to go through the local alist service)

From the above strategy, the best way is to separate the Alibaba cloud disk mount and the synchronization folder mount, and the synchronization folder uses the local agent mode alone, and specifies the root folder ID

Configure sync folder hook

Enter web version of Alibaba Cloud Disk, enter the folder you need to synchronize, and copy the part behind /folder/ from the browser address bar:

https://www.aliyundrive.com/drive/folder/xxxxxxxxxxxx, this is [root folder ID ]

image-20230301105332997

Configure sync folder

There is no difference between configuring the synchronization folder and the previous WebDAV synchronization. Select [+] in Synology’s CloudSync suite:

image-20230301111847188

After selecting WebDAV , configure WebDAV address and account information:

image-20230301110031585

Configure the synchronization folder, here choose the mount address of your own synchronization folder:

image-20230301110127834

After the configuration is complete, the data can be synchronized. The current test is quite stable, and there is no infinite loop phenomenon.

Mount third-party alist

A great advantage of alist is that you can mount some open alist to your own alist for local access, and after mounting alist to a local disk through CloudDrive , you can also access it like a local disk, which is very convenient .

Xiaoya: http://alist.xiaoya.pro/

Brahma: https://iemo.fun/

Note: It is generally recommended to install a docker service to request, use your own Token , direct mounting is not a good way, often access failure, here is just a test

Here we take Xiaoya as an example, select [AList V3] as the driver, mount path: /xiaoya , link: http://alist.xiaoya.pro/ :

image-20230301113647053

In this way, you can simply mount Xiaoya to your alist .

This article is transferred from https://fugary.com/?p=428
This site is only for collection, and the copyright belongs to the original author.