Select Page

Install Onelist On Centos 7 – Simple Index For Onedrive
Posted on February 06, 2020
Install Onelist On Centos 7 – Simple Index For Onedrive

Jackie, also known by his nick-name KK, always strives for the best and learn from the best. Working and living as a Freelance Web Engineer/ Web Developer & Designer/ Amateur Youtuber/ Husky Lover. If you love one of these things that I love, we already have something in common.

Jackie Sung


OneList is a OneDrive files directory index application written in GoLang.

In this post, we're gonna install and configure OneList - a simple index for onedrive.


Step 1 - Preparation

Install Golang

cd ~ && curl -O
tar -C /usr/local -xzf go1.13.linux-amd64.tar.gz
vim ~/.bash_profile

Add following code at the last

export GOPATH=$HOME/work
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
source ~/.bash_profile
go version

Step 2 - Install OneList

mkdir /usr/local/bin/OneList && cd $_
chmod +x OneList

Step 3 - Authorization

International and personal version

Chinese version

Add config.json file

## Replace url with full contents you get above starting with http://loaclhost
# International
OneList -a "url" -s "/onedrive"
# Personal
OneList -ms -a "url" -s "/onedrive"
# Chinese
OneList -cn -a "url" -s "/onedrive"
# Success! Add config. '/path/to/config.json' means config successfully created


Usage of OneList:
  -a string
        // 初始化配置文件,添加新配置
        Setup and Init auth.json.
  -bind string
        // 绑定IP地址(公网:
        Bind Address (default "")
  -port string
        // 绑定端口(HTTP:80)
        Port (default "5288")
  -s string
        // 设置 SubPath 项, 需要与 -a 一起使用.
        Set SubPath. [unique per account] (default "/")
  -c string
        // 配置文件
        Config file. (default "config.json")
  -t string
        // Index.html 目录样式文件
        Index file. (default "index.html")
        // 开关
        // 数据以 json 形式输出当前目录数据
        Output json.
        // 开关
        // 授权中国版(世纪互联), 需要此参数.
        OneDrive by 21Vianet.
        // 开关
        // 授权个人版(家庭版), 需要此参数.
        OneDrive by Microsoft.
  -C string
        // 覆写所有预置的 Client ID. (不建议新手使用此参数)
        Set  Client ID. [Overwrite all clientId]
  -S string
        // 覆写所有预置的 Secret Key. (不建议新手使用此参数)
        Set Secret Key. [Overwrite all secretKey]


    // 如果是家庭版或者个人免费版, 此项应为 true.
    "MSAccount": false,
    // 如果是中国版(世纪互联), 此项应为 true.
    "MainLand": false,
    // 授权令牌
    "RefreshToken": "1234564567890ABCDEF",
    // 单配置文件中,此项要唯一.将此OneDrive中设置为`RootPath`目录映射在`` 下.
    // (只推荐一个盘位的时候使用根目录"/".)
    "SubPath": "/onedrive",
    // 读取OneDrive的某个目录作为根目录. (支持根目录"/")
    "RootPath": "/Test",
    // 隐藏OneDrive目录中的文件夹和文件, 条目间使用 "|" 分割. (跳过缓存设置的条目.)
    "HidePath": "/Test/Obj01|/Test/Obj02",
    // 使用用户名和密码加密OneDrive目录. 目录和用户名密码间使用 "?" 分割, 用户名密码使用 ":" 分割, 条目间使用 "|" 分割. 无效条目将跳过. 
    "AuthPath": "/Test/Auth01?user01:pwd01|/Test/Auth02?user02:pwd02",
    // 缓存刷新间隔.(所有项目中的刷新时间取最小值为有效刷新间隔)
    "RefreshInterval": 900

Step 4 - Run OneList

Download index.html file

# Origin

# With online video playing feature

Run OneList on port 8801

nohup /usr/local/bin/OneList/OneList -bind -port 8801  > /dev/null 2>&1 &

Nginx reverse proxy

location ^~ /onedrive/ {
    proxy_set_header X-Real-IP $remote_addr;

Step 5 - Control Process with Supervisor

yum -y install supervisor
useradd onelist
vim /etc/supervisord.d/onelist.ini
command=nohup /usr/local/bin/OneList/OneList -bind -port 8801  > /dev/null 2>&1 &
chkconfig supervisord on
service supervisord start
supervisorctl reload
supervisorctl restart all

Copyright Statement: Original Article of

Please Indicate the Source: Install Onelist On Centos 7 – Simple Index For Onedrive | Jackie Sung's Blog

Related Articles


Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This