Compare commits

...
29 Commits
Author SHA1 Message Date
HFO4 02d00d9b19 更新安装说明 2018-02-05 13:27:51 +08:00
HFO4 25c86357da 权限设置 2018-02-05 12:23:31 +08:00
HFO4 bb49ff1b5f 拼写错误 2018-02-05 12:15:44 +08:00
HFO4 f33414c643 补全目录 2018-02-05 11:10:13 +08:00
HFO4 c1eebc7bf7 更新安装说明 2018-02-05 11:02:24 +08:00
HFO4 90a0b34b3e 安装程序执行发起 2018-02-05 10:52:09 +08:00
HFO4 60cd53895d 安装引导脚本 2018-02-05 10:48:11 +08:00
HFO4 a97df81a9e Merge branch 'master' of https://github.com/HFO4/Cloudreve 2018-02-05 08:41:37 +08:00
HFO4 3fdc327bb0 ready for merge 2018-02-05 08:41:30 +08:00
AaronLiuandGitHub d02899328d Update .htaccess 2018-02-05 07:33:04 +08:00
AaronLiuandGitHub 34767dd9b0 Merge pull request #4 from yrccondor/master
Change lang="en" to lang="zh_cn"
2018-02-04 20:16:12 +08:00
AxtonYaoandGitHub 85609ddbd8 fix 2018-02-04 20:12:10 +08:00
AxtonYaoandGitHub d6aa3ca86f Change lang="en" to lang="zh_cn" 2018-02-04 20:05:52 +08:00
AxtonYaoandGitHub 9e33129e7d Change lang="en" to lang="zh_cn" 2018-02-04 20:04:41 +08:00
HFO4 8c54632ccd Merge branch 'master' of https://github.com/HFO4/Cloudreve 2018-02-04 19:25:27 +08:00
HFO4 dda74f16ce Fix #2 2018-02-04 19:23:40 +08:00
AaronLiuandGitHub 69b540708e Update README.md 2018-02-04 18:29:59 +08:00
HFO4 f290658cd0 删除注释 2018-02-04 17:51:27 +08:00
HFO4 842f7bf052 修复找回密码表单判断 2018-02-04 17:45:53 +08:00
AaronLiuandGitHub 7998513e4e Update README.md 2018-02-04 17:22:05 +08:00
AaronLiuandGitHub dd3552fefd Update README.md 2018-02-04 17:20:58 +08:00
AaronLiuandGitHub f238dc14ca Delete database.php 2018-02-04 16:15:50 +08:00
AaronLiuandGitHub 865538f437 Update README.md 2018-02-04 16:09:34 +08:00
AaronLiuandGitHub c6fbca185d Update README.md 2018-02-04 15:53:23 +08:00
AaronLiuandGitHub 19fb84efa8 Update README.md 2018-02-04 15:44:11 +08:00
AaronLiuandGitHub 0be66f7897 Update README.md 2018-02-04 15:43:47 +08:00
AaronLiuandGitHub ebb99e9515 Update README.md 2018-02-04 15:33:12 +08:00
AaronLiuandGitHub 6f911908ed Update README.md 2018-02-04 15:32:37 +08:00
AaronLiuandGitHub d163808d45 更新Readme 2018-02-04 15:25:11 +08:00
12 changed files with 222 additions and 49 deletions
+1 -1
View File
@@ -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>
+109
View File
@@ -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' => '',
// 数据库连接参数
+65 -5
View File
@@ -2,18 +2,18 @@
Cloudreve - Make the cloud easy for everyone
=========================
[![Latest Stable Version](https://poser.pugx.org/hfo4/cloudreve/v/stable)](https://packagist.org/packages/hfo4/cloudreve)
[![Packagist](https://img.shields.io/packagist/v/HFO4/Cloudreve.svg)](https://packagist.org/packages/hfo4/cloudreve)
[![Latest Unstable Version](https://poser.pugx.org/hfo4/cloudreve/v/unstable)](https://packagist.org/packages/hfo4/cloudreve)
[![License](https://poser.pugx.org/hfo4/cloudreve/license)](https://packagist.org/packages/hfo4/cloudreve)
基于ThinkPHP构建的网盘系统,能够助您以较低成本快速搭建起公私兼备的网盘。
![TIM截图20180204124101.png](https://download.aoaoao.me/TIM截图20180204124101.png)
![homepage.png](https://download.aoaoao.me/homepage.png)
目前已经实现的特性:
* 快速对接多家云存储,支持七牛、又拍云、阿里云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)
许可证
------------
+1
View File
@@ -0,0 +1 @@
database.php
+1 -1
View File
@@ -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>
+2 -14
View File
@@ -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>
+2 -2
View File
@@ -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
View File
@@ -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"
]
}
}
+2 -1
View File
@@ -1,2 +1,3 @@
*
!.gitignore
!.gitignore
!chunks
+2
View File
@@ -0,0 +1,2 @@
*
!.gitignore