Skip to content

zbx1425/tinyCloudDrive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tiny Cloud Drive

Tiny File Manager 魔改而来的 较为 轻量化的PHP多用户注册制云存储平台套件

A lightweight multi-user registerable PHP cloud storage website kit based on Tiny File Manager

Preview Image

Preview Image

使用指南 Getting Started

该套件可被快速部署在支持php的服务器上。

项目使用条件 Prerequisites

可在PHP7上运行。PHP5可能可行但尚未测试。

您的php进程必须拥有对安装文件夹的读、写、执行权限。

必须您先前安装的PHP扩展有:

  • json
  • openssl
  • session

建议您安装的扩展有:

  • ctype
  • fileinfo
  • iconv
  • mbstring

安装 Installation

直接将 index.php account.php translation.json account.json 放置在您的服务器即可。请勿重命名上述文件。

Install the kit by placing index.php account.php translation.json account.json to your web server at where you would like. Do not rename these scripts.

要进行配置,您可在index.php account.php中查找 CONFIG_THIS 字样,并编辑相应内容。

To config the kit, look for CONFIG_THIS in index.php and account.php, and edit the relative contents.

编辑 index.php$CONFIG即可配置语言、错误显示、隐藏文件显示等TinyFileManager功能。由于懒惰,account.php系根据行号查找配置信息,请将该配置变量留在第3行。

To Use English Interface, edit $CONFIG in index.php by changing "lang":"zh-CN" to "lang":"en". Please remain this variable at line 3 and do not move it elsewhere.

如果您需要通过SMTP发送Email进行用户验证,请自行下载安装 PHPMailer 库,并相应调整 account.php 第4~23行:

If you need to send emails by SMTP for user registration, please download and install PHPMailer, then adjust line 4 ~23 of account.php:

/*   4 */ $enableEmail = true; //CONFIG_THIS
/* ... */ // 配置您的账号,主题,内容等
/*  23 */ require_once "/PATH/TO/PHPMailer/Installation"; //CONFIG_THIS 引入PHPMailer

如果您使用邮件发送服务发送Email,请依照您所使用服务商所提供的文档完成配置,并替换77-108行的代码。

If you are using sendmail services instead of SMTP, please config according to the documentation of your service provider, and replace line 77~108 accordingly.

如需使用Email验证,请立刻修改account.php中第4行的$encryptMagic数组!请使用三个及以上随意数值替换默认数值,否则不怀好意者可伪造报文越过Email校验!

If you intend to use email validation, please REPLACE THE $encryptMagic ARRAY IN account.php AT LINE 4 IMMEDIATELY! Please use three or more random number to replace the default ones, otherwise some badass would be able to fake a link and bypass the validation!

为尽可能使配置轻量化,本套件不使用数据库,用户数据直接存储于account.json中。如需使用数据库,请根据您使用的数据库软件修改account.phpreadUsers()writeUsers($raw)函数。

Tiny File Manager的$auth_users $directories_users已由本套件自动配置,不能人工修改。

使用示例 Usage example

访问您的服务器上该套件的安装路径,您应该能够看到本套件主页。

Preview Image

注册并验证Email后即可登录使用云盘。每个用户的存储空间均相互独立,互不干扰。有关内置文件管理器的详细使用方式,详见 Tiny File Manager文档

部署方法

为避免上传CGI脚本造成的任意代码执行,您应当配置服务器以关闭本套件安装目录之子目录的CGI脚本执行,及避免配置文件被直接读取。

配置内容(以nginx之.conf为例,在server一节增加以下内容):

location ~ ^\..*/.*\.php$ {
    deny all;
}
location ~ ^/[PATH_TO_INSTALLATION]/.+\.json$ {
    deny all;
}
location ~ ^/[PATH_TO_INSTALLATION]/.+/.+\.php$ {

}

[PATH_TO_INSTALLATION]index.php 所在目录)

版本历史

  • 0.1.0
    • 最初版本

关于作者

授权协议

按基础项目Tiny File Manager要求,本项目由GPLv3授权。 请参照 LICENSE 了解更多细节。