一个简化版本的 AList 文件管理器,支持阿里云盘和夸克网盘。
- ✅ 支持阿里云盘和夸克网盘
- ✅ Web 界面文件浏览
- ✅ 存储管理(添加、列表显示)
- ✅ 文件下载链接生成
- ✅ 响应式设计
- ✅ Docker 支持
- 确保已安装 Go 1.19+
- 克隆项目并运行:
git clone <repository-url>
cd simple-alist
go mod tidy
go run main.go# 构建镜像
docker build -t simple-alist .
# 运行容器
docker run -p 12000:12000 simple-alistdocker-compose up -dPORT: 服务端口,默认 12000CONFIG_FILE: 配置文件路径,默认config.json
可以通过配置文件预设存储,创建 config.json:
{
"storages": [
{
"name": "我的阿里云盘",
"type": "aliyun",
"mount_path": "/aliyun",
"config": {
"refresh_token": "your_aliyun_refresh_token"
}
},
{
"name": "我的夸克网盘",
"type": "quark",
"mount_path": "/quark",
"config": {
"cookie": "your_quark_cookie"
}
}
]
}- 登录阿里云盘网页版
- 打开浏览器开发者工具
- 在 Application/Storage -> Local Storage 中找到
refresh_token
- 登录夸克网盘网页版
- 打开浏览器开发者工具
- 在 Network 标签页中找到任意请求的 Cookie 头部
- 复制完整的 Cookie 字符串
GET /api/storages- 获取存储列表POST /api/storages- 添加存储
GET /api/files?path=<path>- 获取文件列表GET /api/download?path=<path>- 获取下载链接
simple-alist/
├── main.go # 主程序入口
├── server/
│ └── router.go # HTTP 路由和处理器
├── drivers/
│ ├── aliyun.go # 阿里云盘驱动
│ └── quark.go # 夸克网盘驱动
├── internal/
│ ├── model.go # 数据模型
│ ├── storage.go # 存储管理
│ └── config.go # 配置管理
├── public/
│ ├── index.html # 主页面
│ └── demo.html # 演示页面
├── config.example.json # 配置文件示例
├── Dockerfile # Docker 构建文件
├── docker-compose.yml # Docker Compose 配置
└── test_api.sh # API 测试脚本
- 在
drivers/目录下创建新的驱动文件 - 实现
Driver接口:type Driver interface { Init(config map[string]interface{}) error List(path string) ([]File, error) GetDownloadURL(path string) (string, error) }
- 在
internal/storage.go中注册新驱动
使用提供的测试脚本:
chmod +x test_api.sh
./test_api.sh- 安全性: 请妥善保管你的 refresh_token 和 cookie,不要泄露给他人
- token 有效期: 阿里云盘的 refresh_token 和夸克网盘的 cookie 都有有效期,需要定期更新
- 网络环境: 确保服务器能够访问对应的云盘 API
- 存储限制: 不同云盘可能有 API 调用频率限制
- "require login" - token/cookie 已过期,需要重新获取
- "failed to get drive_id" - 阿里云盘 refresh_token 无效
- 网络超时 - 检查网络连接和防火墙设置
服务运行时会输出详细日志,可以通过日志排查问题:
# 查看实时日志
tail -f server.log
# 查看错误日志
grep ERROR server.logMIT License
欢迎提交 Issue 和 Pull Request!