简介
- Docker-pan:一个开箱机用的搭建私有网盘的 docker 镜像,由Filerun+AriaNg+Aria2几部分构成。
- Filerun:一款简洁的在线文件管理器,可在线对文件进行:图片预览、播放音乐、播放视频、文本编辑还支持语法高亮。
- AriaNg:aria2 web 界面,可离线下载磁力链接、BT 种子等,使用响应式布局,支持各种计算机或移动设备。
- Docker Hub:https://hub.docker.com/r/jaegerdocker/pan/
安装
docker安装与启动
安装docker
Markup
yum -y install docker-io
启动docker
Markup
service docker start
一键安装
Markup
docker run --name=pan -ti -p 8081:80 -p 6800:6800 jaegerdocker/pan
或者挂着数据卷,数据券路径:/var/www/html/system/data/default_home_folder
Markup
docker run --name=pan -v /data/pan:/var/www/html/system/data/default_home_folder -ti -p 8081:80 -p 6800:6800 jaegerdocker/pan
访问地址
- Filerun:http://yourdomain:8081
- 登陆用户名、密码:superuser
- AriaNg:http://yourdomain:8081/dweb
相关帖子:http://briteming.blogspot.com/2018/10/docker-pan-filerun-ariang-aria2.html
-----------------------------------
用Aria2+AriaNG在VPS上实现离线下载功能
Aria2(官网)和AriaNG(官网)到底是何方神圣呢,简单来讲,前者是一个下载工具,在命令行下可以用aria2c命令来下载(有点儿像wget?),这个程序之所以强大在于其不仅支持http和ftp,还支持bt,至于后者则是为aria2提供了一个可视化的web界面。
Aria2+AriaNG在VPS上实现离线下载功能
1.安装aria2
以CentOS 7为例,Debian大同小异
yum install epel-release -y yum install aria2 -y
2.后台运行aria2(命令中的Token换成自己的)
aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all --rpc-secret=TOKEN -D
3.如果是CentOS 7,需要设置firewalld开放6800端口,若VPS没装firewalld,则可跳过此步骤
firewall-cmd --zone=public --add-port=6800/tcp --permanent firewall-cmd --reload
4.安装ariaNG
5.访问ariaNG,如果出现aria2未连接的情况,需要设置一下:

----------
基于Aria2的免配置下载软件-Photon
上面的《用Aria2+AriaNG在VPS上实现离线下载功能》,当时介绍过aria2以及他的网页界面AriaNG,但是手动配置相对较为繁琐,最近发现了GitHub上的一个项目,名称是Photon,这是一个基于Aria2的桌面下载软件,作者称其为Light-weight(轻量级),但30+M的体积着实不小了…不过软件界面比较友好,而且无广告,支持Mac、Windows,据说作者会在近期加入对Linux的支持,只是不知道能否远程访问。
Photon:基于Aria2的免配置下载软件
GitHub地址:https://github.com/alanzhangzm/Photon;
Photon是基于Aria2,所以Aria2的插件也能通过RPC实现,可使用的一些插件包括迅雷离线、百度网盘、115等(在各个插件的设置里设置上Photon的RPC配置即可使用),Photon的RPC默认配置如下
URL: http://127.0.0.1:6800/jsonrpc Host: 127.0.0.1 Port: 6800
A lightweight multi-threaded downloader based on aria2.
Photon
Photon is a lightweight multi-threaded downloader based on aria2. It supports HTTP/HTTPS, Magnet links, BitTorrentand Metalink.
Photon is cross platform. It has macOS and Windows releases now and will have Linux release soon.
For Web frontend of aria2, please have a look at Photon WebUI.
Installation
Latest releases: https://github.com/alanzhangzm/Photon/releases
Screenshots
Mac
Extensions
Since Photon uses aria2 as download core, all of the extensions that support aria2 via RPC are also Photon compatible.
The default RPC configuration for Photon and aria2:
- URL: http://127.0.0.1:6800/jsonrpc
- Host: 127.0.0.1
- Port: 6800
Some popular extensions:
Development
# install dependencies
npm install
# serve with hot reload at localhost:9080
npm run dev
# build electron application for production
npm run build
# run unit & end-to-end tests
npm test
# lint all JS/Vue component files in `src/`
npm run lint
This project was generated with electron-vue@7c4e3e9 using vue-cli. Documentation about the original structure can be found here.
from https://github.com/alanzhangzm/Photon
( 下载软件Photon
Photon是一款基于 aria2 的开源下载软件,支持 HTTP/HTTPS,磁力链,BT 和 Metalink。目前支持Mac OS 和 Windows 平台。可以直接使用基于 RPC 协议的 aria2 插件。
[repo owner=”alanzhangzm” name=”Photon”])
Photon是一款基于 aria2 的开源下载软件,支持 HTTP/HTTPS,磁力链,BT 和 Metalink。目前支持Mac OS 和 Windows 平台。可以直接使用基于 RPC 协议的 aria2 插件。
[repo owner=”alanzhangzm” name=”Photon”])
------------------------------------------------------

利用VPS打造 无限空间在线播放离线网盘(Debian/Ubuntu)
近两天一直都在折腾VPS挂载谷歌云盘打造无限容量的。虽然说网上各类教程非常多,但是要做到全套开机自启,自动上传,自动更新还是有些麻烦的。
本次教程全套组件为:Lnmp+Aria2+Rclone+DirectoryLister+Aria2Ng
本篇博文是利用
Vultr Ubuntu 16 X64
做的搭建实例,首先感谢Rats
提供VPS作为示范。由于Linux系统的多样性,不保证按照此教程搭建一定成功。准备工作
- 一个域名:本篇教程使用的域名为
aria2down.tk
使用时请自行将aria2down.tk
更换为自己的域名 - 一个VPS:要求KVM 1核 512M内存以上,硬盘空间建议50G以上(由于是先下载到VPS再上传到谷歌云盘里,所以硬盘限制了单次能下载文件的最大大小)。
- 谷歌云盘账号:需要一个无限容量的谷歌云盘账号。如果没有请自寻购买(价格大概15-20元)。
需要的东西并不多,其中域名为可选项。
搭建网站环境
由于这次教程中Aria2Ng和DirectoryLister需要nginx和php的支持,所以我们先来安装Lnmp。这里推荐我一直使用的一键包Oneinstack
apt-get update
apt-get -y install wget screen curl python zip unzip sudo vim
#由于shell的局限性,请先复制上方内容执行完再复制下方执行
wget http://mirrors.linuxeye.com/oneinstack.tar.gz
tar xzf oneinstack.tar.gz && rm -f oneinstack.tar.gz
cd oneinstack
screen -S oneinstack
./install.sh
交互记录
Please input SSH port(Default: 22): #回车
Do you want to enable iptables? [y/n]: n
Do you want to install Web server? [y/n]: y
Please select Nginx server:
1. Install Nginx
2. Install Tengine
3. Install OpenResty
4. Do not install
Please input a number:(Default 1 press Enter) #回车
Please select Apache server:
1. Install Apache-2.4
2. Install Apache-2.2
3. Do not install
Please input a number:(Default 3 press Enter) #回车
Please select tomcat server:
1. Install Tomcat-8
2. Install Tomcat-7
3. Install Tomcat-6
4. Do not install
Please input a number:(Default 4 press Enter) #回车
Do you want to install Database? [y/n]: n
Do you want to install PHP? [y/n]: y
Please select a version of the PHP:
1. Install php-5.3
2. Install php-5.4
3. Install php-5.5
4. Install php-5.6
5. Install php-7.0
6. Install php-7.1
7. Install php-7.2
Please input a number:(Default 5 press Enter) #回车
Do you want to install opcode cache of the PHP? [y/n]: y
Please select a opcode cache of the PHP:
1. Install Zend OPcache
3. Install APCU
Please input a number:(Default 1 press Enter) #回车
Do you want to install ionCube? [y/n]: n
Do you want to install ImageMagick or GraphicsMagick? [y/n]: n
Do you want to install Pure-FTPd? [y/n]: n
Do you want to install phpMyAdmin? [y/n]: n
Do you want to install redis? [y/n]: n
Do you want to install memcached? [y/n]: n
Do you want to install HHVM? [y/n]: n
然后脚本就开始自动安装nginx和php环境了
这段时间我们可以用来设置域名的绑定,本篇教程是将Aria2Ng的域名定为
aria2down.com
,DirectoryLister设置为www.aria2down.com
。
Oneinstack安装速度很快,大概一顿饭的功夫就能安装完毕。
Please restart the server and see if the services start up fine.
Do you want to restart OS ? [y/n]: y
看到如下字样,输入
y
重启即可。添加站点程序
我们先不慌部署aria2,先把网站程序上传上去。使用oneinstack创建站点。
首先创建的是Aria2Ng的站点
首先创建的是Aria2Ng的站点
cd /root/oneinstack
./vhost.sh
交互记录
#######################################################################
# OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+ #
# For more information please visit https://oneinstack.com #
#######################################################################
What Are You Doing?
1. Use HTTP Only
2. Use your own SSL Certificate and Key
3. Use Let's Encrypt to Create SSL Certificate and Key
q. Exit
Please input the correct option: 1
Please input domain(example: www.example.com): aria2down.tk
domain=aria2down.tk
Please input the directory for the domain:aria2down.tk :#回车
(Default directory: /data/wwwroot/aria2down.tk):
Virtual Host Directory=/data/wwwroot/aria2down.tk
Create Virtul Host directory......
set permissions of Virtual Host directory......
Do you want to add more domain name? [y/n]: n
Do you want to add hotlink protection? [y/n]: n
Allow Rewrite rule? [y/n]: n
Allow Nginx/Tengine/OpenResty access_log? [y/n]: n
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......
#######################################################################
# OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+ #
# For more information please visit https://oneinstack.com #
#######################################################################
Your domain: aria2down.tk
Virtualhost conf: /usr/local/nginx/conf/vhost/aria2down.tk.conf
Directory of: /data/wwwroot/aria2down.tk
大家将
aria2down.tk
更换成自己的域名即可,接下来是上传站点程序。cd /data/wwwroot/aria2down.tk
wget "https://github.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/raw/master/website/Aria2Ng.zip"
unzip Aria2Ng.zip && rm -f Aria2Ng.zip
现在我们就可以尝试打开自己域名看看能不能访问Aria2Ng.
接下来部署DirectoryLister
cd /root/oneinstack
./vhost.sh
交互记录
#######################################################################
# OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+ #
# For more information please visit https://oneinstack.com #
#######################################################################
What Are You Doing?
1. Use HTTP Only
2. Use your own SSL Certificate and Key
3. Use Let's Encrypt to Create SSL Certificate and Key
q. Exit
Please input the correct option: 1
Please input domain(example: www.example.com): www.aria2down.tk
domain=www.aria2down.tk
Please input the directory for the domain:www.aria2down.tk :
(Default directory: /data/wwwroot/www.aria2down.tk):
Virtual Host Directory=/data/wwwroot/www.aria2down.tk
Create Virtul Host directory......
set permissions of Virtual Host directory......
Do you want to add more domain name? [y/n]: n
Do you want to add hotlink protection? [y/n]: n
Allow Rewrite rule? [y/n]: n
Allow Nginx/Tengine/OpenResty access_log? [y/n]: n
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......
#######################################################################
# OneinStack for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+ #
# For more information please visit https://oneinstack.com #
#######################################################################
Your domain: www.aria2down.tk
Virtualhost conf: /usr/local/nginx/conf/vhost/www.aria2down.tk.conf
Directory of: /data/wwwroot/www.aria2down.tk
大家将
www.aria2down.tk
更换成自己的域名即可,接下来是上传站点程序。cd /data/wwwroot/www.aria2down.tk
wget "https://github.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/raw/master/website/DirectoryLister.zip"
unzip DirectoryLister.zip && rm -f DirectoryLister.zip
mkdir Download
mkdir Cloud
现在我们就可以尝试打开自己域名看看能不能访问DirectoryLister.
如果需要更改版权请去resources/themes/bootstrap更改。
教程到这里,前端已经部署完毕,接下来是后端的部署。
编译安装Aria2
在这里我推荐大家使用编译来安装
aria2
,虽然耗时比较久,但是不容易出错。在编译之前,先要安装GCC-4.9
。由于安装BBR魔改版自动把GCC4.9安装上了,BBR加速也很有用。
编译安装
wget https://github.com/aria2/aria2/releases/download/release-1.33.1/aria2-1.33.1.tar.gz
tar xzvf aria2-1.33.1.tar.gz
cd aria2-1.33.1
./configure
make
make install
编译过程有些慢,大概需要10-15分钟。大家可以喝口水等等。编译完成后我们可以输入aria2c
测试是否可以运行。
接下来开始配置aria2的配置文件
mkdir "/root/.aria2" && cd "/root/.aria2"
wget "https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/aria2.conf"
wget "https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/autoupload.sh"
wget "https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/dht.dat"
wget "https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/trackers-list-aria2.sh"
echo '' > /root/.aria2/aria2.session
chmod +x /root/.aria2/trackers-list-aria2.sh
chmod +x /root/.aria2/autoupload.sh
chmod 777 /root/.aria2/aria2.session
wget --no-check-certificate https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/aria2 -O /etc/init.d/aria2
chmod +x /etc/init.d/aria2
update-rc.d -f aria2 defaults
有两个配置文件需要修改,我们先修改aria2.conf。aria2.conf为aria2的配置文件。
输入命令
输入命令
vim aria2.conf
,按i
进行编辑## 用户必改项 ##
# 文件的保存路径(可使用绝对路径或相对路径), 默认: 当前启动位置
dir=
# 设置的RPC授权令牌, v1.18.4新增功能, 取代 --rpc-user 和 --rpc-passwd 选项
rpc-secret=
dir
为下载目录。在这里,我设置为/data/wwwroot/www.aria2down.tk/Download
rpc-secret
为访问秘钥,是Aria2Ng连接Aria2唯一的验证。输入自己记得的密码即可。
输入完后按
esc
,输入:wq
保存文件。autoupload.sh
是下载文件后自动将下载文件移动到挂载目录下的脚本。我们暂时不进行配置,等到rclone时再进行配置。我们先配置trackers-list-aria2.sh
脚本。trackers-list-aria2.sh
脚本是自动更新bt下载的trackers服务器的脚本。我们并不需要修改脚本内容,只需要把它添加进入计划任务。输入crontab -e
进入任务计划管理.
编辑方法与vim相同,将以下两句添加进去。
0 3 */7 * * /root/.aria2/trackers-list-aria2.sh
*/5 * * * * /usr/sbin/service aria2 start
保存后aria2即配置完毕,我们输入
启动成功时我们即可看到以下配置信息:bash /etc/init.d/aria2 start
启动aria2。
挂载谷歌云盘
一般VPS的硬盘是不够我们用过瘾的。所以我们可以挂载无限空间的谷歌云盘来爽一把。
cd /root
wget https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/rclone_debian.sh && bash rclone_debian.sh
rm -f rclone_debian.sh
rclone config
交互信息
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> aria2down #随便填,后面要用到
Type of storage to configure.
Choose a number from below, or type in your own value
1 / Alias for a existing remote
\ "alias"
2 / Amazon Drive
\ "amazon cloud drive"
3 / Amazon S3 (also Dreamhost, Ceph, Minio, IBM COS)
\ "s3"
4 / Backblaze B2
\ "b2"
5 / Box
\ "box"
6 / Cache a remote
\ "cache"
7 / Dropbox
\ "dropbox"
8 / Encrypt/Decrypt a remote
\ "crypt"
9 / FTP Connection
\ "ftp"
10 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
11 / Google Drive
\ "drive"
12 / Hubic
\ "hubic"
13 / Local Disk
\ "local"
14 / Microsoft Azure Blob Storage
\ "azureblob"
15 / Microsoft OneDrive
\ "onedrive"
16 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
17 / Pcloud
\ "pcloud"
18 / QingCloud Object Storage
\ "qingstor"
19 / SSH/SFTP Connection
\ "sftp"
20 / Webdav
\ "webdav"
21 / Yandex Disk
\ "yandex"
22 / http Connection
\ "http"
Storage> 11 #选择11
Google Application Client Id - leave blank normally.
client_id> #留空
Google Application Client Secret - leave blank normally.
client_secret> #留空
Scope that rclone should use when requesting access from drive.
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 #选择1
ID of the root folder - leave blank normally. Fill in to access "Computers" folders. (see docs).
root_folder_id> #留空
Service Account Credentials JSON file path - leave blank normally.
Needed only if you want use SA instead of interactive login.
service_account_file> #留空
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine or Y didn't work
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/oauth2/auth.... #复制到浏览器打开,获取验证码
Log in and authorize rclone for access
Enter verification code> #填入上面获取到的验证码
Configure this as a team drive?
y) Yes
n) No
y/n> y #选择y
Fetching team drive list...
No team drives found in your account--------------------
[Rats]
client_id =
client_secret =
service_account_file =
token = {"access_token":"ya29.GltFBd7UJN2qrxdG8FnG_rMuB18ogb8QlujdL7glvXtfV"}
team_drive =
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y #选择y
Current remotes:
Name Type
==== ====
aria2down drive
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 #选择q退出
退出后我们来设置下
rclone
的自启动脚本。wget https://raw.githubusercontent.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng/master/sh/rcloned
vim rcloned
我们要修改以下内容
NAME="" #rclone name名
REMOTE='' #远程文件夹
LOCAL='' #挂载地址
NAME 即是刚刚rclone配置是输入的name
。这里我填写的是aria2down
。
REMOTE 填写的是谷歌云盘中文件夹的名称,我在云盘里新建了一个chikage的文件夹,所以这里填写的就是chikage
。
LOCAL 填写挂载在vps中位置的地址,在这里我填写的是/data/wwwroot/www.aria2down.tk/Cloud
输入完成后保存。我们将其设置自启,并尝试启动。
mv rcloned /etc/init.d/rcloned
chmod +x /etc/init.d/rcloned
update-rc.d -f rcloned defaults
bash /etc/init.d/rcloned start
最后我们配置下
autoupload.sh
,输入vim /root/.aria2/autoupload.sh
downloadpath='' #下载目录
rclone='' #rclone挂载的目录
downloadpath 为之前在aria2.confdir
的值。
rclone 为刚刚填入rclonedLOCAL
的值
保存后即完成了全套离线下载方案的部署。
结束语
这个教程编写大概耗了我一天的时间,其中的绝大多数脚本由自己编写并调试,在这过程中也遇到许多问题。希望我这篇教程能给你带来帮助.
脚本地址:https://github.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng
脚本地址:https://github.com/chiakge/Aria2-Rclone-DirectoryLister-Aria2Ng
No comments:
Post a Comment