mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2024-04-21 12:31:40 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02d00d9b19 | ||
|
|
25c86357da | ||
|
|
bb49ff1b5f | ||
|
|
f33414c643 | ||
|
|
c1eebc7bf7 | ||
|
|
90a0b34b3e | ||
|
|
60cd53895d | ||
|
|
a97df81a9e | ||
|
|
3fdc327bb0 | ||
|
|
d02899328d | ||
|
|
34767dd9b0 | ||
|
|
85609ddbd8 | ||
|
|
d6aa3ca86f | ||
|
|
9e33129e7d | ||
|
|
8c54632ccd | ||
|
|
dda74f16ce | ||
|
|
69b540708e | ||
|
|
f290658cd0 | ||
|
|
842f7bf052 | ||
|
|
7998513e4e | ||
|
|
dd3552fefd | ||
|
|
f238dc14ca | ||
|
|
865538f437 | ||
|
|
c6fbca185d | ||
|
|
19fb84efa8 | ||
|
|
0be66f7897 | ||
|
|
ebb99e9515 | ||
|
|
6f911908ed | ||
|
|
d163808d45 |
@@ -4,5 +4,5 @@
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
|
||||
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
|
||||
</IfModule>
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
namespace CloudreveInstaller;
|
||||
|
||||
use Composer\Script\Event;
|
||||
|
||||
class Installer{
|
||||
|
||||
public static function startInstall(Event $event){
|
||||
$version = json_decode(file_get_contents("application/version.json"),true)["version"];
|
||||
$ioContext = $event->getIO();
|
||||
$welcomMsg = "
|
||||
___ _ _
|
||||
/ __\ | ___ _ _ __| |_ __ _____ _____
|
||||
/ / | |/ _ \| | | |/ _` | '__/ _ \ \ / / _ \
|
||||
/ /___| | (_) | |_| | (_| | | | __/\ V / __/
|
||||
\____/|_|\___/ \__,_|\__,_|_| \___| \_/ \___|
|
||||
|
||||
Ver $version
|
||||
================================================
|
||||
";
|
||||
$ioContext->write($welcomMsg);
|
||||
$sqlInfo = self::getSqlInformation($event);
|
||||
$ioContext->write("");
|
||||
$siteUrl=$ioContext->ask("The full-url to access to your Cloudreve (e.g. https://pan.aoaoao.me/ , 'http' must be included in the front and '/' must be included at the end):");
|
||||
$ioContext->write("");
|
||||
if(!file_exists('mysql.sql')){
|
||||
$ioContext->writeError("[Error] The file mysql.sql not exist.\nInstaller will exit.To retry, run 'composer install'");
|
||||
exit();
|
||||
}
|
||||
$sqlSource = file_get_contents('mysql.sql');
|
||||
$sqlSource = str_replace("https://cloudreve.org/", $siteUrl, $sqlSource);
|
||||
$mysqli = @new \mysqli($sqlInfo["hostname"], $sqlInfo["username"], $sqlInfo["password"], $sqlInfo["database"], $sqlInfo["hostport"]);
|
||||
$ioContext->write("=======================");
|
||||
$ioContext->write("Starting import sql file...");
|
||||
if ($mysqli->multi_query($sqlSource)) {
|
||||
$ioContext->write("Writing complete.");
|
||||
$ioContext->write("Writing database.php...");
|
||||
if(file_exists('application/database.php')){
|
||||
$ioContext->writeError("[Error] The file database.php already exist.\nInstaller will exit.To retry, run 'composer install'");
|
||||
$ioContext->write("=======================");
|
||||
exit();
|
||||
}
|
||||
self::writrConfig($event,$sqlInfo);
|
||||
$ioContext->write("=======================");
|
||||
}else{
|
||||
$ioContext->writeError("[Error] Writing failed.Installer will exit. To retry, run 'composer install'");
|
||||
$ioContext->write("=======================");
|
||||
}
|
||||
$ioContext->write("");
|
||||
$ioContext->write("Congratulations! Cloudreve has been installed successfully.");
|
||||
$ioContext->write("");
|
||||
$ioContext->write("Here's some informatioin about yor Cloudreve:");
|
||||
$ioContext->write("Homepage: $siteUrl");
|
||||
$ioContext->write("Admin Panel: ".$siteUrl."Admin");
|
||||
$ioContext->write("Default username: admin@cloudreve.org");
|
||||
$ioContext->write("Default password: admin");
|
||||
$ioContext->write("");
|
||||
$ioContext->write("=======================");
|
||||
$ioContext->write("IMPORTANT! You may still have to configure the URL Rewrite to set everthing to work.");
|
||||
$ioContext->write("Refer to the install manual for more informatioin.");
|
||||
$ioContext->write("=======================");
|
||||
}
|
||||
|
||||
public static function writrConfig(Event $event,$sqlInfo){
|
||||
$ioContext = $event->getIO();
|
||||
try {
|
||||
$fileContent = file_get_contents("CloudreveInstaller/database_sample.php");
|
||||
$replacement = array(
|
||||
'{hostname}' => $sqlInfo["hostname"],
|
||||
'{database}' => $sqlInfo["database"],
|
||||
'{username}' => $sqlInfo["username"],
|
||||
'{password}' => $sqlInfo["password"],
|
||||
'{hostport}' => $sqlInfo["hostport"],
|
||||
);
|
||||
$fileContent = strtr($fileContent,$replacement);
|
||||
file_put_contents('application/database.php',$fileContent);
|
||||
}catch (Exception $e) {
|
||||
$ioContext->writeError("[Error] Writing failed.Installer will exit. To retry, run 'composer install'");
|
||||
}
|
||||
$ioContext->write("Writing complete.");
|
||||
}
|
||||
|
||||
public static function getSqlInformation(Event $event){
|
||||
$ioContext = $event->getIO();
|
||||
$hostname=$ioContext->ask("Input the hostname of your MySQL server (Default:127.0.0.1):","127.0.0.1");
|
||||
$database=$ioContext->ask("The database name:","127.0.0.1");
|
||||
$username=$ioContext->ask("The username of your MySQL server (Default:root):","root");
|
||||
$password=$ioContext->askAndHideAnswer("The password of your MySQL server:");
|
||||
$hostport=$ioContext->ask("The hostport of your MySQL server (Default:3306):","3306");
|
||||
$mysqli = @new \mysqli($hostname, $username, $password, $database, $hostport);
|
||||
if ($mysqli->connect_error) {
|
||||
$ioContext->writeError("[Error] Cannot connect to MySQL server, Message:".$mysqli->connect_error);
|
||||
$ioContext->write("");
|
||||
$ioContext->write("Please confirm your connection informatioin:");
|
||||
@$mysqli->close();
|
||||
return self::getSqlInformation($event);
|
||||
}
|
||||
return [
|
||||
"hostname" => $hostname,
|
||||
"database" => $database,
|
||||
"username" => $username,
|
||||
"password" => $password,
|
||||
"hostport" => $hostport,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -13,15 +13,15 @@ return [
|
||||
// 数据库类型
|
||||
'type' => 'mysql',
|
||||
// 服务器地址
|
||||
'hostname' => '127.0.0.1',
|
||||
'hostname' => '{hostname}',
|
||||
// 数据库名
|
||||
'database' => 'lite',
|
||||
'database' => '{database}',
|
||||
// 用户名
|
||||
'username' => 'root',
|
||||
'username' => '{username}',
|
||||
// 密码
|
||||
'password' => 'root',
|
||||
'password' => '{password}',
|
||||
// 端口
|
||||
'hostport' => '3306',
|
||||
'hostport' => '{hostport}',
|
||||
// 连接dsn
|
||||
'dsn' => '',
|
||||
// 数据库连接参数
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
Cloudreve - Make the cloud easy for everyone
|
||||
=========================
|
||||
[](https://packagist.org/packages/hfo4/cloudreve)
|
||||
[](https://packagist.org/packages/hfo4/cloudreve)
|
||||
[](https://packagist.org/packages/hfo4/cloudreve)
|
||||
[](https://packagist.org/packages/hfo4/cloudreve)
|
||||
|
||||
基于ThinkPHP构建的网盘系统,能够助您以较低成本快速搭建起公私兼备的网盘。
|
||||
|
||||

|
||||

|
||||
|
||||
目前已经实现的特性:
|
||||
|
||||
* 快速对接多家云存储,支持七牛、又拍云、阿里云OSS、AWS S3,当然,还有本地存储
|
||||
* 可限制单文件最大大小、MMMEType、文件后缀、用户可用容量
|
||||
* 可限制单文件最大大小、MIMEType、文件后缀、用户可用容量
|
||||
* 图片、音频、视频、文本、Markdown、Ofiice文档 在线预览
|
||||
* 移动端全站响应式布局
|
||||
* 文件、目录分享系统,可创建私有分享或公开分享链接
|
||||
@@ -27,14 +27,74 @@ Cloudreve - Make the cloud easy for everyone
|
||||
|
||||
安装需求
|
||||
------------
|
||||
* LNMP/LAMP With PHP5.6+
|
||||
* LNMP/AMP With PHP5.6+
|
||||
* curl、fileinfo、gd扩展
|
||||
* Composer
|
||||
|
||||
简要安装说明
|
||||
------------
|
||||
|
||||
Coming Soon...
|
||||
#### 1.使用Composer安装主程序
|
||||
```
|
||||
#安装开发版
|
||||
$ composer create-project hfo4/cloudreve:dev-master
|
||||
```
|
||||
|
||||
```
|
||||
#等待安装依赖库后,会自动执行安装脚本,按照提示输入数据库账户信息
|
||||
___ _ _
|
||||
/ __\ | ___ _ _ __| |_ __ _____ _____
|
||||
/ / | |/ _ \| | | |/ _` | '__/ _ \ \ / / _ \
|
||||
/ /___| | (_) | |_| | (_| | | | __/\ V / __/
|
||||
\____/|_|\___/ \__,_|\__,_|_| \___| \_/ \___|
|
||||
|
||||
Ver XX
|
||||
================================================
|
||||
#按提示输入信息
|
||||
......
|
||||
```
|
||||
|
||||
```
|
||||
#出现如下提示表示安装完成
|
||||
Congratulations! Cloudreve has been installed successfully.
|
||||
|
||||
Here's some informatioin about yor Cloudreve:
|
||||
Homepage: https://pan.aoaoao.me/
|
||||
Admin Panel: https://pan.aoaoao.me/Admin
|
||||
Default username: admin@cloudreve.org
|
||||
Default password: admin
|
||||
```
|
||||
|
||||
#### 2.目录权限
|
||||
`runtime`目录需要写入权限,如果你使用本地存储,`public` 目录也需要有写入权限
|
||||
|
||||
#### 3.URL重写
|
||||
对于Apache服务器,项目目录下的`.htaccess`已经配置好重写规则,如有需求酌情修改.
|
||||
对于Nginx服务器,以下是一个可供参考的配置:
|
||||
```
|
||||
location / {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /index.php?s=/$1 last;
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### 4.完成
|
||||
后台地址:`http://您的域名/Admin` 初始用户名:`admin@cloudreve.org` 初始密码:`admin`
|
||||
#### 后续操作
|
||||
以下操作不是必须的,但仍推荐你完成这些操作:
|
||||
* 修改初始账户密码
|
||||
* 到 设置-基础设置 中更改站点URL,如果不更改,程序无法正常接受回调请求
|
||||
* 添加Crontab定时任务 :你的域名/Cron
|
||||
* 如果你打算使用本地上传策略并且不准备开启外链功能,请将·public/uploads·目录设置为禁止外部访问
|
||||
* 如需启用二步验证功能,请依次执行`composer require phpgangsta/googleauthenticator:dev-master` `composer require endroid/qrcode`安装二步验证支持库
|
||||
* 给本项目一个Star~
|
||||
|
||||
文档
|
||||
------------
|
||||
* [完整安装说明](https://github.com/HFO4/Cloudreve/wiki/%E5%AE%89%E8%A3%85%E8%AF%B4%E6%98%8E)
|
||||
* [安装及初次使用FAQ](https://github.com/HFO4/Cloudreve/wiki/%E5%AE%89%E8%A3%85%E5%8F%8A%E5%88%9D%E6%AC%A1%E4%BD%BF%E7%94%A8FAQ)
|
||||
|
||||
许可证
|
||||
------------
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
database.php
|
||||
@@ -39,7 +39,7 @@ class Member extends Controller{
|
||||
}
|
||||
|
||||
public function ForgetPwd(){
|
||||
if(input('?post.regEmail') && input('?post.captchaCode') && !empty(input('post.captchaCode')) && !empty(input('post.regEmail'))){
|
||||
if(input('?post.regEmail') && !empty(input('post.regEmail'))){
|
||||
$findAction = User::findPwd(input('post.regEmail'),input('post.captchaCode'));
|
||||
if ($findAction[0]){
|
||||
return json(['code' => '200','message' => $findAction[1]]);
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
</div>
|
||||
<div class="row form-setting">
|
||||
<div class="col-md-1 form-label ">
|
||||
<label for="colFormLabelSm" class="col-form-label col-form-label-sm">站点关键词</label>
|
||||
<label for="colFormLabelSm" class="col-form-label col-form-label-sm">站点描述</label>
|
||||
</div>
|
||||
<div class="col-md-4"> <input type="text" class="form-control" name="siteDes" value="{$options.siteDes}"></div>
|
||||
<div class="col-md-4 option-des"> 位于首页meta标签内的站点描述</div>
|
||||
|
||||
@@ -1,34 +1,22 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-ng-app="FileManagerApp">
|
||||
<html lang="zh_cn" data-ng-app="FileManagerApp">
|
||||
<head>
|
||||
<!--
|
||||
* Angular FileManager v1.5.1 (https://github.com/joni2back/angular-filemanager)
|
||||
* Jonas Sciangula Street <joni2back@gmail.com>
|
||||
* Licensed under MIT (https://github.com/joni2back/angular-filemanager/blob/master/LICENSE)
|
||||
-->
|
||||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
|
||||
<meta charset="utf-8">
|
||||
<title>我的文件 - {$options.siteName}</title>
|
||||
<!-- third party -->
|
||||
<script src="/static/js/angular.min.js"></script>
|
||||
<script src="/static/js/angular-translate.min.js"></script>
|
||||
|
||||
<script src="/static/js/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="/static/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="/static/css/material.css" />
|
||||
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" href="/static/css/font-awesome.min.css">
|
||||
<!-- /third party -->
|
||||
<!-- Comment if you need to use raw source code -->
|
||||
<link href="/static/css/angular-filemanager.min.css" rel="stylesheet">
|
||||
<link href="/static/css/toastr.min.css" rel="stylesheet">
|
||||
<script type="text/javascript" src="/static/js/toastr.min.js"></script>
|
||||
<script src="/static/js/angular-filemanager.min.js"></script>
|
||||
<link rel="stylesheet" href="/static/css/photoswipe.css">
|
||||
<link rel="stylesheet" href="/static/css/default-skin/default-skin.css">
|
||||
|
||||
<!-- /Comment if you need to use raw source code -->
|
||||
<script type="text/javascript">
|
||||
uploadConfig={
|
||||
saveType : "{$policyData.policy_type}",
|
||||
@@ -106,4 +94,4 @@ upload_load=0;
|
||||
|
||||
</script>
|
||||
{$options.js_code}
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!doctype html>
|
||||
<html lang="en" data-ng-app="FileManagerApp">
|
||||
<html lang="zh_cn" data-ng-app="FileManagerApp">
|
||||
<head>
|
||||
<!--
|
||||
* Angular FileManager v1.5.1 (https://github.com/joni2back/angular-filemanager)
|
||||
@@ -80,4 +80,4 @@ upload_load=0;
|
||||
|
||||
</script>
|
||||
{$options.js_code}
|
||||
</html>
|
||||
</html>
|
||||
|
||||
+31
-19
@@ -6,33 +6,45 @@
|
||||
"type": "project",
|
||||
"license": "GPL-3.0-only",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aaron",
|
||||
"email": "abslant@foxmail.com",
|
||||
"homepage": "https://aoaoao.me",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Qnner",
|
||||
"email": "admin@qnner.com",
|
||||
"homepage": "http://me.qnner.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "dune",
|
||||
"email": "rainaysann@gmail.com",
|
||||
"homepage": "https://github.com/rainays",
|
||||
"role": "Developer"
|
||||
}
|
||||
{
|
||||
"name": "Aaron",
|
||||
"email": "abslant@foxmail.com",
|
||||
"homepage": "https://aoaoao.me",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Qnner",
|
||||
"email": "admin@qnner.com",
|
||||
"homepage": "http://me.qnner.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "dune",
|
||||
"email": "rainaysann@gmail.com",
|
||||
"homepage": "https://github.com/rainays",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"ext-curl":"*",
|
||||
"ext-fileinfo":"*",
|
||||
"ext-gd":"*",
|
||||
"topthink/think-captcha":"1.*",
|
||||
"endroid/qrcode": "1.*",
|
||||
"aliyuncs/oss-sdk-php": "~2.0",
|
||||
"sabre/dav":"~3.2.0",
|
||||
"upyun/sdk": "^3.3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"CloudreveInstaller\\Installer" : ""
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"CloudreveInstaller\\Installer::startInstall"
|
||||
],
|
||||
"post-create-project-cmd" : [
|
||||
"CloudreveInstaller\\Installer::startInstall"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!.gitignore
|
||||
!chunks
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
Reference in New Issue
Block a user