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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

Rat's Blog - 建站知识

189List:一个全新的天翼云网盘的目录列表程序,CTList升级版 - Rat's Blog TopDocs:一款美观实用的在线文档编辑系统,支持Markdown语法 - Rat's Blog Navi:一个开源、美观且可以部署在GitHub Pages的网站导航程序 - Rat's Blog Shiori:一个简单、美观且带Web界面的书签管理器 - Rat's Blog 一个简单的PHP Web代理:miniProxy - Rat's Blog 一款开源,美观,带后台管理的网址导航工具:WebStack-Laravel - Rat's Blog 一款基于Web的免费在线矢量图(SVG)编辑工具:Method-Draw - Rat's Blog 使用宝塔面板安装Rocket.Chat多功能团队聊天室 - Rat's Blog Lstu:一款简单、美观的轻量级网址缩短程序 - Rat's Blog
一个可以绑定多个OneDrive网盘的极简目录列表:OneList - Rat's Blog
博主: Rat's · 2022-03-30 · via Rat's Blog - 建站知识

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

截图

请输入图片描述

更新

【2020.01.09】
修复内存占用过大。
新增支持在线视频播放的移动端自适应主题。

【2019.12.29】
新增隐藏目录或者文件。直接跳过缓存,减少API调用。
新增目录加密,支持不同目录不同账户密码。HTTP 401认证。

【2019.12.28】
新增搜索功能。

功能

  • 支持国际版、个人免费版(家庭版)、中国版(世纪互联)。
  • 支持同时列出多个盘的目录。(要求每个盘的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

更换主题

提示:下载主题的index.html文件,覆盖默认index.html文件,本文默认存放/opt/OneList,然后重启程序即可

主题地址:https://github.com/MoeClub/OneList/tree/master/Rewrite/@Theme

1、HaorWu

#作者
https://github.com/HaorWu

#特点
支持移动端自适应
支持当页搜索
支持按文件名, 日期, 大小排序
支持主动查看图片
支持在线播放视频

#下载地址
https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/%40Theme/HaorWu/index.html

2、jackjieYYY

#作者
https://github.com/jackjieYYY
https://www.hostloc.com/space-uid-38920.html

#特点
支持移动端自适应
支持当页搜索
支持按文件名, 日期, 大小排序
支持在线播放视频

#下载地址
https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/%40Theme/jackjieYYY/index.html

相关命令

启动:systemctl start onelist
停止:systemctl stop onelist
重启:systemctl restart onelist
查看状态:systemctl status onelist

卸载

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

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

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

如果有发现该程序存在BUG,可以提下,方便修复,有会前端的热心大佬,也可以自荐下,帮忙美化下该前端。


版权声明:本文为原创文章,版权归 Rat's Blog 所有,转载请注明出处!

本文链接:https://www.moerats.com/archives/1016/

如教程需要更新,或者相关链接出现404,可以在文章下面评论留言。