Skip to content

Commit

Permalink
docs: update the docs for v1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
saltbo committed Jul 12, 2021
1 parent 6c99da5 commit 39bfc24
Show file tree
Hide file tree
Showing 24 changed files with 498 additions and 432 deletions.
53 changes: 28 additions & 25 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,51 @@
### Welcome
!> The project has just started, and the documentation is not complete, please help with PR
### 欢迎
!> 项目刚开始,文档尚不完善,欢迎帮忙PR

### Introduction
ZPan is committed to creating an unlimited speed network disk system, so we use the client to connect directly to cloud storage for design.
### 介绍
ZPan致力于打造一款不限速的网盘系统,因此我们采用客户端直连云存储的方式进行设计。

Currently ZPan supports all cloud storage platforms compatible with the S3 protocol. You can choose a platform you are familiar with to drive ZPan.
目前ZPan支持所有兼容S3协议的云存储平台,您可以选用您熟悉的平台来驱动ZPan。

[Online Live](http://zpan.saltbo.cn)(username:demo,password:demo)
[在线体验](http://zpan.saltbo.cn)(体验账号:demo,密码:demo)

### How It Works
### 他是如何工作的?

ZPan is essentially a URL signature server + a visual file browser.
ZPan本质上是一个URL签名服务器+可视化的文件浏览器。

Because we use a direct-link method for uploading and downloading, in order to ensure the security of uploading and downloading, all URLs used by the client to upload and download must be signed by the server.
因为我们采用直链的方式进行上传下载,所以为了保证上传下载的安全性,客户端用来上传下载的URL均需要服务端进行签名。

Then, in order to conveniently manage the files uploaded by users, we need to develop a visual pseudo file system for file management.
然后为了能给方便的管理用户上传的文件,我们就需要开发一个可视化的伪文件系统来进行文件管理。

- [saltbo/zpan](https://github.com/saltbo/zpan)
- [saltbo/zpan-front](https://github.com/saltbo/zpan-front)

### Features
- Not limited by server bandwidth
- Support all cloud storage compatible with S3 protocol
- Support file and folder management
- Support file and folder sharing (accessible without logging in)
- Support document preview and audio and video playback
- Support multi-user storage space control
- Support multiple languages
### 特色
- 完全不受服务器带宽限制
- 支持所有兼容S3协议的云存储
- 支持文件及文件夹管理
- 支持文件及文件夹分享(未登录可访问)
- 支持文档预览及音视频播放
- 支持多用户存储空间控制
- 支持多语言

### Why Not ...?
### 为什么不是...

#### NextCloud
NextCloud is a very easy to use network disk system. It can be said to be the predecessor in this field. But because it was born relatively early, it was designed base on the local file system. The speed of file transfer is limited by the speed of local network. This means that if you use NextCloud to build a network disk on a server with a bandwidth of one megabyte, the upper bound of the upload and download speed of the network disk is only one megabyte. If you want to increase the speed, you can only upgrade the bandwidth of the server, which is a big cost.
NextCloud是非常好用的网盘系统,可以说是这个领域的前辈了。但是由于它诞生的比较早,在设计上它是基于本地文件系统进行存储的。这就意味着如果您使用NextCloud在一台一兆带宽的服务器上搭建一个网盘,那么网盘的上传下载速度上限就只有一兆,如果您想提升速度就只能给服务器升级带宽,这将是很大的成本。

当然,有人可能会说NextCloud也可以用云存储啊。但其实它是通过将云存储挂载成本地磁盘的方式进行使用的,还是无法解决上传下载速度受限于服务器带宽的问题。

#### Cloudreve

Cloudreve is the only product I found before developing ZPan that meets my needs (uploads and downloads are not limited by bandwidth). However, Cloudreve was developed based on PHP at the time, and I was a bit disgusted about that it was troublesome to deploy, so I wanted to implement one by myself in Golang. However, due to some reasons, it was put on hold for more than a year. When I restarted ZPan and it was almost finished, I realized that Cloudreve also used Golang for refactoring during this year.
Cloudreve是我在研发ZPan之前找到的唯一满足我需求(上传下载不受带宽限制)的产品。但是当时Cloudreve是基于PHP开发的,我有点嫌弃它部署起来比较麻烦,所以就想着用Golang自己实现一个。但是由于一些原因,中途搁置了一年多,当我重新开始搞ZPan且已经差不多搞完的时候才发现在这一年中Cloudreve也使用Golang进行重构了。

It is undeniable that Cloudreve has more functions than ZPan does. ZPan will be more restrained in features, as I always believe that more features are not always better. So, if you find that ZPan does not meet your needs, you can also try Cloudreve.
不可否认Cloudreve在功能上是比ZPan更加多的,ZPan在功能上会比较克制,因为我始终认为功能不是越多越好。所以如果您发现ZPan不满足您的需求,也可以去试试Cloudreve。

#### EyeblueTank
#### 蓝眼云盘

Blue Eye Cloud Disk was also found when I was looking for online storage products in the early days. Generally speaking, it fits my vision and is simple and easy to use. Unfortunately, it also belongs to the traditional network disk. I have communicated with his developers, and they have no plans to support cloud storage.
蓝眼云盘也是我早期在找网盘产品的时候找到的,总体来说他符合我的设想,简单好用。但很遗憾,他也属于传统网盘,我和他的开发者有过交流,他们并没有打算支持云存储。

#### Z-File

Z-File is an online file catalog program that supports various object storage and local storage. Its target is to be a commonly used tools by individuals for downloading, or a public file library. It will not be developed in the direction of multiple accounts.
Z-File是一个在线文件目录的程序, 支持各种对象存储和本地存储, 使用定位是个人放常用工具下载, 或做公共的文件库. 不会向多账户方向开发.

4 changes: 2 additions & 2 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* [English](/)
* [中文](/zh-cn/)
* [中文](/)
* [English](/en/)
14 changes: 7 additions & 7 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
* [Introduction](/)
* [Getting Started](/getting-started.md)
* [Config](/config.md)
* [Cloud Storage](/cloud-platform.md)
* [Contributing](/contributing.md)
* [Vernacular](/vernacular.md)
* [FAQ](/faq.md)
* [介绍](/)
* [快速开始](/getting-started.md)
* [配置文件](/config.md)
* [云存储](/cloud-platform.md)
* [贡献代码](/contributing.md)
* [白话文教程](/vernacular.md)
* [常见问题](/faq.md)
105 changes: 67 additions & 38 deletions docs/cloud-platform.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,75 @@
> Here we provide different endpoint samples for each major platform, you need to change `my-zpan-bucket` to your own bucket name
## S3协议平台

## Endpoint
- 阿里云OSS
- 腾讯云COS
- 七牛云Kodo
- UCloud(需手动自动设置CORS)
- 华为云OBS
- 网易云NOS(需手动自动设置CORS)
- 亚马逊S3
- MinIO

- AmazonS3:`s3.ap-northeast-1.amazonaws.com`
- TencentCOS:`cos.ap-shanghai.myqcloud.com`
- AliyunOSS:`oss-cn-zhangjiakou.aliyuncs.com`
- QiniuKodo:`s3-cn-east-1.qiniucs.com`
- GoogleStorage:`storage.googleapis.com`
> 路径:管理后台-存储管理-创建存储
## CORS
### 基础配置

<img src="https://static.saltbo.cn/images/image-20210712165603221.png" alt="image-20210712165603221" style="zoom:50%;" />

1. 网盘和外链盘的区别是:外链盘可以直接拿到永久外链,同时它没有分享和回收站的功能
2. 名称是在zpan中该存储的名字,同时也是路由地址,所以只支持英文
3. 云平台的数据来源于 https://github.com/eplist/eplist ,欢迎PR
4. 接入点的数据同样源于eplist,选择一个云平台后会自动给出该平台的所有Endpoint

### 高级配置

![image-20210712170751044](https://static.saltbo.cn/images/image-20210712170751044.png)

1. 高级配置默认都可为空
2. 标题可以是中文,用于在页面顶部的导航栏显示
3. 自有域名即用来访问/下载资源的域名
4. 存储根路径指的是在云存储里的存储路径,默认是根目录,指定一个前缀,可以实现共用一个bucket的场景
5. 文件存储路径指的是上传的文件在云存储里的存储路径,默认是$NOW_DATE/$RAND_16KEY.$RAW_EXT
6. 可以看到我们支持一些系统变量,通过这些变量你可以设置自己的路径规则

### CORS配置

- Origin: http://your-domain
- AllowMethods: PUT
- AllowHeaders: content-type,content-disposition,x-amz-acl

### S3
The permissions of s3 are more complicated, and I have not conducted detailed tests. At present, I directly turn off the option of `Block public access to buckets and objects granted through new access control lists (ACLs)`; then configure the following CORS Just fill in and save.
```json
[
{
"AllowedOrigins": [
"http://your-domain"
],
"AllowedMethods": [
"PUT"
],
"AllowedHeaders": [
"content-type",
"content-disposition",
"x-amz-acl"
],
"ExposeHeaders": []
}
]
```

### Storage
Since Google Cloud Storage does not provide a visual configuration interface, only a command line tool, so we can use CloudShell to operate, the specific commands are as follows:
```bash
echo '[{"origin":["*"],"method":["PUT"],"responseHeader":["content-type","content-disposition","x-amz-acl"]}]' > cors.json
gsutil cors set cors.json gs://your-bucket-name
```

### Others
OSS, COS, Kodo and other visualizations are all very good, so don’t talk nonsense, if you really don’t know how to do it, you can watch [Vernacular](/vernacular)


## MinIO

基于MinIO可以快速搭建自己的私有云。

需要注意的是,我们仅支持Virtual Hosted-Style模式的S3协议,所以在MinIO搭建时需要注意开启Virtual Hosted-Style。

启用的方式很简单,即设置环境变量MINIO_DOMAIN=endpoint.example.com

当您创建一个bucket名叫zpan时,它的完整域名是zpan.endpoint.example.com

但是,注意,**zpan中需要您填写的接入点是不包含bucket的,所以您应该填写endpoint.example.com**



#### 参考文档:

- https://docs.min.io/docs/minio-server-configuration-guide.html
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAPI.html





## 又拍云

!> 又拍云不兼容s3协议,所以和其他平台有一些区别,需要特别注意

1. Endpoint填写又拍云默认分配的加速域名(仅供测试那个)
2. AccessKey为操作员名称,AccessSecret为操作员密码
3. **如果是网盘类型,需要将Token防盗链的秘钥设置为操作员的密码**

![image-20210712172027775](https://static.saltbo.cn/images/image-20210712172027775.png)![image-20210712172346760](https://static.saltbo.cn/images/image-20210712172346760.png)

![image-20210712172707803](https://static.saltbo.cn/images/image-20210712172707803.png)
122 changes: 10 additions & 112 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -1,134 +1,32 @@
# debug
Whether to output the debug log, the default is false
# 配置文件

# invitation
Whether invitation registration is enabled, after enabling, only invitation registration is allowed, and it is disabled by default
从v1.5.0版本开始,我们启用了可视化的安装流程,初次安装完成后会生成config.yml的配置文件。如果您需要修改端口或者数据库配置,可以打开该文件进行编辑修改。

# storage
The initial space allocated to each user, default 50 megabytes, unit: byte
## port
Http端口,默认为8222

# server
Configure the server
```yaml
server:
port: 8222
sslport: 443
domain:
- example1.com
- example2.com
```

### port
Http port

### sslport
Https port, only support 443 at the moment

### domain
Domain list of the server

# tls
Configure the tls
```yaml
tls:
enabled: true
auto: true
cacheDir: /opt/
certPath: "/etc/domain/cert.pem"
certkeyPath: "/etc/domain/cert.key"
```

### enable
Whether to enable https

### auto
Whether to auto https using let's encrypt

### cacheDir
Let's encrypt cert cache dir, need write permission

### certPath
Manually set cert

### certkeyPath
Manually set certkey

# database
The database driver of ZPan is defined here
## database
这里定义了ZPan的数据库驱动
```yaml
database:
driver: sqlite3
dsn: zpan.db
```

### driver
We support four database drivers, you can choose according to your needs
### driver
我们支持四种数据库驱动,您可以根据需求进行选择

- sqlite3
- mysql
- postgres
- mssql

### dsn
The dsn corresponding to different drivers is also different, here we give the dsn format of each driver separately
不用的驱动对应的dsn也是不一样的,这里我们分别给出每种驱动的dsn格式

| driver | dsn |
| ---- | ---- |
| sqlite3 | zpan.db |
| mysql | user:pass@tcp(127.0.0.1:3306)/zpan?charset=utf8mb4&parseTime=True&loc=Local |
| postgres | user=zpan password=zpan dbname=zpan port=9920 sslmode=disable TimeZone=Asia/Shanghai |
| mssql | sqlserver://zpan:LoremIpsum86@localhost:9930?database=zpan |

# provider
Currently we support all S3-based cloud storage platforms, such as Alibaba Cloud OSS, Tencent Cloud COS, Qiniu Cloud KODO.
```yaml
provider:
name: s3
bucket: saltbo-zpan-test
endpoint: https://oss-cn-zhangjiakou.aliyuncs.com
accessKey: LTAIxxxxxxxxxxxxxxx7YoV
accessSecret: PFGVwxxxxxxxxxxxxxxxxRd09u
```

### name
The name of the cloud storage you use, the options are as follows
- s3(default)
- od(Not currently supported)
- gd(Not currently supported)

### bucket
The name of the storage space you created

### endpoint
Access point for cloud storage

### customHost
Custom domain name bound to cloud storage

### accessKey
Access key requested from cloud storage

### accessSecret
Access secret requested from cloud storage

# email
Configure the email address to open the account registration email verification
```yaml
email:
host: smtpdm.aliyun.com:25
sender: [email protected]
username: Zpan
password: mGxxxxxxxxxxh9
```

### host
Mailing service address,eg:: smtpdm.aliyun.com:25

### sender:
Mailing address,eg:no-reply@saltbo.fun

### username
Sender,eg:Zpan

### password
Sending password
| mssql | sqlserver://zpan:LoremIpsum86@localhost:9930?database=zpan |

0 comments on commit 39bfc24

Please sign in to comment.