排行榜 统计
  • 文章总数:56 篇
  • 评论总数:253 条
  • 分类总数:5 个
  • 最后更新:2023年11月15日

OneList:可以绑定多个OneDrive网盘的目录列表

本文阅读 5 分钟
首页 教程 正文

图才是本体啦

介绍

本文介绍的OneList非原版本OneList,是萌咖大佬弃用Python版本,使用Golang重写的OneList版本,同时支持国际版、个人免费版(家庭版)、中国版(世纪互联)及多网盘绑定。

特点

  • 支持国际版, 个人免费版(家庭版), 中国版(世纪互联).
  • 支持同时列出多个盘的目录.(同时挂载多个网盘或单个网盘挂载成多个SubPath,要求每个SubPath唯一).
  • 支持文件夹内超过 200 个项目.
  • 支持后台自动刷新缓存.
  • 支持路径中含有特殊字符.
  • 支持使用不同目录使用不同账户密码加密(HTTP 401).
  • 支持隐藏目录和文件(跳过缓存).
  • 支持自定义 ClientID 和 SecretKey.
  • 数据储存在内存中,响应更加迅速.

安装教程

1. 安装OneList

#新建并进入OneList目录
mkdir /opt/OneList && cd $_
#64位系统下载
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/amd64/linux/OneList
#32位系统下载
wget https://raw.githubusercontent.com/MoeClub/OneList//master/Rewrite/i386/linux/OneList
#arm架构下载
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/arm/linux/OneList   
#给予OneList权限
chmod +x OneList

2. 授权认证
点击下方URL登录并授权,
国际版、个人版(家庭版)     中国版(世纪互联)
之后会获得一个localhost开头的链接,将网页地址全部复制。(此网页打不开)
3. 生成配置文件

#将url换成你上面复制的授权地址(完整链接,包括http://)
#国际版
./OneList -a "url" -s "/onedrive01"
#个人版(家庭版)
./OneList -ms -a "url" -s "/onedrive02"
#中国版(世纪互联)
./OneList -cn -a "url" -s "/onedrive03"

目录出现config.json则成功。
配置文件路径:/opt/OneList/config.json,其说明,根据需求更改:

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

4. 运行OneList(退出SSH时,程序会停止)

#下载默认的index.html主题
cd /opt/OneList
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/index.html -P /opt/OneList
#监听8080地址,自行修改
/opt/OneList/OneList -bind 0.0.0.0 -port 8080

5. 设置开机自启(推荐使用,退出SSH程序不会停止)
命令:(一起复制执行)

#设置你的运行监听端口,可通过ip:端口访问程序(需要打开防火墙,如果用域名访问,不建议打开防火墙),端口自定义
port="8080"
cat > /etc/systemd/system/onelist.service <<EOF
[Unit]
Description=onelist
After=network.target
[Service]
Type=simple
ExecStart=/opt/OneList/OneList -bind 0.0.0.0 -port ${port}
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl start onelist
systemctl enable onelist

主题文件

1. HaorWu

#特点
支持移动端自适应
支持当页搜索
支持按文件名, 日期, 大小排序
支持主动查看图片
支持在线播放视频
cd opt/OneList
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/%40Theme/HaorWu/index.html

2. jackjieYYY

#特点
支持移动端自适应
支持当页搜索
支持按文件名, 日期, 大小排序
支持在线播放视频
cd opt/OneList
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/%40Theme/jackjieYYY/index.html

3. 推荐使用

#在以上基础上加入了音乐播放功能
cd opt/OneList
wget https://raw.githubusercontent.com/NomadJohn/issue-blog/master/index.html

相关命令

#OneList命令
Usage of OneList:
  -a string
        // 初始化配置文件,添加新配置
        Setup and Init auth.json.
  -bind string
        // 绑定IP地址(公网: 0.0.0.0)
        Bind Address (default "127.0.0.1")
  -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")
  -cn
        // 开关
        // 授权中国版(世纪互联), 需要此参数.
        OneDrive by 21Vianet.
  -ms
        // 开关
        // 授权个人版(家庭版), 需要此参数.
        OneDrive by Microsoft.
#卸载
rm -rf /opt/OneList
#设置开机自启后的命令
启动:systemctl start OneList
停止:systemctl stop OneList
重启:systemctl restart OneList
查看状态:systemctl status OneList
#卸载
systemctl stop OneList
systemctl disable OneList
rm -rf /opt/OneList /etc/systemd/system/OneList.service

域名访问

直接反代127.0.0.1:8080(自己定义OneList的端口)即可。

    location ^~ /onedrive/ {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_pass http://127.0.0.1:5288;
    }

希望大家能顺畅的搭建完成。作者GitHub地址:GitHub


本文来自投稿,不代表本站立场,如若转载,请注明出处:
-- 展开阅读全文 --
ServerStatus美化版探针—多服务器一键安装脚本
« 上一篇 06-16
bbr/bbrplus/bbr2/锐速/bbr魔改版脚本合集
下一篇 » 06-23

发表评论

发表评论