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

一个支持多种存储,支持网页浏览和 WebDAV 的文件列表程序,由 gin 和 Solidjs 驱动。

特点

使用简单
AList 从一开始就设计为易于安装,并且可以在所有平台上使用。
多种存储
AList 支持多个存储提供商,包括本地存储、阿里云盘、OneDrive、Google Drive 等,且易于拓展。
支持 WebDAV
AList 支持所有 WebDAV 存储,这是一种用于访问文件的标准。
黑暗模式
自由切换明暗模式
受保护的路由
为特定路径添加密码保护和身份验证
文件预览
支持视频、音频、文档、PDF、图片预览等,甚至支持 ipa 安装
打包下载
使用浏览器的 stream api 支持打包下载,无需使用服务器
更多新功能
包括文本编辑器、README/HTML 渲染、文件永久链接、Cloudflare Workers 代理等

安装

一键脚本

仅适用于 Linux amd64/arm64 平台。

#安装
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install
#更新
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s update
#卸载
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s uninstall

自定义路径
默认安装在 /opt/alist 中。 自定义安装路径,将安装路径作为第二个参数添加,必须是绝对路径(如果路径以 alist 结尾,则直接安装到给定路径,否则会安装在给定路径 alist 目录下),如 安装到 /root:

# Install
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s install /root
# update
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s update /root
# Uninstall
curl -fsSL "https://alist.nn.ci/v3.sh" | bash -s uninstall /root

系统管理

启动:    systemctl start alist
关闭:    systemctl stop alist
状态:    systemctl status alist
重启:    systemctl restart alist

手动安装

获取 AList

打开 AList Release 下载待部署系统对应的文件。最新版的前端已经和后端打包好了,不用再下载前端文件了。

xxxx 指的是不同系统/架构对应的名称,一般 Linux-x86/64 为 alist-linux-amd64。如果你的 glibc 版本太低,建议下载 musl 版本

当你看到 start [email protected]:5244 的输出,之后没有报错,说明操作成功。 第一次运行时会输出初始密码。程序默认监听 5244 端口。 现在打开 http://ip:5244 可以看到登录页面,WebDAV 请参阅 WebDav。

手动运行

Linux

# 解压下载的文件,得到可执行文件:
tar -zxvf alist-xxxx.tar.gz
# 授予程序执行权限:
chmod +x alist
# 运行程序
./alist server
# 获得管理员信息
./alist admin

守护进程

使用任意方式编辑 /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 server
Restart=on-failure
 
[Install]
WantedBy=multi-user.target

然后,执行 systemctl daemon-reload 重载配置,systemctl start alist启动服务。

相关信息
对于所有平台,您可以使用以下命令来静默启动、停止和重新启动。 (v3.4.0 及更高版本)

# 携带`--force-bin-dir`参数启动服务
alist start
# 通过pid停止服务
alist stop
# 通过pid重启服务
alist restart

使用 Docker

查看管理员信息:

docker exec -it alist ./alist admin

发行版本

docker-cli

docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:latest

docker-compose

version: '3.3'
services:
    alist:
        restart: always
        volumes:
            - '/etc/alist:/opt/alist/data'
        ports:
            - '5244:5244'
        environment:
            - PUID=0
            - PGID=0
            - UMASK=022
        container_name: alist
        image: 'xhofe/alist:latest'

使用 aria2 离线下载

如果你想使用aria2离线下载,我们推荐你使用这个image,它预装了aria2。

有关离线下载功能的额外说明
若没有使用docker pull --platform参数拉取镜像时,docker可能会在64位操作系统上拉取32位镜像,这将可能导致离线下载功能即使在正常配置情况下也无法使用。

当发生错误时,您会在Alist的日志文件中看到类似错误日志。

ERRO[2022-11-20 12:05:19] error [unaligned 64-bit atomic operation] while run task [download http://pic.rmb.bdstatic.com/bjh/34ee946f7a74435a167ca4351d723374.png to [/ftp](/)]

解决方法:
如果是CPU架构是64位,尝试手动拉取64位docker镜像,重新构建容器,再次尝试。
如果是CPU架构是32位,目前尚无可用方案。

开发版本

仅适用于 amd64/arm64。不推荐,这可能无法正常工作。

docker-cli

docker run -d --restart=always -v /etc/alist:/opt/alist/data -p 5244:5244 -e PUID=0 -e PGID=0 -e UMASK=022 --name="alist" xhofe/alist:main

docker-compose

version: '3.3'
services:
    alist:
        restart: always
        volumes:
            - '/etc/alist:/opt/alist/data'
        ports:
            - '5244:5244'
        environment:
            - PUID=0
            - PGID=0
            - UMASK=022
        container_name: alist
        image: 'xhofe/alist:main'

用户/组标识符

当使用卷(-v 标志)权限问题时,主机操作系统和容器之间可能会出现权限问题,我们通过允许您指定用户 PUID 和组 PGID 来避免此问题。
确保主机上的任何卷目录都归您指定的同一用户所有,任何权限问题都会像魔术一样消失。
在这种情况下,PUID=1000 和 PGID=1000,要找到你的使用 id user,如下所示:

  $ id username
    uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)

访问

使用方法:https://alist.nn.ci/zh/guide/drivers/common.html

[root@zhz ~]# docker logs aad99d1d377c2e54d903cdeeff0fd3e65daaece8f67842536288aba5fef7a963
INFO[2023-05-27 14:19:18] reading config file: data/config.json        
INFO[2023-05-27 14:19:18] config file not exists, creating default config file 
INFO[2023-05-27 14:19:18] load config from env with prefix:            
INFO[2023-05-27 14:19:18] init logrus...                               
INFO[2023-05-27 14:19:18] Successfully created the admin user and the initial password is: UADOBB21 
INFO[2023-05-27 14:19:18] start server @ 0.0.0.0:5244                  
INFO[2023-05-27 14:19:18] Aria2 not ready.                             
INFO[2023-05-27 14:19:18] qbittorrent not ready.    
Name Value
Url http[s]/domain:port/dav/
Host domain
路径 dav
协议 http/https
端口 与网页端一致
WebDAV用户名 与网页端用户名一致
WebDAV密码 与网页端密码一致

AList 一个支持多种存储的文件列表程序,使用 Gin 和 Solidjs。_第1张图片
AList 一个支持多种存储的文件列表程序,使用 Gin 和 Solidjs。_第2张图片

Learn from yesterday, live for today, hope for tomorrow.

你可能感兴趣的:(Docker,gin,linux,bash,运维,云原生)