02_Other-AList 搭建云盘

:点击此处或下方 以展开或折叠目录

1. 参考链接

作者 Xhofe

AList 官方文档

Github 地址

AList:🗂️ 一个支持多种存储的文件列表程序,使用 Gin 和 Solidjs。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
使用简单
AList 从一开始就设计为易于安装,并且可以在所有平台上使用。

多种存储
AList 支持多个存储提供商,包括本地存储、阿里云盘、OneDrive、Google Drive 等,且易于拓展。

支持 WebDAV
AList 支持所有 WebDAV 存储,这是一种用于访问文件的标准。

黑暗模式
自由切换明暗模式

受保护的路由
为特定路径添加密码保护和身份验证

文件预览
支持视频、音频、文档、PDF、图片预览等,甚至支持 ipa 安装

打包下载
使用浏览器的 stream api 支持打包下载,无需使用服务器

更多新功能
包括文本编辑器、README/HTML 渲染、文件永久链接、Cloudflare Workers 代理等
1
2
3
# 一键脚本
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install

1
2
3
4
5
6
7
8
9
10
11
12
13
# 反向代理
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_redirect off;
proxy_pass http://127.0.0.1:5244;
# the max size of file to upload
client_max_body_size 20000m;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 命令
启动: systemctl start alist
关闭: systemctl stop alist
配置开机自启: systemctl enable alist
取消开机自启: systemctl disable alist
状态: systemctl status alist
重启: systemctl restart alist

cd /opt/alist
# 运行程序
./alist server
# 获得管理员信息
./alist admin


2. 个人样例

反向代理

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
34
35
# root @ CentOS in /usr/local/nginx/conf/conf.d
$ cat cpen.top.conf
...

# AList 个人云盘
# https://github.com/alist-org/alist/blob/main/README_cn.md
server {
listen 8004 ssl;

server_name cpen.top;

location / {
proxy_pass http://127.0.0.1:5244;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_redirect off;
# the max size of file to upload
client_max_body_size 20000m;
proxy_connect_timeout 120; # 加大120
proxy_send_timeout 120; # 加大120
proxy_read_timeout 120; # 加大120
proxy_http_version 1.1; # 开启后端,长连接
proxy_set_header Connection ""; # 开启后端,长连接
}

ssl_certificate /usr/local/nginx/ssl/cpen.top.pem;
ssl_certificate_key /usr/local/nginx/ssl/cpen.top.key;

access_log /data/service_logs/nginx/cpen.top_access.log misc;
error_log /data/service_logs/nginx/cpen.top_error.log;
}

设置.全局.自定义内容

1
2
<div style="display: flex; flex-direction: column; align-items: center;"><a target="_blank" rel="noopener noreferrer" class="chakra-link line1 css-f4h6uy" href="http://beian.miit.gov.cn" style="">苏ICP备xxx号</a></div>