Alist 网盘聚合管理指南
核心特性
- 支持50+存储服务(阿里云盘/OneDrive/Google Drive等)
- WebDAV协议支持
- 文件预览与直链下载
- 多用户权限管理
- Docker/K8s云原生部署
快速部署
Docker Compose方案
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| version: '3.8'
services: alist: image: xhofe/alist:latest container_name: alist restart: unless-stopped ports: - "5244:5244" volumes: - ./data:/opt/alist/data - ./config:/opt/alist/config environment: - PUID=1000 - PGID=1000 networks: - alist-net
networks: alist-net: driver: bridge
|
存储配置
阿里云盘挂载
- 获取refresh_token:
- 登录阿里云盘网页版
- 按F12打开开发者工具 → Application → Local Storage → token字段
- 添加存储:
1 2 3 4 5 6
| { "mount_path": "/aliyun", "order": 0, "driver": "AliyundriveOpen", "addition": "{\"refresh_token\":\"your_token\",\"root_folder_id\":\"root\"}" }
|
OneDrive挂载
- 注册Azure应用:
- 获取client_id和client_secret
- 配置参数:
1 2 3 4 5 6 7 8 9
| { "mount_path": "/onedrive", "driver": "OneDrive", "addition": "{ \"client_id\":\"your_client_id\", \"client_secret\":\"your_secret\", \"redirect_uri\":\"http://localhost:53619/\", \"root_folder_id\":\"root\"}" }
|
安全加固
反向代理配置(Nginx)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| server { listen 443 ssl; server_name alist.example.com;
ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem;
location / { proxy_pass http://localhost:5244; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
|
权限管理
1 2 3 4 5 6 7
| docker exec -it alist ./alist admin set NEW_PASSWORD
curl -X POST http://localhost:5244/api/user/create \ -H "Authorization: Bearer ADMIN_TOKEN" \ -d '{"username":"user1", "password":"pass123", "permission": 100}'
|
高级功能
WebDAV集成
1 2 3 4 5
| 地址:http://your_domain:5244/dav 用户:管理员账号 密码:管理员密码 路径:/dav/存储路径
|
定时任务
1 2 3 4 5
| 0 3 * * * docker restart alist
0 2 * * * tar -czvf /backup/alist_$(date +%F).tar.gz /path/to/alist/data
|
常见问题
存储挂载失败
- 检查令牌有效期(阿里云盘refresh_token每月需刷新)
- 验证API配额(Google Drive等需配置API限制)
文件无法预览
- 安装FFmpeg:
1 2
| FROM xhofe/alist:latest RUN apt update && apt install -y ffmpeg
|
版本升级
1 2
| docker-compose pull docker-compose up -d
|
官方文档:Alist Docs
插件市场:Awesome Alist