Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add README.ENG.md #18

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions README.ENG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
description: At present, the document is still being improved!
---

# welcome

## What is Cloudreve?

Cloudreve allows you to quickly build a public and private network disk system. Cloudreve supports different cloud storage platforms at the bottom layer, and users do not need to care about the physical storage method in actual use. You can use Cloudreve to build a personal network disk, a file sharing system, or a public cloud system for large and small groups.

## feedback

If you find any defects during use, or have new requirements proposals, please check the previous documents, [issue](https://github.com/cloudreve/Cloudreve/issues), [discussion community]( https://forum.cloudreve.org/) mentioned.

If you suspect a bug or a feature proposal, please create an [issue](https://github.com/cloudreve/Cloudreve/issues) to track the problem;

If you have questions about daily use, please go to [Discussion Community](https://forum.cloudreve.org/) to create a new topic and describe the problem you encounter in detail.

## connect

You can join the following groups to communicate with other users who are using Cloudreve:

* [Telegram group](https://t.me/cloudreve\_official)
* [QQ group](https://qm.qq.com/cgi-bin/qm/qr?k=pjwJ2pi\_V4LN\_JdPZk\_HMwJv\_x8zuCPX\&jump\_from=webapi)

Or contact the developer:

 Email: [[email protected]](mailto:[email protected])
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
description: 目前文档仍在陆续完善中!
---

![ENGLISH version](README.ENG.md)

# 欢迎

## Cloudreve 是什么?
Expand Down
31 changes: 31 additions & 0 deletions SUMMARY.ENG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Table of contents

* [Welcome](README.ENG.md)

## Getting Started <a href="#getting-started" id="getting-started"></a>

* [Quick start](getting-started/install.ENG.md)
* [configuration file](getting-started/config.ENG.md)
* [Build](getting-started/build.ENG.md)

## Use <a href="#use" id="use"></a>

* [Storage Policy](use/policy/README.ENG.md)
* [Compare](use/policy/compare.ENG.md)
* [S3 compatible](use/policy/s3.ENG.md)
* [WebDAV](use/webdav.ENG.md)
* [Offline download](use/aria2.ENG.md)
* [Custom front end](use/zi-ding-yi-qian-duan.ENG.md)
* [Extended Documentation Preview/Edit](use/wopi.ENG.md)
* [Contribution version related](use/pro/README.ENG.md)
* [Introduction](use/pro/jie-shao.ENG.md)
* [iOS client bulk authorization](use/pro/vo-l.ENG.md)
* [Custom payment channel](use/pro/pay.ENG.md)

## Maintain <a href="#manage" id="manage"></a>

* [Database script](manage/db-script.ENG.md)
* [Update](manage/update/README.ENG.md)
* [upgrade from 3.x.x](manage/update/cong-3.x.x-sheng-ji.ENG.md)
* [upgrade from 2.x.x](manage/update/upgrade.ENG.md)
* [Upgrade to Contribution Version](manage/update/update-from-os.ENG.md)
80 changes: 80 additions & 0 deletions getting-started/build.ENG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Construct

The Cloudreve project is mainly composed of two parts: the back-end main warehouse [cloudreve/Cloudreve](https://github.com/cloudreve/Cloudreve), and the front-end warehouse [cloudreve/frontend](https://github.com/cloudreve/ front end). Before compiling the Cloudreve backend, you need to build the frontend submodule in the `assets` directory and embed it into the backend repository using [statik](https://github.com/rakyll/statik).

## Environment preparation

1. Refer to [Getting Started - The Go Programming Language](https://golang.org/doc/install) to install and configure the Go language development environment (>=1.18);
2. Refer to [Download | Node.js](https://nodejs.org/zh-cn/download/) to install Node.js;
3. Refer to [Install | Yarn](https://classic.yarnpkg.com/zh-Hans/docs/install#windows-stable) to install Yarn;

## start building

### Clone code

```bash
# Clone repository
git clone --recurse-submodules https://github.com/cloudreve/Cloudreve.git

# Checkout the version you want to compile
git checkout 3.x.x
```

### Build static resources

```bash
# Enter the front terminal module
cd assets
# install dependencies
yarn install
# start building
yarn run build
# Delete the mapping file after the build is complete
cd build
find . -name "*.map" -type f -delete
# Return to the main directory of the project to package static resources
cd ../../
zip -r -assets/build >assets.zip
```

After completion, the built static resource files are located in the `assets/build` directory.

You can rename this directory to the `statics` directory, place it in the same directory as the main Cloudreve program and restart Cloudreve, Cloudreve will use the static resource files in this directory instead of the built-in ones.

### Compile the project

```bash
# Return to the project main directory
cd ../

# Get the current version number, Commit
export COMMIT_SHA=$(git rev-parse --short HEAD)
export VERSION=$(git describe --tags)

# start compiling
go build -a -o cloudreve -ldflags " -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.BackendVersion=$VERSION' -X 'github.com/cloudreve/Cloudreve/v3/pkg/conf.LastCommit =$COMMIT_SHA'"
```

{% hint style="info" %}
When compiling for the first time, Go will download related dependent libraries. If your network environment is not good, this step may be too slow or fail. You can use [GOPROXY.IO](https://goproxy.io/zh/) to speed up module downloading.
{% endhint %}

After the compilation is complete, the final executable file `cloudreve` will be generated in the project root directory.

## Build helpers

You can use [goreleaser](https://goreleaser.com/intro/) to quickly complete operations such as building and packaging, as follows:

```bash
# install goreleaser
go install github.com/goreleaser/goreleaser@latest

# Build the project
goreleaser build --clean --single-target --snapshot
```

Or cross compile all available versions:

```sh
goreleaser build --clean --snapshot
```
198 changes: 198 additions & 0 deletions getting-started/config.ENG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
# configuration file

## configuration file

When starting for the first time, Cloudreve will create a configuration file named `conf.ini` in the same directory. You can modify this file to configure some parameters. After saving, you need to restart Cloudreve to take effect.

You can also add the `-c` parameter to specify the configuration file path at startup:

```
./cloudreve -c /path/to/conf.ini
```

An example of a complete configuration file is as follows:

{% code title="conf.ini" %}
```ini
[System]
; run mode
Mode = master
; listening port
Listen = :5212
; Whether to enable Debug
Debug = false
; Session key, usually automatically generated at first startup
SessionSecret = 23333
; Hash plus salt, usually automatically generated at the first startup
HashIDSalt = something really hard to guss
; Header to use when presenting client IP
ProxyHeader = X-Forwarded-For

; SSL related
[SSL]
; SSL listening port
Listen = :443
; certificate path
CertPath = C:\Users\i\Documents\fullchain.pem
; private key path
KeyPath = C:\Users\i\Documents\privkey.pem

; Enable Unix Socket listening
[UnixSocket]
Listen = /run/cloudreve/cloudreve.sock
; Set the permissions of the generated socket file
Perm = 0666

; Database related, if you only want to use the built-in SQLite database, delete this part directly
[Database]
; Database type, currently supports sqlite/mysql/mssql/postgres
Type = mysql
; MySQL port
Port = 3306
; username
User = root
; password
Password = root
; database address
Host = 127.0.0.1
; Name database
Name = v3
; data table prefix
TablePrefix = cd_
; character set
Charset = utf8mb4
; SQLite database file path
DBFile = cloudreve.db
; The buffer time to safely close the database connection before the process exits
GracePeriod = 30
; Connect to database using Unix Socket
UnixSocket = false

; Configuration in slave mode
[Slave]
; communication key
Secret = 1234567891234567123456789123456712345678912345671234567891234567
; Callback request timeout (s)
CallbackTimeout = 20
; signature validity period
SignatureTTL = 60

; Cross domain configuration
[CORS]
AllowOrigins = *
AllowMethods = OPTIONS,GET,POST
AllowHeaders = *
AllowCredentials = false
SameSite = Default
Secure = lse

; Redis related
[Redis]
Server=127.0.0.1:6379
Password =
DB = 0

; Slave configuration override
[OptionOverwrite]
; Can be overridden directly using `setting name=value` format
max_worker_num = 50
```
{% endcode %}

## Configuration example

### Using MySQL

By default, Cloudreve will use the built-in SQLite database and create a database file `cloudreve.db` in the same directory. If you want to use MySQL, please add the following content to the configuration file and restart Cloudreve. Note that Cloudreve only supports MySQL versions greater than or equal to 5.7.

```ini
[Database]
; Database type, currently supports sqlite/mysql/mssql/postgres
Type = mysql
; MySQL port
Port = 3306
; username
User = root
; password
Password = root
; database address
Host = 127.0.0.1
; Name database
Name = v3
; data table prefix
TablePrefix = cd
; character set
Charset = utf8
```

{% hint style="info" %}
After changing the database configuration, Cloudreve will re-initialize the database, and the original data will be lost.
{% endhint %}

### Using Redis

You can add Redis related settings in the configuration file:

```ini
[Redis]
Server=127.0.0.1:6379
Password = your password
DB = 0
```

{% hint style="info" %}
Please specify a DB that is not used by other businesses for Cloudreve to avoid conflicts.
{% endhint %}

After restarting Cloudreve, you can pay attention to the console output to determine whether Cloudreve successfully connected to the Redis server. After using Redis, the following will be taken over by Redis:

* User sessions (login sessions are no longer lost after restarting Cloudreve)
* Data table high-frequency record query cache (such as storage strategy, setting items)
* callback session
* OneDrive Credentials

### Enable HTTPS

{% hint style="info" %}
If you are using the web server as a reverse proxy to Cloudreve, it is recommended that you configure SSL on the web server. The enabling method described in this section is only valid for the scenario of using Cloudreve's built-in web server.
{% endhint %}

Add to the configuration file:

```ini
[SSL]
Listen = :443
CertPath = C:\Users\i\Documents\fullchain.pem
KeyPath = C:\Users\i\Documents\privkey.pem
```

Where `CertPath` and `KeyPath` are the SSL certificate and private key path respectively. After saving, restart Cloudreve to take effect.

### Override the configuration items of the slave node

Some configuration items of Cloudreve are stored in the database, but the slave node does not connect to the database, you can override the corresponding configuration items in the configuration file.

For example, when the slave node is running as a storage node, you can set the thumbnail specification generated by the slave through the following configuration:

```ini
[OptionOverwrite]
thumb_width = 400
thumb_height = 300
thumb_file_suffix = ._thumb
thumb_max_task_count = -1
thumb_encode_method = jpg
thumb_gc_after_gen = 0
thumb_encode_quality = 85
```

If the slave node is used as an offline download node, you can override the default retry and timeout parameters through the following configuration to avoid file transfer failure due to the default value being too conservative:

```ini
[OptionOverwrite]
; The maximum number of tasks that can be executed in parallel in the task queue
max_worker_num = 50
; The maximum number of parallel coroutines when the task queue transfers tasks
max_parallel_transfer = 10
; The maximum number of retries after the upload of intermediate parts fails
chunk_retries = 10
```
Loading