List your Onedrive at your website. This onelist wrote in GoLang. Easy to build your OneDrive List with this GoLang Script.
Github: https://github.com/MoeClub/OneList/tree/master/Rewrite
- Support international version, personal free version (home version), Chinese version (21Vianet).
- Support listing multiple disks at the same time. (Mount multiple network disks at the same time or mount a single network disk into multiple
SubPath
, requiring eachSubPath
unique) - Support more than 200 items in the folder
- Support the background to automatically refresh the cache.
- Support path contains special characters.
- Support using different directories and using different account password encryption (HTTP 401).
- Support hidden directories and files (skip cache).
- Support custom ClientID and SecretKey.
- The data is stored in the memory and the response is faster.
Authorize
Login via the URL below (right click to open new tab)
International Edition, Personal Edition (Home Edition)
Chinese version (21Vianet)
Add profile
# International Edition
OneList -a "url" -s "/onedrive01"
# Personal Edition (Home Edition)
OneList -ms -a "url" -s "/onedrive02"
# Chinese version (21Vianet)
OneList -cn -a "url" -s "/onedrive03"
# Obtain the entire url content starting with http: // loaclhost in the browser address bar
# Replace the obtained complete url content with the url three letters in the command
# The generated url can only be used once, try again url
# Can map multiple folders in a disk to multiple `SubPath`
# This operation will automatically add the configuration file
# Prompt Success! Add config. '/path/to/config.json' is successful
Modify configuration file
[
{
// If it is a home version or a personal free version, this item should be true.
"MSAccount": false,
// If it is the Chinese version (21Vianet), this item should be true.
"MainLand": false,
// Authorization token
"RefreshToken": "1234564567890ABCDEF",
// In a single configuration file, this item needs to be unique.
// Set this OneDrive as the `RootPath` directory mapping under`
// http://127.0.0.1:5288/onedrive`.
// (It is recommended to use the root directory "/" when only one drive is available.)
"SubPath": "/onedrive",
// Read a directory of OneDrive as the root directory. (Support root directory "/")
"RootPath": "/Test",
// Hide the folders and files in the OneDrive directory,
// use "|" to separate the entries. (Skip the cache settings.)
"HidePath": "/Test/Obj01|/Test/Obj02",
// Encrypt OneDrive directory with username and password. Use "?" To separate
// directory and username,":" to separate username and password, and "|" to
// separate entries. Invalid entries will be skipped.
"AuthPath": "/Test/Auth01?user01:pwd01|/Test/Auth02?user02:pwd02",
// Cache refresh interval. (The minimum refresh time in all projects is the
// effective refresh interval)
"RefreshInterval": 900
}
]
use
Usage of OneList:
-a string
// Initialize configuration file, add new configuration
Setup and Init auth.json.
-bind string
// Bind IP address (public network: 0.0.0.0)
Bind Address (default "127.0.0.1")
-port string
// Bind port (HTTP: 80)
Port (default "5288")
-s string
// Set SubPath item, need to be used with -a.
Set SubPath. [unique per account] (default "/")
-c string
// Configuration file
Config file. (default "config.json")
-t string
// Index.html directory style file
Index file. (default "index.html")
-json
// Data output current directory data in json format
Output json.
-cn
// To authorize the Chinese version (21Vianet), this parameter is required.
OneDrive by 21Vianet.
-ms
// Authorized Personal Edition (Home Edition), this parameter is required.
OneDrive by Microsoft.
-C string
// Overwrite all preset Client IDs. (Not recommended for beginer)
Set Client ID. [Overwrite all clientId]
-S string
// Overwrite all preset Secret Keys. (Not recommended for novices)
Set Secret Key. [Overwrite all secretKey]
-P string
// Set the reverse domain name. This setting directs all traffic to a server
// or CDN, used to hide the global domain name or speed up.
// Each group is separated by ";". The source domain name and the target domain
// name are separated by "|". Multiple groups can be set.
// The default is empty, do not use brackets when using. (Not recommended for
// beginer to use this parameter)
Set Proxy Domain. ["x.sharepoint.com|domain.com;x.sharepoint.cn|domain.cn;..."]
run
# Ensure that config.json and index.html are in the same directory and run directly.
$ OneList
# Monitor public port 80
$ OneList -bind 0.0.0.0 -port 80
note
- During the initial cache or when opening an empty folder, No Found will be prompted.
- Please edit the config.json file manually using UTF-8 encoding mode.
Nginx reverse generation configuration
location ^~ /onedrive/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:5288;
}
Run in the background and start automatically
# /path/to/OneList OneList is the full path of OneList
# Background process
nohup /path/to/OneList -bind 0.0.0.0 -port 80 >/dev/null 2>&1 &
# Start up automatically and run in the background
# Edit the /etc/crontab file, and add the following line and press Enter a few times.
# (Some systems may leave an accident without leaving blank lines)
@reboot root nohup /path/to/OneList -bind 0.0.0.0 -port 80 >/dev/null 2>&1 &
Client/Secret (~ 2299/12/31)
# International version: 78d4dc35-7e46-42c6-9023-2d39314433a5 | ZudGl-p.m = LMmr3VrKgAyOf-WevB3p50
# Chinese version: dfe36e60-6133-48cf-869f-4d15b8354769 | H0-1: 6.Sb8: WCW / J-c] K @ fddCt [i0EZ2
# ReplyURL: http://localhost/onedrive-login