This post is regarding how to use wahyd4/aria2-ui’s docker image to achieve a downloading and file managing / sharing center. In just one docker image, you can do downloading (Aria2), Web GUI downloading (AriaNG) , File Managing (FileBrowser), supporting multi-type file view, and saving to Google Drive.
Table of Contents
Pre-requirement:
root@linux:/# curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker
Open Firewall port:
tcp 80
iptables -A INPUT -p tcp –dport 80 -j ACCEPT
service iptables save
service iptables restart
firewall-cmd –zone=public —add-port=80/tcp –permanent
firewall-cmd –reload
Docker images:
wahyd4/aria2-ui:latest
Other related GitHub Sites:
https://github.com/wahyd4/aria2-ariang-x-docker-compose
https://github.com/51sec/aria2-ariang-x-docker-compose
Install FireBrowser + Aria2 + AriaNG + Caddy Docker
docker run -d -i --restart=always --name aria2-ui -p 80:80 -v ~/data:/data -v /home/gdrive:/gdrive wahyd4/aria2-ui
Notes:
- /data folder is aria2 downloading folder. After finished downloading, file will be transferred to /gdrive folder automatically.
- /gdrive folder is Rclone mounted Google Drive folder.
Configure FileBrowser
[root@centos-nextcloud-aria2 ~]docker exec -it aria2-ui /bin/bash
bash-5.0# cd /app
bash-5.0# ls
Procfile aria2c.sh caddy.sh conf filebrowser filebrowser.db forego init.sh start.sh
bash-5.0# vi Procfile
filebrowser: /app/filebrowser -p 8080 -d /app/filebrowser.db -r /gdrive
caddy: /app/caddy.sh
aria2c: /app/aria2c.sh
[root@centos-nextcloud-aria2 ~]# docker restart aria2-ui
Configure Aria2
[root@centos-nextcloud-aria2 ~]docker exec -it aria2-ui /bin/bash
rcloneupload.sh
,with following code:chmod +x rcloneupload.sh
Aria2 configuration file (/app/conf/aria2.conf) to add one following line at the file end:
on-download-complete=/app/conf/rcloneupload.sh
Restart aria2-ui docker to take change into effect
[root@centos-nextcloud-aria2 ~]# docker restart aria2-ui
bash-4.3# cd /app/conf/
bash-4.3# ls
aria2.conf aria2.session aria2c.sh key
bash-4.3# vi /app/conf/aria2.conf
# Bit Torrent: The amount of time and the upload-to-download ratio you wish to
# seed to. If either the time limit ( seconds ) or the seed ratio is reached,
# torrent seeding will stop. You can set seed-time to zero(0) to disable
# seeding completely.
seed-ratio=0.01
seed-time=1
on-download-complete=/app/conf/rcloneupload.sh
Configure Rclone to mount Google Drive
yum -y install epel-release
2. Install some components
yum -y install wget unzip screen fuse fuse-devel
3. Install rclone
[root@centos7-test1 data]# curl https://rclone.org/install.sh | sudo bash
4. configure rclone
rclone config
create a new remote and name it as google-drive
Other steps can check post: https://blog.51sec.org/2020/05/use-rclone-to-mount-google-drive-and.html
5. mount Google Drive using rclone
5.1 create a new folder at /home/gdrive
mkdir -p /home/gdrive
5.2 mount system
rclone mount google-drive: /home/gdrive –allow-other –allow-non-empty –vfs-cache-mode writes
Note: google-drive is the Rclone configuration name.
6. create rclone.service
To make rclone mount the google drive even after rebooted the vps, create /usr/lib/systemd/system/rclone.service with following information:
vi /usr/lib/systemd/system/rclone.service
[Unit]
Description=rclone
[Service]
User=root
ExecStart=/usr/bin/rclone mount google-drive: /home/gdrive –allow-other –allow-non-empty –vfs-cache-mode writes
Restart=on-abort
7. systemctl enable rclone.service
8. Using browser to access system
FileBrowser: http://ip
aria2: http://ip:ui
Default FileBrowser username/password will be admin/admin.
Aria will download files to docker’s local /data folder . Once completed downloading, the file will be moved to /gdrive folder.
Gdrive folder has been mounted with Google Drive, which will be managed by FileBrowser.
Remove Installed Docker
#Delete Docker
ContainerID=`docker ps|grep wahyd4/aria2-ui|awk ‘{print $1}’`
docker kill ${ContainerID}
docker rm ${ContainerID}
docker rmi `docker images|grep wahyd4/aria2-ui|awk ‘{print $3}’`
#Remove Download Folder
rm -rf ~/data
rm -rf /home/gdrive