Rat's

Aria2+Rclone+DirectoryLister+Aria2Ng一键安装脚本 for Debian
说明:之前发了个VPS结合Google Drive建立BT离线大网盘教程,参考:利用Aria2+AriaNg+H5...
扫描右侧二维码阅读全文
20
2018/02

Aria2+Rclone+DirectoryLister+Aria2Ng一键安装脚本 for Debian

说明:之前发了个VPS结合Google Drive建立BT离线大网盘教程,参考:利用Aria2+AriaNg+H5ai+Google Drive建立离线BT下载/在线播放/无限空间网盘,鉴于很多小白还是不会,加上H5ai有点浪费流量和api,所以友链博主千影写了个一键脚本,使用更好的DirectoryLister替代了H5ai,并自动添加SSL免费证书,Aria2Ng由于使用SSL后影响面板操作,就单独分开了,所以本脚本需要2个域名,并且下载文件自动上传到Google Drive,重启后自动挂载,添加并自动更新Trackers服务器,期间不需要做任何操作,这里分享下脚本。

截图

请输入图片描述
请输入图片描述
请输入图片描述

更新

【2018.12.21】
优化定时任务步骤,最后不再显示定时任务编辑界面。

【2018.8.17】
修复Aria2无法自动更新Trackers服务器的Bug,并优化脚本步骤信息的提示。

脚本

本脚本适用于Debian 8、9。且需要提前使用2个二级域名解析到VPS服务器。

使用命令:

wget https://www.moerats.com/usr/shell/Aria2_Rc_D.sh && bash Aria2_Rc_D.sh

运行脚本后,会依次要你输入以下信息:

#输入网盘域名及Aria2NG面板域名
请输入你的DirectoryLister域名信息:
请输入你的Aria2NG域名信息:

#设置Aria2密钥
请输入你的Aria2密钥:

#配置Rclone,大致如下
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> Rats  #随便填,后面要用到
Type of storage to configure.
Choose a number from below, or type in your own value
 1 / Amazon Drive
   \ "amazon cloud drive"
 2 / Amazon S3 (also Dreamhost, Ceph, Minio)
   \ "s3"
 3 / Backblaze B2
   \ "b2"
 4 / Box
   \ "box"
 5 / Cache a remote
   \ "cache"
 6 / Dropbox
   \ "dropbox"
 7 / Encrypt/Decrypt a remote
   \ "crypt"
 8 / FTP Connection
   \ "ftp"
 9 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
10 / Google Drive
   \ "drive"
11 / Hubic
   \ "hubic"
12 / Local Disk
   \ "local"
13 / Microsoft Azure Blob Storage
   \ "azureblob"
14 / Microsoft OneDrive
   \ "onedrive"
15 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
16 / Pcloud
   \ "pcloud"
17 / QingCloud Object Storage
   \ "qingstor"
18 / SSH/SFTP Connection
   \ "sftp"
19 / Webdav
   \ "webdav"
20 / Yandex Disk
   \ "yandex"
21 / http Connection
   \ "http"
Storage> 10  #选择10,Google Drive,注意该序列号会随时变化,看清楚再填
Google Application Client Id - leave blank normally.
client_id>  #留空 
Google Application Client Secret - leave blank normally.
client_secret>  #留空
Service Account Credentials JSON file path - 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
====                 ====
Rats                 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退出

#最后输入Name
请输入你刚刚输入的Name:

然后脚本安装完成后,就可以直接通过Aria2Ng面板连接Aria2下载文件,并通过网盘观看了。

相关目录

Aria2下载目录:/root/Download
DirectoryLister目录:/home/wwwroot/a.xx.com
Aria2Ng目录:/home/wwwroot/b.xx.com
挂载目录:/home/wwwroot/a.xx.com/Cloud

千影大佬博客:https://www.94ish.me,欢迎去参观。

Vultr新用户注册送100美元/16个机房按小时计费,支持支付宝,【点击查看】。
最后修改:2020 年 04 月 29 日 01 : 01 PM

发表评论 取消回复

425 条评论

  1. lrli

    W: Duplicate sources.list entry http://packages.dotdeb.org/ jessie/all amd64 Packages (/var/lib/apt/lists/packages.dotdeb.org_dists_jessie_all_binary-amd64_Packages)
    W: You may want to run apt-get update to correct these problems
    Reading package lists... Done
    Building dependency tree
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    [Error] nginx 安装失败

    1. Rat's
      @lrli

      升下级看看,apt-get update -y

      1. lrli
        @Rat's

        博主,aria2配置文件能修改吗?路径在哪?

      2. lrli
        @Rat's

        谢谢博主教程,已经连接好并可以自动上传到Google drive。

      3. lrli
        @Rat's

        已经安装好了!但连接不上aria2。

  2. AiharaMei

    打开aria2 弹出来aria2认证失败

    1. Rat's
      @AiharaMei

      能链接不。

      1. AiharaMei
        @Rat's

        显示未连接 但是aria2是启动着的

        1. AiharaMei
          @AiharaMei

          重启aria2 RPC也不行0 0

          1. Rat's
            @AiharaMei

            以前我好像也遇到过,不过不影响链接,你配置填对了没。

            1. AiharaMei
              @Rat's

              昨天的致命失误是秘钥里面o打成了0 在看aria2的配置的时候检查了好几遍才发现的。。。

              1. Rat's
                @AiharaMei

                对的,一般不影响使用的。除非配置填错了。

  3. 39397759

    [Wed Mar 14 17:22:04 EDT 2018] Sign failed: "detail":"Error creating new cert :: too many certificates already issued for exact set of domains: pan.a521.vip: see https://letsencrypt.org/docs/rate-limits/"
    [Wed Mar 14 17:22:04 EDT 2018] Please add '--debug' or '--log' to check more details.
    [Wed Mar 14 17:22:04 EDT 2018] See: https://github.com/Neilpang/acme.sh/wiki/How-to-debug-acme.sh
    [Error] SSL 证书生成失败
    大佬,这个怎么破

    1. Rat's
      @39397759

      学会用翻译,提示你的域名签发次数过多。

      1. 39397759
        @Rat's

        谢谢,有办法解决吗

        1. Rat's
          @39397759

          等几天,或者换域名,或者不要ssl。

          1. 39397759
            @Rat's

            怎么不要ssl,跳过这一步呢。。

            1. Rat's
              @39397759

              有选项,比如只安装h5ai,或者用另外一个脚本,支持系统多些,查看:https://www.moerats.com/archives/460/。

  4. 深夜诗人

    博主您好,我按照你的方法安装了,但是去ariang的界面的时候,提示认证错误,这个怎么办?

    1. Rat's
      @深夜诗人

      认证错误先不管,你看看连不连的上。

      1. 深夜诗人
        @Rat's

        [Sat Mar 10 09:17:15 EST 2018] Getting new-authz for domain='pan.lecd.win'
        [Sat Mar 10 09:17:15 EST 2018] The new-authz request is ok.
        [Sat Mar 10 09:17:15 EST 2018] Verifying:pan.lecd.win
        [Sat Mar 10 09:17:15 EST 2018] Standalone mode server
        [Sat Mar 10 09:17:18 EST 2018] Success
        [Sat Mar 10 09:17:18 EST 2018] Verify finished, start to sign.
        [Sat Mar 10 09:17:19 EST 2018] Sign failed: "detail":"Error creating new cert :: too many certificates already issued for exact set of domains: pan.lecd.win: see https://letsencrypt.org/docs/rate-limits/"
        [Sat Mar 10 09:17:19 EST 2018] Please add '--debug' or '--log' to check more details.
        [Sat Mar 10 09:17:19 EST 2018] See: https://github.com/Neilpang/acme.sh/wiki/How-to-debug-acme.sh
        [Error] SSL 证书生成失败

      2. 深夜诗人
        @Rat's

        可以了,我重装系统以后就不行了,提示SSL证书生成失败,我再试试能不能成

        1. Rat's
          @深夜诗人

          试再多次也是失败,你这域名签发次数过多,等一个星期再签,或者换一个二级域名试试。

          1. 深夜诗人
            @Rat's

            at Mar 10 22:26:05 EST 2018] pan.ioip.top:Verify error:DNS problem: NXDOMAIN looking up A for pan.ioip.top
            [Sat Mar 10 22:26:05 EST 2018] Please add '--debug' or '--log' to check more details.
            [Sat Mar 10 22:26:05 EST 2018] See: https://github.com/Neilpang/acme.sh/wiki/How-to-debug-acme.sh
            [Error] SSL 证书生成失败
            我换了个域名试了下,也还是不行,可不可以提供个没有ssl的脚本呢?

            1. Rat's
              @深夜诗人

              这是DNS问题,解析域名还没生效。

          2. 深夜诗人
            @Rat's

            哇,悲伤了....谢谢大佬解惑了

  5. Randell

    博主你好!新开的Debian9,do的,显示以下错误!求助

    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    nginx : Depends: nginx-full (>= 1.12.2-1~dotdeb+8.1) but it is not going to be installed or

    nginx-light (>= 1.12.2-1~dotdeb+8.1) but it is not going to be installed or nginx-extras (>= 1.12.2-1~dotdeb+8.1) but it is not going to be installed Depends: nginx-full (< 1.12.2-1~dotdeb+8.1.1~) but it is not going to be installed or nginx-light (< 1.12.2-1~dotdeb+8.1.1~) but it is not going to be installed or nginx-extras (< 1.12.2-1~dotdeb+8.1.1~) but it is not going to be installed

    E: Unable to correct problems, you have held broken packages.
    [Error] nginx 安装失败

    1. Rat's
      @Randell

      换Debian 8系统就可以了。

      1. Randell
        @Rat's

        你好,成功安装了!可是我找不到Aria2Ng的面板。我试着访问dl.一级域名和pan.一级域名,发现返回的都是“就是爱云盘的界面”。直接访问ip也不行。我是个小白实在不知道哪里出问题了。

        rcloned 100%[====>] 2.00K --.-KB/s in 0s

        2018-03-08 15:34:54 (26.4 MB/s) - ‘rcloned’ saved [2043/2043]

        请选择VIM编辑后输入:wq保存

        Select an editor. To change later, run 'select-editor'.

        /bin/nano <---- easiest/usr/bin/vim.basic/usr/bin/vim.tiny

        Choose 1-3 [1]: 3
        No modification made

        Aria2 简单配置信息:

        地址 : *
        端口 : 6800
        密码 : *
        目录 : /root/Download

        [信息] Aria2 启动成功 !
        [信息] rclone 启动成功 !

        1. Rat's
          @Randell

          使用你自己的二级域名,不是脚本给的示例域名。你先解析两个二级域名到VPS上再操作。

          1. oacer
            @Rat's

            我也是遇到同样的问题
            域名都已经解析了吧,还是说都不知道怎么解析?
            就是A记录a和b都回源同一个服务器IP地址
            然后就是上述问题了
            还是说ARIANG不能使用https?我IP被墙了用CDN苟命只能开HTTPS了

  6. Milo

    网盘没问题,aria2ng那个网址总提示我您的连接不是私密连接(Chrome浏览器PC端),手机没事。

    1. Rat's
      @Milo

      谷歌浏览器只要不是ssl,都是不安全。

  7. 玹狸

    不支持centos7吧。

    1. Rat's
      @玹狸

      不支持,Centos手动安装也是挺快的。

  8. Runner

    请问需要纯净的系统要绑定google账号吗?

    1. Rat's
      @Runner

      配置rclone的时候,在浏览器登录网盘授权下就可以了。

      1. Runner
        @Rat's

        谢谢大佬安装成功,想问下我可以使用军哥版的LNMP1.5虚拟主机安装这个脚本吗,另外该怎么给ariaNG的域名加ssl吗。

        1. Rat's
          @Runner

          用lnmp的话,不能直接使用脚本,H5ai需要单独装,参考:https://www.moerats.com/archives/121/,然后其余步骤参考:https://www.moerats.com/archives/509/,从第二步开始。军哥lnmp可以自动添加免费ssl,和建站一样,你自己折腾下吧。

          1. Runner
            @Rat's

            懂了哈哈,非常感谢大佬这么详细的解答

            1. Rat's
              @Runner

              多研究下,随机应变,只要知道挂载的方法就行。

              1. Runner
                @Rat's

                好的谢谢大佬~

  9. 吴尼玛

    mjj来支持大佬。

    1. Rat's
      @吴尼玛

      谢谢支持,我是菜鸡。