Alist配置

  • 云盘的存储中需将WebDAV策略选为本地代理,否则挂载后无法成功读写
  • 出于安全性考虑可将设置-全局和对应存储中的签名所有启用签名开启
  • 可将设置-站点中的允许挂载开启

rclone配置

  • 安装依赖:apt-get install fuse3
  • 脚本安装:curl https://rclone.org/install.sh | sudo bash
  • 设置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# 进入rclone设置
rclone config

# 选择新远程
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n #这里选择n

# 设置名字
name> remote
Type of storage to configure.
Choose a number from below, or type in your own value
[snip]
XX / WebDAV
\ "webdav"
[snip]
Storage> webdav #这里输入远程的名字,之后就是你的远程名称

# 设置远程地址url http://your_alist_ip:port/dav
URL of http host to connect to
Choose a number from below, or type in your own value
1 / Connect to example.com
\ "https://example.com"
url> http://127.0.0.1:8080/dav #这里设置alist的地址和端口,后面要带dav,这是alist要求的

# 这里选6就可以了,1-5都不是我们使用的
Name of the WebDAV site/service/software you are using
Choose a number from below, or type in your own value
1 / Fastmail Files
\ (fastmail)
2 / Nextcloud
\ (nextcloud)
3 / Owncloud
\ (owncloud)
4 / Sharepoint Online, authenticated by Microsoft account
\ (sharepoint)
5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
\ (sharepoint-ntlm)
6 / Other site/service or software
\ (other)
vendor> 6

# 设置远程账号
User name
user> admin #这里是你alist的密码

# 设置远程密码
Password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank
y/g/n> y #这里输入y
Enter the password: #这输入你的密码,密码是看不到的
password:
Confirm the password: #再次输入你的密码
password:

# 这里直接回车即可
Bearer token instead of user/pass (e.g. a Macaroon)
bearer_token>
Remote config

# 这里可能会问你是默认还是高级,选择默认即可

# 你的远程信息
--------------------
[remote]
type = webdav
url = http://127.0.0.1:8080/dav
vendor = Other
user = admin
pass = *** ENCRYPTED ***
--------------------

# 确认
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y #输入y即可,

# 最后按q退出设置
  • 连接测试:rclone lsd alist:
  • 挂载测试:
1
rclone mount alist:/ /webdav  --use-mmap --umask 000 --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --vfs-cache-mode writes --buffer-size 512M --vfs-cache-max-size 10G --cache-dir=/webdavcache
  • 报错相关:
    • --allow-other相关的报错:编辑配置文件sudo vim /etc/fuse.conf将第10行#user_allow_other改为user_allow_other
    • 文件夹路径报错需手动创建文件夹并正确修改权限
  • 解除挂载:fusermount -qzu /webdav
  • 设置自启:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#创建service文件
sudo cat >/usr/lib/systemd/system/rclone.service <<EOF
[Unit]
Description=rclone

[Service]
User=root
ExecStart=/usr/bin/rclone mount alist:/ /webdav --use-mmap --umask 000 --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --vfs-cache-mode writes --buffer-size 512M --vfs-cache-max-size 10G --cache-dir=/webdavcache

[Install]
WantedBy=multi-user.target
EOF
# reload守护进程
systemctl daemon-reload
# 设置service文件自启
systemctl enable rclone.service
# 启动service文件
systemctl start rclone.service

Jellyfin配置

注意将挂载 Alist 的本地文件夹/webdav映射到 Jellyfin 容器内即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
version: "3"
services:
jellyfin:
container_name: Jellyfin
image: jellyfin/jellyfin:10.8.11
networks:
- 1panel-network
ports:
- 8096:8096
restart: always
volumes:
- ./data/config:/config
- ./data/cache:/cache
- /webdav:/media/alist