Alist 网盘聚合挂载神器在FreeBSD下编译安装

Alist支持各种主流网盘,全部统一管理,妈妈再也不怕我的网盘太多太乱了!
 

Alist是一个支持各种网盘的神器,它的特点:

  • 多种存储
    • 本地存储
    • 阿里云盘
    • OneDrive / Sharepoint(国际版, 世纪互联,de,us)
    • 天翼云盘 (个人云, 家庭云)
    • GoogleDrive
    • 123云盘
    • FTP / SFTP
    • PikPak
    • S3
    • Seafile
    • 又拍云对象存储
    • WebDav(支持无API的OneDrive/SharePoint)
    • Teambition(中国,国际)
    • 分秒帧
    • 和彩云 (个人云, 家庭云)
    • Yandex.Disk
    • 百度网盘
    • UC网盘
    • 夸克网盘
    • 迅雷网盘
    • 蓝奏云
    • 阿里云盘分享
    • 谷歌相册
    • Mega.nz
    • 一刻相册
    • SMB
    • 115
    • Cloudreve
    • Dropbox

Alist 网盘聚合挂载神器在FreeBSD下编译安装_第1张图片

 

编译安装

 安装参考自这篇文档:网盘聚合挂载神器Alist及FreeBSD版编译 – YSY's Blog

因为本身不支持FreeBSD编译,所以要自己写个安装shell:buildfreebsd.sh,抄楼上博客即可:

appName="alist"
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitCommit=$(git log --pretty=format:"%h" -1)
version=$(git describe --long --tags --dirty --always)
webVersion=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
ldflags="\
-w -s \
-X 'github.com/alist-org/alist/v3/internal/conf.BuiltAt=$builtAt' \
-X 'github.com/alist-org/alist/v3/internal/conf.GoVersion=$goVersion' \
-X 'github.com/alist-org/alist/v3/internal/conf.GitAuthor=$gitAuthor' \
-X 'github.com/alist-org/alist/v3/internal/conf.GitCommit=$gitCommit' \
-X 'github.com/alist-org/alist/v3/internal/conf.Version=$version' \
-X 'github.com/alist-org/alist/v3/internal/conf.WebVersion=$webVersion' \
"
go build -ldflags="$ldflags" .

编译之前可以先加上go的加速器:

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

然后开始编译即可:

sh buildfreebsd.sh

开始使用

文档:Home | AList文档

编译好后,直接在当前目录输入./alist ,即可看到命令提示:

skywalk@x250:~/github/alist % ./alist
A file list program that supports multiple storage,
built with love by Xhofe and friends in Go/Solid.js.
Complete documentation is available at https://alist.nn.ci/

Usage:
  alist [command]

Available Commands:
  admin       Show admin user's info and some operations about admin user's password
  cancel2fa   Delete 2FA of admin user
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  lang        Generate language json file
  restart     Restart alist server by daemon/pid file
  server      Start the server at the specified address
  start       Silent start alist server with `--force-bin-dir`
  stop        Stop alist server by daemon/pid file
  storage     Manage storage
  version     Show current version of AList

Flags:
      --data string     data folder (default "data")
      --debug           start with debug mode
      --dev             start with dev mode
      --force-bin-dir   Force to use the directory where the binary file is located as data directory
  -h, --help            help for alist
      --log-std         Force to log to std
      --no-prefix       disable env prefix

Use "alist [command] --help" for more information about a command.

 创建密码:

./alist admin

INFO[2024-01-23 21:31:51] Successfully created the admin user and the initial password is: go9n5Ioy 
INFO[2024-01-23 21:31:51] Admin user's username: admin                 
INFO[2024-01-23 21:31:51] The password can only be output at the first startup, and then stored as a hash value, which cannot be reversed 
INFO[2024-01-23 21:31:51] You can reset the password with a random string by running [alist admin random] 
INFO[2024-01-23 21:31:51] You can also set a new password by running [alist admin set NEW_PASSWORD] 

查看当前的网盘列表:

./alist storage list

启动服务

 ./alist start

服务启动后会起一个5244端口的服务,用浏览器连上即可管理。 http://127.0.0.1:5244

密码就是前面生成的admin对应的密码。

配置网盘

不过配置还是有点烧脑筋,以移动云盘为例,配置参考:中国移动云盘 | AList文档

要跟踪网页的交互信息,找到这两个值填上去:Authorization 和根文件夹ID(catalogID)

刚开始可能摸不着头脑,做顺了,后面几个网盘都是类似这样的操作,也就熟能生巧了。

后面阿里网盘和百度一刻相册都比较好配置,不需要去看网页交互信息,Alist会帮助拿到refresh_token,拿到之后填上去即可。

刚开始一刻相册没有成功,因为refresh_token没有刷出来。多尝试了几次,刷出来,装好了。

阿里网盘也刷出来refresh_token了,也装好了。

整体效果不错,非常推荐使用!

你可能感兴趣的:(项目实践,运维,服务器,freebsd,网盘)