准备工作

  • 云阀 5R NAT小鸡
  • Google Drive 账号一枚
  • CloudFlare 账号

关于云阀的小鸡,性价比高,只提供ipv6和ipv4端口,因此下面的教程可能某些地方做了多余的动作,例如修改端口号等

安装Aria2一键脚本

执行下面的命令

1
wget -N git.io/aria2.sh && chmod +x aria2.sh && ./aria2.sh

进入下载脚本的目录运行脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
./aria2.sh

Aria2 一键安装管理脚本 [vX.X.X]
-- P3TERX.COM --

1. 升级脚本
————————————
1. 安装 Aria2
2. 更新 Aria2
3. 卸载 Aria2
————————————
4. 启动 Aria2
5. 停止 Aria2
6. 重启 Aria2
————————————
7. 修改 配置
8. 查看 配置
9. 查看 日志
10. 清空 日志
————————————
11. 手动更新 BT-Tracker
12. 自动更新 BT-Tracker
————————————

当前状态: 已安装 并 已启动

请输入数字 [0-12]:

输入 1 回车

1.png
1.png

等待安装完成 再执行
1
./aria2.sh

输入 7 回车

2.png
2.png

如需要可修改 RPC 密码,也建议修改

安装 LNMP 一键安装包 / Nginx

我这里安装LNMP,其实只需要 Nginx就行了
安装教程参考 安装 - LNMP一键安装包

或者 直接执行

1
wget http://soft.vpser.net/lnmp/lnmp1.6.tar.gz -cO lnmp1.6.tar.gz && tar zxf lnmp1.6.tar.gz && cd lnmp1.6 && ./install.sh lnmp

我这里安装的是 1.6 ,可自行修改版本号

安装 Aria2NG 界面管理

打开地址 Releases · mayswind/AriaNg
选择最新版本下载到 网站 目录下,如果不知道网站目录配置,建议存放在 LNMP的默认目录 /home/wwwroot/

按照如下操作

1
2
3
4
5
mkdir /home/wwwroot/X
cd /home/wwwroot/X
wget https://github.com/mayswind/AriaNg/releases/download/1.1.4/AriaNg-1.1.4.zip
unzip AriaNg-1.1.4.zip
rm AriaNg-1.1.4.zip

配置 Nginx

1
2
cd /usr/local/nginx/conf/vhost/
vi X.conf

输入以下配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
server
{
listen 10002 default_server reuseport;
#listen [::]:80 default_server ipv6only=on;
server_name _;
index index.html index.htm index.php;
root /home/wwwroot/x;

#error_page 404 /404.html;

# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

include enable-php.conf;

location /nginx_status
{
stub_status on;
access_log off;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}

location ~ /.well-known {
allow all;
}

location ~ /\.
{
deny all;
}

access_log /home/wwwlogs/access.log;
}

主要就是把端口改为 10002,其他的就是lnmp默认配置不动

配置完毕后,打开 网址 http://virt-nat-eu-1.cloudraft.cn:1XXX5
将XX替换成你的 内网IP最后一位 例如 2 则访问 http://virt-nat-eu-1.cloudraft.cn:10025

3.png
3.png

点击 Aria2NG配置 - RPC(XXXX)

4.png
4.png

修改 RPC 别名 RPC 地址 RPC 秘钥
其他不动,按图填写即可

免费申请一个Google无限团队盘

打开地址 创建Google TeamDrive
Gmail必须填写正确!

等待创建即可!

安装Rclone

执行

1
2
curl https://rclone.org/install.sh | sudo bash
rclone config

配置说明如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
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> n # 选择n,新建
name> Google # 输入名称,类似于标签,用于区分不同的网盘。
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 / A stackable unification remote, which can appear to merge the contents of several remotes
\ "union"
2 / Alias for a existing remote
\ "alias"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Dropbox
\ "dropbox"
9 / Encrypt/Decrypt a remote
\ "crypt"
10 / FTP Connection
\ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
12 / Google Drive
\ "drive"
13 / Hubic
\ "hubic"
14 / JottaCloud
\ "jottacloud"
15 / Local Disk
\ "local"
16 / Mega
\ "mega"
17 / Microsoft Azure Blob Storage
\ "azureblob"
18 / Microsoft OneDrive
\ "onedrive"
19 / OpenDrive
\ "opendrive"
20 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
21 / Pcloud
\ "pcloud"
22 / QingCloud Object Storage
\ "qingstor"
23 / SSH/SFTP Connection
\ "sftp"
24 / Webdav
\ "webdav"
25 / Yandex Disk
\ "yandex"
26 / http Connection
\ "http"
Storage> 12 # 选择12,Google Drive
** See help for drive backend at: https://rclone.org/drive/ **

Google Application Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> # 留空,回车
Google Application Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
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
ID of the root folder
Leave blank normally.
Fill in to access "Computers" folders. (see docs).
Enter a string value. Press Enter for the default ("").
root_folder_id> # 留空,回车
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Enter a string value. Press Enter for the default ("").
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 or Y didn't work
y) Yes
n) No
y/n> n
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXXXXXXX.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=XXXXXXXXXXXXXXXXXXXX
Log in and authorize rclone for access # 会弹出浏览器,要求你登录账号进行授权。如果没有弹出,复制上面的链接到浏览器中打开进行授权。
Enter verification code> # 在这里输入网页上显示的验证码

Configure this as a team drive?
y) Yes
n) No
y/n> y
Fetching team drive list...
No team drives found in your account--------------------
[Google]
type = drive
scope = drive
token = {"access_token":"XXXXXXXXXXXXXXXXXXXXX"}
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name Type
==== ====
Google drive
One onedrive

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

参考:P3TERX - Rclone 安装配置教程 - 连接 OneDrive 和 Google Drive

配置 Aira2 自动上传

执行 按图修改

1
vi /root/.aria2/autoupload.sh

5.png
5.png

执行 按图修改

1
vi /root/.aria2/aria2.conf

6.png
6.png

重启 Aria2

1
service aria2 restart

使用Goindex + CloudFlare搞一个在线观看

官方说明 donwa/Github

复制 index.js 里面的代码

打开 CloudFlare ,创建Workers

7.png
7.png

将上面复制的内容黏贴到Script中

执行 并 查看 rclone.conf 路径。

1
rclone config file

8.png
8.png

复制 root_folder_id 和 refresh_token 的值填入 CloudFlare Workers Script对应的代码位置里面

9.png
9.png

配置好后点击保存,然后打开CloudFlare Workers提供的域名即可看到对应的网盘内容

作者博客 风向标博客