Menu

Tree [ff2a4f] master /
 History

HTTPS access


File Date Author Commit
 cache 2018-12-23 TheZihanGu TheZihanGu [cdf845] 修改了部分显示内容
 config 2018-12-23 TheZihanGu TheZihanGu [cdf845] 修改了部分显示内容
 controller 2018-12-20 Secret Secret [4cd707] 新增防盗链
 lib 2018-12-22 ellermister ellermister [c65250] Update onedrive.php
 view 2018-12-23 TheZihanGu TheZihanGu [cdf845] 修改了部分显示内容
 .dockerignore 2018-08-09 YinAoXiong YinAoXiong [dd1e4d] 添加Dockerfile以及nginx和php的配置文件
 .htaccess 2018-08-22 Zxilly Zxilly [c3b58f] 修复win32上Apache可能出现乱码
 Dockerfile 2018-12-01 TimeBye TimeBye [cccaab] [IMP]优化Dockerfile
 README.md 2018-12-23 TheZihanGu TheZihanGu [63ac38] 优化README.md文件
 default.conf 2018-12-01 TimeBye TimeBye [cccaab] [IMP]优化Dockerfile
 docker-compose.yml 2018-12-02 TimeBye TimeBye [56b563] [FIX]docker-compose变量设置错误问题
 docker-entrypoint.sh 2018-12-01 TimeBye TimeBye [cccaab] [IMP]优化Dockerfile
 index.php 2018-12-20 Secret Secret [4cd707] 新增防盗链
 init.php 2018-12-20 Secret Secret [4cd707] 新增防盗链
 one.php 2018-10-19 donwa donwa [10c58a] Update one.php
 php.ini 2018-08-09 YinAoXiong YinAoXiong [dd1e4d] 添加Dockerfile以及nginx和php的配置文件

Read Me

OneIndex

Onedrive Directory Index

功能:

不占用服务器空间,不走服务器流量,

直接列出 OneDrive 目录,文件直链下载。

Demo

https://xn.tn

安装运行

源码安装运行:

需求:

1、PHP空间,PHP 5.6+ 需打开curl支持
2、OneDrive 账号 (个人、企业版或教育版/工作或学校帐户)
3、OneIndex 程序

配置:

image

Docker 安装运行:

运行:

docker run -d --name oneindex \
    -p 80:80 --restart=always \
    -v ~/oneindex/config:/var/www/html/config \
    -v ~/oneindex/cache:/var/www/html/cache \
    -e REFRESH_TOKEN='0 * * * *' \
    -e REFRESH_CACHE='*/10 * * * *' \
    setzero/oneindex

变量说明:

  • REFRESH_TOKEN刷新一次token的crontab表达式,默认值0 * * * *,即每小时
  • REFRESH_CACHE刷新一次cache的crontab表达式,默认值*/10 * * * *,即每10分钟

停止删除容器:

docker stop oneindex
docker rm -v oneindex

Docker-compose 安装运行:

运行:

docker-compose up -d

停止删除容器:

docker-compose down

计划任务

[可选]推荐配置,非必需。后台定时刷新缓存,可增加前台访问的速度。

# 每小时刷新一次token
0 * * * * /具体路径/php /程序具体路径/one.php token:refresh

# 每十分钟后台刷新一遍缓存
*/10 * * * * /具体路径/php /程序具体路径/one.php cache:refresh

特殊文件实现功能

README.mdHEAD.md.password特殊文件使用

可以参考https://github.com/donwa/oneindex/tree/files

在文件夹底部添加说明:  

在 OneDrive 的文件夹中添加README.md文件,使用 Markdown 语法。

在文件夹头部添加说明:  

在 OneDrive 的文件夹中添加HEAD.md 文件,使用 Markdown 语法。

加密文件夹:  

在 OneDrive 的文件夹中添加.password文件,填入密码,密码不能为空。  

直接输出网页:

在 OneDrive 的文件夹中添加index.html 文件,程序会直接输出网页而不列目录。
配合 文件展示设置-直接输出 效果更佳。

命令行功能

仅能在PHP CLI模式下运行

清除缓存:  

php one.php cache:clear

刷新缓存:  

php one.php cache:refresh

刷新令牌:  

php one.php token:refresh

上传文件:  

php one.php upload:file 本地文件 [OneDrive文件]

上传文件夹:

php one.php upload:folder 本地文件夹 [OneDrive文件夹]

例如:

//上传demo.zip OneDrive 根目录  
php one.php upload:file demo.zip  

//上传demo.zip OneDrive /test/目录  
php one.php upload:file demo.zip /test/  

//上传demo.zip OneDrive /test/目录并将其命名为 d.zip  
php one.php upload:file demo.zip /test/d.zip  

//上传up/ OneDrive /test/ 目录  
php one.php upload:file up/ /test/
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.