介绍几款网盘程序:CloudreveFileAppsOneListfilerunNextCloud,并对分析这些网盘优缺点及个人评分,具体如下:

项目 评分 类型 优点 缺点
Cloudreve 4.8 分享型 轻量,简洁 暂无
FileApps 4.5 列表型 简洁轻量 太轻量了
OneList 4.5 列表型 不消耗服务器流量 网络容易炸
filerun 4.5 分享型 中规中矩 汉化不完全
NextCloud 3.5 分享型 功能齐全,全平台同步 臃肿

以下搭建环境均为:CentOS7,LNMP,可根据自己搭建环境进行相应改动。

Alist


curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install /home/wwwroot/alist

Cloudreve


配置程序:

cd /home/wwwroot/pan.imcxx.com
wget https://github.com/cloudreve/Cloudreve/releases/download/3.0.0-rc1/cloudreve_3.0.0-rc1_linux_amd64.tar.gz
tar -zxvf cloudreve_3.0.0-rc1_linux_amd64.tar.gz
chmod +x ./cloudreve
./cloudreve

默认监听ip:5212,可以修改conf.ini更换端口

开机启动:
vi /etc/systemd/system/cloudreve.service

[Unit]
Description=cloudreve
After=network.target

[Service]
Type=simple
ExecStart=/home/wwwroot/pan.imcxx.com/cloudreve
Restart=on-failure

[Install]
WantedBy=multi-user.target

相关命令:

systemctl enable cloudreve
systemctl start cloudreve
systemctl stop cloudreve
systemctl disable cloudreve

默认情况下,Cloudreve 会使用内置的 SQLite 数据库,并在同级目录创建数据库文件cloudreve.db,如果您想要使用 MySQL,请在配置文件中加入以下内容,并重启 Cloudreve。

[Database]
; 数据库类型,目前支持 sqlite | mysql
Type = mysql
; 用户名
User = root
; 密码
Password = root
; 数据库地址
Host = 127.0.0.1
; 数据库名称
Name = v3
; 数据表前缀
TablePrefix = cd

配置反代后即可使用域名访问
注意:反代需修改nginx配置允许最大上传限制


FileApps

来源
一个很简单的php
原版需要授权,不过把JS本地化就行了
直接修改index.php配置
演示&下载地址
里面的网盘程序.zip


OneList


OneList,oneindex为onedrive列表网盘,就是将onedrive的内容呈现出来,都是走微软的服务器,网络容易炸
如果是国外VPS且流量够可以使用AmoliCloud进行列表,具体参考上面。

教程来源:Rat's Blog

获取授权

个人及国际版
世纪互联版

登录账号获取浏览器地址栏中的所有字段内容。

http://localhost/onedrive-login?code=xxxxx

获取源码

获取源码

cd /home/wwwroot/drive.imcxx.com
wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/amd64/linux/OneList
chmod +x OneList

配置文件

生成配置文件:

./OneList -a "上面获取的授权url" -s "/"  ##个人及国际版
./OneList -cn -a "上面获取的授权url" -s "/"  ##世纪互联版

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

下载index.html:

wget https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/index.html

上面为默认主题,其他主题有:

HaorWu

作者
https://github.com/HaorWu

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

下载地址

https://raw.githubusercontent.com/MoeClub/OneList/master/Rewrite/%40Theme/HaorWu/index.html

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

后台&开机自启

vi /etc/systemd/system/onelist.service

[Unit]
Description=onelist
After=network.target

[Service]
Type=simple
ExecStart=/home/wwwroot/drive.imcxx.com/OneList -bind 0.0.0.0 -port 5288
Restart=on-failure

[Install]
WantedBy=multi-user.target

执行启动服务:

systemctl enable onelist
systemctl start onelist
systemctl stop onelist
systemctl disable onelist

通过ip:5288即可访问
也可以进行域名反代
如果出现ico无法显示,在index.html加入:


#反代必须使用外链ico,目录ico无法使用


filerun

filerun需要ionCube扩展,lnmp安装方法

cd /root/lnmp1.6
./addons.sh install ionCube

按回车安装

搭建

cd /home/wwwroot/yun.imcxx.com
wget http://f.afian.se/wl/?id=bT57c6CaCpG51RQSscn3trtX70xu2uHc
unzip index.html?id=bT57c6CaCpG51RQSscn3trtX70xu2uHc
rm -rf index.html?id=bT57c6CaCpG51RQSscn3trtX70xu2uHc
chown -R www:www ./*

打开yun.imcxx.com配置程序

安装

备注

  1. filerun汉化不完全
  2. filerun可以挂载onedrive一起使用


NextCloud

搭建

cd /home/wwwroot/pan.imcxx.com
wget https://download.nextcloud.com/server/releases/nextcloud-16.0.0.zip
unzip nextcloud-16.0.0.zip
mv nextcloud/* ./
chown -R www:www ./*
chmod 750 ./*

若安装后出现404,修改网站配置文件
修改include enable-php.conf
改为include enable-php-pathinfo.conf

定时任务

后台选择定时任务类型
定时任务
crontab -e加入:

 */5 * * * * curl http://pan.imcxx.com/cron.php

外部存储

点击右上角头像--应用---已禁用的应用---External storage support--点击启用
若外部存储报:“smbclient” 未安装。”错误
执行:

yum -y update
yum -y install libsmbclient libsmbclient-devel
pecl install smbclient

如果提示ERROR: failed to run phpize',需要启用popen函数,修改php.ini文件,搜索disable_functions,将popen`删除并重启php
安装完成后,在php.ini文件最后面加入

extension="smbclient.so"

重启lnmp即可解决

挂载外部存储的时候将文件共享勾上才能进行共享
nextcloud

最后修改:2023 年 06 月 23 日
如果觉得我的文章对你有用,请随意赞赏