安装emby、rclone和aria2
2021年8月27日...大约 5 分钟
1.前言
这篇文章将会在树莓派的Docker中安装emby、aria2,在树莓派上安装rclone并挂载Google Drive
警告
本文的所有操作都是基于开启代理后的!如果某些网站无法连接,内容无法下载等,请开启代理!
2.安装Rclone
记得开代理,不然连不上Google Drive
export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
安装
sudo apt install rclone
2.1 配置rclone
输入rclone config
配置rclone
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name>
输入n
,然后输入名字(随便取)
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / 1Fichier
\ "fichier"
2 / Alias for an existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Citrix Sharefile
\ "sharefile"
9 / Dropbox
\ "dropbox"
10 / Encrypt/Decrypt a remote
\ "crypt"
11 / FTP Connection
\ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
15 / Hubic
\ "hubic"
16 / JottaCloud
\ "jottacloud"
17 / Koofr
\ "koofr"
18 / Local Disk
\ "local"
19 / Mail.ru Cloud
\ "mailru"
20 / Microsoft Azure Blob Storage
\ "azureblob"
21 / Microsoft OneDrive
\ "onedrive"
22 / OpenDrive
\ "opendrive"
23 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
24 / Pcloud
\ "pcloud"
25 / Put.io
\ "putio"
26 / SSH/SFTP Connection
\ "sftp"
27 / Transparently chunk/split large files
\ "chunker"
28 / Union merges the contents of several remotes
\ "union"
29 / Webdav
\ "webdav"
30 / Yandex Disk
\ "yandex"
31 / http Connection
\ "http"
32 / premiumize.me
\ "premiumizeme"
Storage>
输入13
选择Google Drive,后面的client_id
和client_secret
不用管直接回车
Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Full access all files, excluding Application Data Folder.
\ "drive"
2 / Read-only access to file metadata and file contents.
\ "drive.readonly"
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app.
\ "drive.file"
/ Allows read and write access to the Application Data folder.
4 | This is not visible in the drive website.
\ "drive.appfolder"
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content.
\ "drive.metadata.readonly"
scope>
这里选择1
,后面的root_folder_id
和service_account_file
不用管直接回车
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n
这里两项都选n
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/fhgsdhifghisdhfjciownvheufbsoasdhfhosjcbf/sdufisdbcbaoqiowhsaopsidnaisgdbaiusdbaush+jdshis=asjhdsialosib
Log in and authorize rclone for access
Enter verification code>
浏览器打开上面的网址,获得授权的代码
Configure this as a team drive?
y) Yes
n) No
y/n>
这里如果你要使用团队盘,就选yes,不是的话,就选n
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d>
输入y
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>
最后输入q
完成配置
2.2 挂载到本地
将刚才的GoogleDrive挂载到本地目录上
rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
DriveName
为初始化配置填的name
,Folder
为GoogleDrive
里的文件夹,LocalFolder
为本地文件夹。
设置开机自启,自动挂载。创建文件/etc/systemd/system/rclone.service
,写入如下内容
[Unit]
Description=Rclone Mount GoogleDrive
After=clash.service
[Service]
Type=simple
User=ubuntu
Environment="https_proxy=http://127.0.0.1:7890"
Environment="http_proxy=http://127.0.0.1:7890"
ExecStart=rclone mount gdrive:emby /home/emby/gdrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
Restart=on-abort
[Install]
WantedBy=multi-user.target
参数解释,点击展开
Description
:当前服务的简单描述After
:在clash.service启动后再启动Type
:字段定义启动类型,simple表示ExecStart字段启动的进程为主进程User
:启动用户Environment
:环境参数ExecStart
:定义启动进程时执行的命令Restart
:on-abort表示只有在收到没有捕捉到的信号终止时,才会重启WantedBy
:表示该服务所在的 Target
更多参数详解可访问阮一峰的网络日志
刷新配置
sudo systemctl daemon-reload
设置开机自启
sudo systemctl enable rclone
下次开机就能自动挂载了
3.安装emby
首先要配置代理,让emby能正常刮削数据,在Docker运行的用户目录下新建.docker/config.json
,写入以下内容
{
"proxies":
{
"default":
{
"httpProxy": "http://172.17.0.1:7890",
"httpsProxy": "http://172.17.0.1:7890",
"noProxy": "*.test.example.com,.example2.com,127.0.0.0/8"
}
}
}
上面的ip地址视情况自己修改,然后拉取emby的镜像
sudo docker pull emby/embyserver_arm64v8
启动容器
docker run -d \
--name embyserver \
--net=host \
--device /dev/vchiq:/dev/vchiq \
--publish 8096:8096 \
--publish 8920:8920 \
--env UID=1000 \
--env GID=1000 \
--env GIDLIST=1000 \
emby/embyserver_arm64v8
参数解释,点击展开
--name embyserver
:容器名称--net=host
:网络模式--device /dev/vchiq:/dev/vchiq
:MMAL/OMX on Raspberry Pi (我也不知道干嘛的(+_+)?)--publish 8096:8096
:http 端口--publish 8920:8920
:https 端口--env UID=1000
:用户UID,根据自己情况修改--env GID=1000
:用户GID,根据自己情况修改--env GIDLIST=1000
:填用户GID
启动后,浏览器输入http://ip-server:8096
进入emby进行初始设置
4.安装Aria2
安装aria2和ariang,注意!这两个docker镜像都是第三方制作的
4.1 Aria2
安装
sudo docker pull p3terx/aria2-pro
docker run -d \
--name aria2-pro \
--restart unless-stopped \
--log-opt max-size=1m \
-e PUID=$UID \
-e PGID=$GID \
-e RPC_SECRET=<TOKEN> \
-e RPC_PORT=6800 \
-e LISTEN_PORT=6888 \
-e DISK_CACHE=<SIZE> \
p3terx/aria2-pro
部分参数解释,点击展开
RPC_SECRET
:RPC 密钥设置,即 WebUI 连接时需要填写的密码RPC_PORT
:RPC 端口设置LISTEN_PORT
:BT 监听端口(TCP)、DHT 监听端口(UDP)设置,即 Aria2 配置中listen-port
与dht-listen-port
选项定义的端口。如果没有设置,配置文件中的默认值为6888
。DISK_CACHE
:磁盘缓存设置,默认值64M
。建议在有足够的内存空闲情况下设置为适当增加大小,以减少磁盘 I/O ,提升读写性能,延长硬盘寿命。比如128M
、256M
等。
4.2 安装AriaNG
安装
sudo docker pull p3terx/ariang
docker run -d \
--name ariang \
--restart unless-stopped \
--log-opt max-size=1m \
-p 6880:6880 \
p3terx/ariang
浏览器进入http://ip-server:6880
,输入密码,连接到aria2
Powered by Waline v3.4.2