Rat's

Aria2+Caddy+Rclone+GDlist+Aria2Ng+Google Drive一键安装脚本
说明:之前发过一个与本脚本类似的教程,参考:Aria2+Rclone+DirectoryLister+Aria2N...
扫描右侧二维码阅读全文
20
2018/04

Aria2+Caddy+Rclone+GDlist+Aria2Ng+Google Drive一键安装脚本

说明:之前发过一个与本脚本类似的教程,参考:Aria2+Rclone+DirectoryLister+Aria2Ng一键安装脚本,而前天有大佬发布了GDlist后,其不走服务器流量的特点还是挺不错的,毕竟很多人流量都有限,于是友链博主千影将DirectoryLister替换成了GDlistNginx环境换成了Caddy,本脚本同样的支持下载后自动上传,自动签发SSL证书,添加并自动更新Trackers服务器等特点。

截图

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

更新

【2019.1.9】
去掉Aria2ng的域名,改为ip:8000访问
【2018.12.27】
调整caddy配置,修复启动失败的问题
【2018.12.21】
优化定时任务步骤,最后不再显示定时任务编辑界面。
【2018年4月26日】
下载上传以后会自动刷新gdlist的缓存

安装

本脚本适用于Debian 8 +Ubuntu 16+。建议使用Debian 8。且需要提前将域名解析到VPS服务器。

使用命令:

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

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

#输入GDlist域名
请输入你的GDlist域名信息:

#设置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 / 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 Drive,注意该序列号会随时变化,看清楚再填
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://xx  #复制到浏览器获取验证码
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]
type = drive
client_id = 
client_secret = 
scope = drive.readonly
root_folder_id = 
service_account_file = 
token = {"access_token":""}
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:
请输入你云盘中需要挂载的文件夹:

然后打开GDlist的域名界面,填写挂载的文件夹和文件夹ID,记住填写的文件夹需要共享出来,不然会遇到错误。
请输入图片描述
文件下载成功后,请去GDlist后台,更新下缓存可以及时看到下载的文件。

最后Aria2ng的访问地址为ip:8000,然后填上密匙即可下载文件。

总结

GDlist虽然不需要消耗服务器流量,但我们需要翻Q才能观看和下载,如果服务器流量足够,又不想翻Q的,建议使用文章开头的那个教程,使用DirectoryLister观看。

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

发表评论 取消回复

140 条评论

  1. yamibox

    您好博主,caddy的日志如下
    root@instance-2:~/sharelist# tail -f /tmp/caddy.log
    2020/03/22 12:49:16 [ERROR 502 /] dial tcp 35.200.28.214:33001: connect: connection refused
    2020/03/22 12:49:17 [ERROR 502 /] dial tcp 35.200.28.214:33001: connect: connection refused
    2020/03/22 12:49:17 [ERROR 502 /] dial tcp 35.200.28.214:33001: connect: connection refused
    2020/03/22 12:49:17 [ERROR 502 /1] dial tcp 35.200.28.214:33001: connect: connection refused
    按照您给的解决方法后
    root@instance-2:~/sharelist# cd /root/sharelist && pm2 start app.js
    [PM2] Applying action restartProcessId on app app
    [PM2] app ✓
    [PM2] Process successfully started
    提示如上,但是caddy的日志还是一样,请问是哪里除了问题吗(33001端口也已经开启)
    对google drive挂载的文件夹也需要进行什么设置吗》

    1. Rat's
      @yamibox

      看是不是程序没装好,你试试这个命令curl 127.0.0.1:33001,看有返回不

      1. kevin
        @Rat's

        curl: (7) Failed to connect to 127.0.0.1 port 33001: Connection refused

        1. Rat's
          @kevin

          那估计没安装好,pm2 log可以看下日志有没有报错什么的

  2. taetae

    现在的gdlist 界面 变成sharelist界面 ,我安装的时候配置rclone 是google盘,我现在不知道怎么填写 下面这个 33001 界面 的东西,虚拟路径不知道怎么填写,求指点

    1. sharelist
      @taetae

      有两种挂载方式:

      GoogleDriveAPI,路径那填写 【//应用ID/root?client_secret=应用机钥&redirect_uri=回调地址&refresh_token=refresh_token】,不包括【】。GoogleDrive,填写分享的文件/文件夹id。

      由于google的限制,以上两种方式,目前都需要通过服务器中转。

    2. Rat's
      @taetae

      对,是改名了,具体我也不清楚了,你看下这个文章,https://www.moerats.com/archives/593/,看能不能找到灵感

      1. taetae
        @Rat's

        点错了,然后就不行了。

  3. 厉害,膜拜大神

    没有出现14之前的选项了,博主看看什么情况?
    14 / Google Photos
    "google photos"
    15 / Hubic
    "hubic"
    16 / JottaCloud
    "jottacloud"
    17 / Koofr
    "koofr"
    18 / Local Disk
    "local"
    19 / Mail.ru Cloud
    "mailru"
    20 / Mega
    "mega"
    21 / Microsoft Azure Blob Storage
    "azureblob"
    22 / Microsoft OneDrive
    "onedrive"
    23 / OpenDrive
    "opendrive"
    24 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
    "swift"
    25 / Pcloud
    "pcloud"
    26 / Put.io
    "putio"
    27 / QingCloud Object Storage
    "qingstor"
    28 / SSH/SFTP Connection
    "sftp"
    29 / Transparently chunk/split large files
    "chunker"
    30 / Union merges the contents of several remotes
    "union"
    31 / Webdav
    "webdav"
    32 / Yandex Disk
    "yandex"
    33 / http Connection
    "http"
    34 / premiumize.me
    "premiumizeme"

  4. cyl2009

    大佬,google cloud安装,输入name> Rats,这时,只能看到后14项,后14项,有红有绿,无法选择第11项,求解。谢谢大佬。

    1. Rat's
      @cyl2009

      看是不是姿势不对,一般都是可以看到选项,也可以填的

      1. 厉害,膜拜大神
        @Rat's

        这个情况我也遇到了,不知道什么问题

  5. 小白

    安装没有报错,但是访问 gdlist的时候502 Bad Gateway
    然后打开caddy.log,发现报错 dial tcp 我的ip:33001: connect: connection refused
    请问大佬,有没有遇到过这个问题

    1. Rat's
      @小白

      尴尬,之前程序有变动,我没改脚本启动命令,你使用这个命令就好了,cd /root/sharelist && pm2 start app.js

      1. 小白
        @Rat's

        还是没有成功,算了不搞了,等下次博主更新吧,谢谢博主

  6. jasonbourne

    安装和配置一切顺利,挂载的域名地址和 aria2 地址 ip:8000 都打不开界面,已经开放了6800、8000和33001端口,请问是端口问题吗?我用的 azure

    1. Rat's
      @jasonbourne

      你的意思都打不开?这种如果服务器面板有安全组的话,需要额外打开指定的端口,然后再运行脚本,不然可能会导致ssl签发失败或其它问题,你看下caddy运行状态:tail -f /tmp/caddy.log

      1. jasonbourne
        @Rat's

        一查确实有错误(抱歉我把域名隐去了):
        2019/04/17 18:57:54 [INFO] [name.cf] acme: use tls-alpn-01 solver
        2019/04/17 18:57:54 [INFO] [name.cf] acme: Trying to solve TLS-ALPN-01
        2019/04/17 18:58:08 [name.cf] failed to obtain certificate: acme: Error -> On e or more domains had a problem:
        [name.cf] acme: error: 400 :: urn:ietf:params:acme:error:connection :: Timeou t during connect (likely firewall problem), url:
        Activating privacy features... 2019/04/17 20:25:36 [INFO] [name.cf] acme: Obt aining bundled SAN certificate
        2019/04/17 20:25:36 [INFO] [name.cf] AuthURL: https://acme-v02.api.letsencryp t.org/acme/authz/3vSh5RjWNUIiIsyM8YV7EVsWiD2HCQh7SV_hN5yYFeg
        2019/04/17 20:25:36 [INFO] [name.cf] acme: use tls-alpn-01 solver
        2019/04/17 20:25:36 [INFO] [name.cf] acme: Trying to solve TLS-ALPN-01
        2019/04/17 20:25:43 [name.cf] failed to obtain certificate: acme: Error -> On e or more domains had a problem:
        [name.cf] acme: error: 403 :: urn:ietf:params:acme:error:unauthorized :: Cann ot negotiate ALPN protocol "acme-tls/1" for tls-alpn-01 challenge, url:

        可惜我实在没看懂域名用的是freenom.com免费的,解析是cloudflare 的免费计划,不知道会不会有问题。另外用的azure的vps面板有网络控制功能,我已经开了22、6800、8000、33001,不知道我打开的“额外制订端口”还有缺漏吗?
        感谢回复!

        1. Rat's
          @jasonbourne

          申请域名的时候关掉cf的cdn,这样解析的ip和本机不一样会申请失败。

          1. jasonbourne
            @Rat's

            之前就是因为打不开才用了cloudlare的dns解析,改回去之后还是不行。一气之下去vultr新开了个vps,aria2ng的界面可以打开了,但是gdlist域名显示 502 Bad Gateway,看caddy状态是33001端口有一堆拒绝连接,类似:19/Apr/2019:17:49:48 +0000 [ERROR 502 /favicon.ico] dial tcp x5.7x.5.x01:33001: connect: connection refused

            我自己查了一下用 iptables -I INPUT -p tcp --dport 33001 -j ACCEPT 命令开了33001端口,但还是不行。gd中也把要挂载的文件夹设成“任何人都可以找到和查看了”(不过是在ssh里填完才新建的)。

            另外,我发现rclone配置里选择网盘的一项gd从第11变成第12了,之前我无脑看你给的答案,可能这里也选错了。

            1. Rat's
              @jasonbourne

              对了,我的锅,之前程序改版,导致启动命令变了,我没改过来,所以会显示33001拒绝,解决方法 cd /root/sharelist && pm2 start app.js

              1. jasonbourne
                @Rat's

                搞定了谢谢
                看到gdlist的设置界面也改了,或许你也可以更新一下?

            2. Rat's
              @jasonbourne

              配置文件一般都有变动,不过差异不大,只是参考下。

  7. lll711

    大佬求助呀 部署完打不开。检查下部署中好像报错了。

    An unexpected error occurred: "http://registry.npm.taobao.org/flatmap-stream/download/flatmap-stream-0.1.0.tgz: Request failed "404 Not Found""

    1. Ray Eldath
      @lll711

      似乎是因为这个包已经被npm封了 所以找不到... 我试试重装行不行

    2. lll711
      @lll711

      研究了下 好像是 yarn add pm2 -g 这条有问题了。小白不会弄了。

      1. Rat's
        @lll711

        这是用了淘宝的源么

        1. lll711
          @Rat's

          是的 淘宝源 和官方源都不行。 我网上搜搜好像是 这个模块有恶意代码下架了。

          1. Rat's
            @lll711

            那就不清楚了。

  8. G
    该评论仅登录用户及评论双方可见
    1. Rat's
      @G

      rclone并没有用systemctl,没涉及到挂载,只是调用了rclone命令,等于上传的时候才用rclone。

      1. G
        @Rat's
        该评论仅登录用户及评论双方可见
        1. Rat's
          @G

          我刚改了下脚本,把gdlist源码指向了sharelist最新版,你可以帮忙测试下,看能不能用,一般只要安装方法不变就不用改,基本每次都是安装github的最新版本

          1. G
            @Rat's

            好的,谢谢您了。

  9. 小白

    博主,如果还想用这个域名来访问 AriaNG 配置麻烦吗, 手里有个10年的xyz域名,不用白不用。。。

    1. Rat's
      @小白

      不麻烦,之前有几个不想要域名我就给下了

      1. 小白
        @Rat's

        那如果需要配置域名,博主可以给个配置方法吗。。。

        1. Rat's
          @小白

          编辑/usr/local/caddy/Caddyfile文件,把下面的大括号参数,:8000改成你的域名就行了,然后重启生效

  10. aa

    貌似现在是sharelist了,不知道博主有没有更新?

    1. Rat's
      @aa

      这个不用更新,也就是 改了个名称,git会自动跳转什么的。不影响脚本