title=

Change Onedrive default storage

Before we begin,First login to the Office 365 E5 admin panel through portal.office.com。Click the admin on the bottom left,Select Show all-SharePoint-Onedrive admin center-storage,Here, we can see E5 developer subscription the default storage for Onedrive is 1024GB。

We can change it to the maximum 5TB. After saved,Your new E5 account will have 5TB storage for its Onedrive。

Want to know how to get the official Office Suite and 5T Onedrive? Please check:Apply for Microsoft 365 E5 developer program | Enjoy free Office Suite + 5T Onedrive

Install Onelist

The following commands were used on Debian 10 system, it may vary depending on different systems

# create and enter onelist folder
mkdir onelist && cd onelist
# download Onelist program「amd64 version」
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/amd64/linux/OneList
# grant permission
chmod +x OneList

Authorization

Use the following URL to authorize

  • International、Personal account:Click Me
  • Chinese account「21Vianet」:Click Me

Create and modify config

# Create config
# International account
./OneList -a "url" -s "/onedrive"
# Personal account「Home」
./OneList -ms -a "url" -s "/onedrive"
# Chinese account「21Vianet」
./OneList -cn -a "url" -s "/onedrive"
# modify config
nano config.json
  • Use authorization link to get a url begin with http://loaclhost and replace it with url
  • Each authorization link can be only used once, re-authorization if you need to re-try
  • Success! Add config. '/path/to/config.json' means you're good to go

example config file

[
  {
    // This should be true if you're using personal account.
    "MSAccount": false,
    // This should be true if you're using 21Vianet account
    "MainLand": false,
    // RefreshToken
    "RefreshToken": "1234564567890ABCDEF",
    // SubPath should be unique if you have only one config file
    // If you set this as /onedrive, you should visit it using `http://ip:port/onedrive`
    // If you only bind one disk directory, it's recommended to use "/"
    "SubPath": "/onedrive",
    // Set which onedrive directory as root directory. (support "/")
    "RootPath": "/Test",
    // Hide the file and folder in onedrive, divide it using "|"
    "HidePath": "/Test/Obj01|/Test/Obj02",
    // Use username and password to encrypt onedrive folder. "?" used between directory and username, ":" used between username and password
    "AuthPath": "/Test/Auth01?user01:pwd01|/Test/Auth02?user02:pwd02",
    // RefreshInterval
    "RefreshInterval": 900
  }
]

Run the program

# download the theme file
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/%40Theme/HaorWu/New/index.html
# bing it to the public IP and port
./OneList -bind 0.0.0.0 -port 5288

Running parameters

Usage of OneList:
  -a string
        Setup and Init auth.json.
  -bind string
        // bind IP address(Public ip: 0.0.0.0)
        Bind Address (default "127.0.0.1")
  -port string
        Port (default "5288")
  -s string
        Set SubPath. [unique per account] (default "/")
  -c string
        Config file. (default "config.json")
  -t string
        Index file. (default "index.html")
  -json
        Output json.
  -cn
        OneDrive by 21Vianet.
  -ms
        OneDrive by Microsoft.
  -C string
        // not recommend for newbie
        Set  Client ID. [Overwrite all clientId]
  -S string
        // not recommend for newbie
        Set Secret Key. [Overwrite all secretKey]
  -P string
        // not recommend for newbie
        Set Proxy Domain. ["x.sharepoint.com|domain.com;x.sharepoint.cn|domain.cn;..."]
  • In first cache process or open empty folder, it will show No Found.
  • Please use UTF-8 when editing config.json.

Domain access

You can set reverse proxy using Nginx, Caddy, aaPanel or any other tools you prefer. Here, I will just demonstrate how to set it using aaPanel.

Login to your aaPanel dashboard, click Website-Add site, After added, click the domain name and choose Reverse proxy, set the reverse proxy as bellow:

Background running

# use tmux as example
apt update
# install tmux
apt install tmux
# create session
tmux new -s onelist
# start the onlist in the session
./OneList -bind 0.0.0.0 -port 5288

Video Tutorial

Youtube

Bilibili

Last modification:January 5, 2021
If you like my post, you can donate to buy me a cup of coffee.