AList是一款阿里云盘的目录文件列表程序,后端基于golang最好的http框架gin,前端使用vue和ant design。没有专门学过前端,大佬轻喷😘
更新计划:https://www.notion.so/Todo-3fdc2b0deec340e9aa9d86e6f603df72,有好的建议可以评论或在issue中告诉我。
本程序仅供学习研究使用!!!发现任何bug请提issue,部署上遇到问题欢迎添加我的qqi@nn.ci。
更新的时候后端和前端文件都需要替换!!!!以及补上配置文件新的配置项!!!!
更新的时候后端和前端文件都需要替换!!!!以及补上配置文件新的配置项!!!!
更新的时候后端和前端文件都需要替换!!!!以及补上配置文件新的配置项!!!!
本次更新需要修改配置文件,更新之后/首次运行都需要手动rebuild一下。

首先第一步,Star本项目AList(bushi
refresh_token为什么不直接使用access_token,因为有效期只有两小时。经Syc大佬的提醒,获取refresh_token其实没这么麻烦,我们只需要登陆阿里云盘之后,打开开发者工具,切换到Application选项卡,点开Local storage,会有一个token项,点开就可以看到refresh_token了,此处感谢一下Syc大佬。

alistalist同级目录下conf.yml,复制以下内容到该文件中,或直接使用示例配置文件进行修改info:
title: AList #标题
logo: "" #网站logo 如果填写,则会替换掉默认的
footer_text: Xhofe's Blog #网页底部文字
footer_url: https://www.nn.ci #网页底部文字链接
music_img: https://img.xhofe.top/2020/12/19/0f8b57866bdb5.gif #预览音乐文件时的图片
check_update: true #前端是否显示更新
script: #自定义脚本,可以是脚本的链接,也可以直接是脚本内容
autoplay: true #视频是否自动播放
preview:
text: [txt,htm,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,yml,go,sh,c,cpp,h,hpp] #要预览的文本文件的后缀,可以自行添加
server:
port: "5244"
search: true
static: dist
site_url: '*'
password: password #用于重建目录
ali_drive:
api_url: https://api.aliyundrive.com/v2
max_files_count: 3000
drives:
- refresh_token: xxx #refresh_token
root_folder: root #根目录的file_id
name: drive0 #盘名,多个盘不可重复,这里只是示例,不是一定要叫这个名字,可随意修改
password: pass #该盘密码,空('')则不设密码,修改需要重建生效
hide: false #是否在主页隐藏该盘,不可全部隐藏,至少暴露一个
- refresh_token: xxx #只有一个盘的话,该段完全可以删除,反之有更多可以继续添加
root_folder: root
name: drive1
password: pass
hide: false
database:
type: sqlite3
dBFile: alist.dbrefresh_token,然后自行修改配置文件中默认的值alist、conf.yml和一个文件夹dist,在该文件夹下面执行下面的命令(Linux)chmod +x alist
nohup ./alist > log.log 2>&1 &ok,程序已经跑起来了。你可以cat log.log看看有没有报错。或者访问http://ip:5244进行查看。
vim /usr/lib/systemd/system/alist.service添加以下内容,其中path_alist为alist所在的路径
[Unit]
Description=alist
After=network.target
[Service]
Type=simple
WorkingDirectory=path_alist
ExecStart=path_alist/alist -conf conf.yml
Restart=on-failure
[Install]
WantedBy=multi-user.target然后systemctl daemon-reload重载配置,现在你就可以使用这些命令来管理程序了:
systemctl start alistsystemctl stop alistsystemctl enable alistsystemctl status alist修改database部分配置:
database:
type: mysql
user: 用户名
password: 密码
host: 127.0.0.1
port: 3306
name: 数据库名与使用gin作为静态资源服务器操作步骤差不多,不同的地方在于:
.env.production中的VUE_APP_API_URL为具体部署的后端地址,然后yarn && yarn build自行部署conf.yml中的server.site_url填写前端部署的域名或者默认为'*',需要正确填写,否则会报错。location / {
try_files $uri $uri/ /index.html;
}参考:https://router.vuejs.org/zh/guide/essentials/history-mode.html
程序默认监听5244端口,要实现https访问,需要使用nginx反向代理,在配置文件中加入
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_redirect off;
proxy_pass http://127.0.0.1:5244;
}.password-密码,列表中会自动消除后面的密码部分。.hide即可。ali_drive.root_folder 为想要设置的文件夹的file_id即可。footer_text和footer_url为要设置的内容,或者不填则不会显示。dist目录下的favicon.ico即可。pkill alist 停掉老的进程,删除旧的alist,下载新的alist,查看配置文件,补上新的配置项,再次运行即可。-skip-update跳过检查更新。If you are using this project and happy with it or just want to encourage me to continue creating stuff,buy me a coffee by click this 。Thanks:
重建密码从哪里获取啊
配置文件中server.password
默认文件是password么
server:
port: "5244"
search: true
static: dist
site_url: '*'
password: password
像这样密码就是password?
提示 wrong password