linux部署私人网盘系统Cloudreve实现资源自由,下载自由!


Cloudreve是一款免费开源的网盘系统, 支持腾讯云COS、本机、OneDrive等作为存储端,支持上传/下载,支持客户端直传,支持下载限速,可对接Aria2实现离线下载,支持在线压缩/解压、多文件打包下载。 Cloudreve同时也支持多用户注册和使用,视频、图像、音频、文本、Office 文档在线预览。

安装前准备

1
2
3
4
5
6
mkdir -vp cloudreve/{uploads,avatar} \
&& touch cloudreve/conf.ini \
&& touch cloudreve/cloudreve.db \
&& mkdir -p aria2/config \
&& mkdir -p data/aria2 \
&& chmod -R 777 data/aria2

docker compose文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
version: "3.8"
services:
cloudreve:
container_name: cloudreve
image: cloudreve/cloudreve:latest
restart: unless-stopped
ports:
- "5212:5212"
volumes:
- temp_data:/data
- ./cloudreve/uploads:/cloudreve/uploads
- ./cloudreve/conf.ini:/cloudreve/conf.ini
- ./cloudreve/cloudreve.db:/cloudreve/cloudreve.db
- ./cloudreve/avatar:/cloudreve/avatar
depends_on:
- aria2
aria2:
container_name: aria2
image: p3terx/aria2-pro
restart: unless-stopped
environment:
- RPC_SECRET=自行生成填入
- RPC_PORT=6800
volumes:
- ./aria2/config:/config
- temp_data:/data
volumes:
temp_data:
driver: local
driver_opts:
type: none
device: $PWD/data
o: bind

安装

1
docker-compose up -d

nginx反代

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name *.exmple.com;
# 强制重定向到 HTTPS
return 301 https://$host$request_uri;
}

server {
listen 443 ssl;
listen [::]:443 ssl;
server_name pan.example.com;
ssl_certificate "/etc/nginx/cert/example.com.pem";
ssl_certificate_key "/etc/nginx/cert/example.com.key";
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;


location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 20000m;
proxy_pass http://127.0.0.1:5212;
}
error_page 404 403 500 502 503 504 /404;
}

访问

1
https://pan.example.com