Background#
I have wanted a network shared folder for a long time, which can be used as a regular folder locally and accessed via the internet.
I roughly compared the services that could potentially achieve this functionality:
| Service | Advantages | Disadvantages |
|---|---|---|
| Domestic cloud storage represented by Baidu Cloud | Large storage space | Poor support for linux, slow access speed |
Foreign cloud storage like google drive/mega | linux client support | Smaller storage space, slow or even unreachable in China |
Various oss services (e.g., Alibaba Cloud oss) | Official mount support, unlimited speed | Accumulated storage, traffic, and request costs, expensive |
| Idle storage space on servers | Accessible via sftp | Limited by server bandwidth, not ideal usage |
As we can see, each service has its pros and cons. Recently, I discovered another product: Century Internet Version of OneDrive. It is operated by Microsoft through Century Internet in China. Compared to the international version of OneDrive, its data centers are located in Beijing/Shanghai, greatly optimizing access speed for domestic users. Additionally, there are many low-priced accounts available on Taobao, where you can buy "permanent" 5T storage space for fifty or sixty yuan (this is questionable). After searching online, I found that this Century Internet Version of OneDrive can be mounted locally using modified rclone, and accessed in the cloud using open-source projects like modified oneindex, zfile, etc. (without using server traffic, unlimited speed), perfectly meeting my needs, so I got one and prepared to get started.
Requirements#
- A personal computer
- A server
- An open API
Century Internet Version of OneDriveaccount (must be open API!)
Cloud Side#
First, let's talk about the simple cloud access. I am using zfile (because it is easy to configure and natively supports Century Internet OneDrive).
The following operations are based on
ubuntu, forcentosplease refer to the official documentation.
SSH into the server and first install the dependencies:
Download the project, unzip it, and give it executable permissions:
Start the project:
Next, access http://your_public_ip:8080/#/install for configuration. The access token and refresh token need to be obtained by logging in at this URL. After filling in successfully, click confirm to complete the configuration, and you can access your OneDrive cloud drive on the web!
Local#
Next, let's configure the slightly more complex local mount.
The following content is reproduced from znov's blog, as he mounted it on the server, while I am doing it on my local machine, so I made a few minor modifications. (Windows only needs to perform the first three steps, not tested).
-
Obtain
CLIENT_IDandCLIENT_SECRETforCentury Internet OneDrive- Open this webpage and log in.
- Find
Azure Active Directoryon the left and click it.
FindApp registrationson the left and click it.
FindNew registrationat the top and click it.
Name:onedrive
Supported account types:Any organizational directory(the second option)
Redirect URL:http://localhost:53682
Click register.
FindApplication (client) IDand copy it for later use.
FindCertificates & secretson the left and click it.
Below, Client secrets -New client secret
Description:onedrive
Expiration: defaultin one year
Click Add, copy theValuefor later use.
FindAPI permissionson the left and click it.
Add permissions:Microsoft Graph-Delegated permissions: check all (through my testing, checking only theFilesection is sufficient).
-
Install and configure
rclone-
Download here the
rcloneCentury Internet version.This file comes from the global hosting forum, thanks to the great contributor. The original blog's download link is very slow, so I saved a copy. I hope everyone can also take a moment to comment and support the original blog!
-
Open
terminalin the current directory onlinuxand executeFor
windows, please refer to how to add files to the environment variable.Note: This step is not mandatory. If not executed, change
rclonein the following commands to the path form ofrclone. -
Enter
rclone configto configure as follows
-
-
Mounting
linuxneeds to installfuse, which varies by distribution, so I won't elaborate. Mymanjarocomes with it.The command is as follows: (where / represents the path to mount
onedrivelocally, and/mnt/represents the local mount path, which can be modified accordingly) -
Using the mount script
This mount script can achieve basic mounting, unmounting, and remounting functions, so you won't need to enter such long commands afterward. The script is as follows:
Assuming this script is saved as
rcloned, first give it executable permissions:You can then choose to move it to the environment variable, manually execute
rcloned startwhen using:You can also choose to set it to run automatically at boot like the original text (may not be supported by all distributions):
Screenshot#

Thoughts#
I originally planned to write a short article, but unexpectedly ended up writing so much...
Some steps in between are overly detailed, I hope you don't find me verbose while reading orz
References#
-
Zephyr Grocery Store (where I purchased the account)