惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

萌虎 | moehu.org

一键更改Linux端显示语言为简体中文 - 萌虎 | moehu.org 国内开源镜像站点汇总 - 萌虎 | moehu.org 甲骨文使用dd救援系统重装 - 萌虎 | moehu.org Linux VPS纯净版Debian/Ubuntu/CentOS/Windows系统一键安装脚本 - 萌虎 | moehu.org Windows系统各版本最新KMS GVLK列表,带一键激活Win脚本 - 萌虎 | moehu.org 在线无损压缩图片神器Optimizilla - 萌虎 | moehu.org OneDrive网盘上传神器支持文件和文件夹上传 - 萌虎 | moehu.org 一款多储存方案的开源图床 兰空图床(Lsky Pro) - 萌虎 京东助手+淘宝试用助手+苏宁易购试用申请最新版 - 萌虎 | moehu.org
OneDrive网盘极简目录列表程序OneList - 萌虎 | moehu.org
博主: 尐酱油 · 2021-04-27 · via 萌虎 | moehu.org

前言

OneList主要的特色就是解决了因OneDrive API抽风导致的很多问题,稳定性和访问速度都是不错的。不过由于使用Python写的,而Py单线程容易阻塞,响应不够迅速,刷新缓存时,Web端请求基本不可用,所以在整体性能上有点瑕疵。基于Golang的性能更好,效率更高,多盘并发缓存等众多好处,于是萌咖大佬就弃用Python版本,使用Golang重写了OneList,同时支持国际版、个人免费版(家庭版)、中国版(世纪互联)及多网盘绑定,欢迎大家品尝~

项目地址

MoeClub/OneList: Simple index for onedrive (github.com)

截图

  • OneList.png

功能

  • 支持国际版、个人免费版(家庭版)、中国版(世纪互联)。
  • 支持同时列出多个盘的目录。(要求每个盘的SubPath唯一)
  • 支持文件夹内超过200个项目。
  • 支持后台自动刷新缓存。
  • 支持路径中含有特殊字符。
  • 数据储存在内存中,响应更加迅速。

安装

Github地址:https://github.com/MoeClub/OneList/tree/master/Rewrite

1、授权认证
点击右侧URL登录并授权,授权【国际版、个人版(家庭版)】、【中国版(世纪互联)】。

授权后会获取一个localhost开头打不开的链接,这里复制好整个链接地址,包括localhost

2、安装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

#给予权限
chmod +x OneList

3、使用命令

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.

4、生成配置文件

#国际版,将url换成你上面复制的授权地址,包括http://loaclhost。
./OneList -a "url" -s "/onedrive01"

#个人版(家庭版),将url换成你上面复制的授权地址,包括http://loaclhost。
./OneList -ms -a "url" -s "/onedrive02"

#中国版(世纪互联),将url换成你上面复制的授权地址,包括http://loaclhost。
./OneList -cn -a "url" -s "/onedrive03"

提示Success! Add config. '/path/to/config.json'信息,则添加成功。

这里要注意的是:

1. 授权url地址只能用一次,超过需要重新授权。
2. 命令中的/onedrive01参数为指定网盘地址后缀,比如http://domain.com/onedrive01。
3. 授权多个网盘的话,重复授权多次即可,参数均会添加到一个配置文件,且后缀不能重复。
4. 地址后缀填错了的,可以稍后在配置文件中修改。

本文默认的配置文件路径/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
  }
]

这里注意,挂载多个盘符的时候,SubPath参数请不要为/,单个网盘建议为/

5、运行OneList

#下载index.html,与config.json同目录,即本文默认的/opt/OneList
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/index.html -P /opt/OneList
#监听8000地址,自行修改
/opt/OneList/OneList -bind 0.0.0.0 -port 8000

最后打开ip:端口访问即可,如果你挂载网盘的时候SubPath/,那么直接通过根目录查看,如果为/onedrive1,那么通过ip:端口/onedrive1查看,如果该路径不存在,则会提示No Found.

且首次运行会异步缓存,也就是至少有一个盘缓存成功了,才会显示。

6、开机自启
这里新建一个简单的systemd配置文件,适用CentOS 7Debian 8+Ubuntu 16+

使用命令:

#设置你的运行监听端口,即你可以通过ip:端口访问程序,这里默认8000。
port="8000"
#将以下代码一起复制到SSH运行
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

卸载

#未设置开机自启
rm -rf /opt/OneList

#设置过开机自启
systemctl stop onelist
systemctl disable onelist
rm -rf /opt/OneList /etc/systemd/system/onelist.service

最后如果我们只想显示网盘的某些文件夹,那么可以分别挂载该网盘的不同目录即可,具体操作看配置文件说明。