• 🎉小站の店正式开业试营运,欢迎大家捧场&反馈
  • 网站所有加密内容密码一律为:920.im;别问为什么,问就是为了活着
  • 订阅小站 TG频道获取更多小福利
  • 欢迎访问小站,如果您觉得本站还不错,请Ctrl+D 收藏本站
  • 请不要催更视频或文章;网站+所有视频制作都是我一人再弄,而且懒;你们多多留言,我可能就会破天荒更新了
  • 任何虚假邮箱的留言评论将一律不通过,你的邮箱不会被公开,请放心留言交流
  • 网站今后如果无法访问,请自行使用代理访问

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Tech CrazyJoe 4年前 (2020-03-01) 4个评论
本文最后更新于2020年11月23日,已超过 1221天没有更新,如文章内容或资源失效,请留言反馈。订阅TG频道获取更多福利

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Before we start | 开始之前

Before we get into today’s tutorial, you will need four things:

在开始今天的教程之前,你需要准备好四样东西:

  1. A Google Account | 一个谷歌账户
  2. A Cloudflare Account | 一个Cloudflare账户
  3. Goindex
  4. Rclone

Which are all free to get, so upon finish this guide, you will have a UNLIMITED storage drive for FREE.

前两个账户都是免费注册,后面2个软件也都是免费的,所以可以真正做到零成本搭建无线空间网盘。

Get an Unlimited Team Drive | 找一个无线空间的团队网盘

你需要一个edu或者商业账户,才能够拥有无限的谷歌云盘空间。获取地址:https://edu.google.com/

Setup google drive with rclone | 使用rclone设置Google Drive

Download rclone here (https://rclone.org/downloads/) | 下载rclone软件
Extract the rclone or rclone.exe binary from the archive | 解压到你想放的目录
Run rclone config to start setup | 运行rclone config命令开始配置

Setup Process | 配置过程

Run CMD on the rclone directory, the type rclone config to start setup process.

首选我们需要在rclone所在的文件夹启动CMD程序,并且输入rclone config开始配置

No remotes found - make a new one
n) New remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
n/r/c/s/q> n
name> remote
Type of storage to configure.
Choose a number from below, or type in your own value

We choose n to create a New remote then type any name you like, when rclone ask us to choose a type of storage, here, we will type 13 to choose Google Drive, as demonstrated in the picture below:

首选我们选择n去创建一个新的配置,并且随便输入一个想要定义的名字,之后rclone会问你需要链接哪个储存,我们输入13去选择Google Drive,如下图所示:

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Google Application Client Id - leave blank normally.
client_id>
Google Application Client Secret - leave blank normally.
client_secret>

Then rclone will ask for your google application client id and secret, you CAN leave it blank to use the default one comes with rclone. But it is highly recommended to set up your own since the default one is shared between all the rclone users and can be low performance. (If you want to leave it blank, just press ENTER)

之后rclone会问你要你的谷歌应用的client id 和 secret,在这里你可以留空,如果留空的话,rclone会默认使用它内置的client id和secret。但是在这里我强烈建议大家用自己的,因为如rclone官网所说,默认的是和所有rclone用户共享的,所以可能表现效果上不会特别好。(如果你想留空,直接按回车键即可)

How to get your own client_id and secret | 如果获取你自己的client id和secret

If you are using default client_id and secret, you can pass this section.

如果你使用的是默认的client id和secret,你可以跳过这一小节

  1. Log into the Google API Console with your Google account. It doesn’t matter what Google account you use. (It need not be the same account as the Google Drive you want to access) | 用你的谷歌账户登录Google API Console
  2. Select a project or create a new project. | 选择一个项目或新建一个项目
  3. Under “ENABLE APIS AND SERVICES” search for “Drive”, and enable the “Google Drive API”. | 在启用API和服务选项下搜索Drive,找到Google Drive并选择开启
  4. Click “Credentials” in the left-side panel (not “Create credentials”, which opens the wizard), then “Create credentials”, then “OAuth client ID”. It will prompt you to set the OAuth consent screen product name, if you haven’t set one already. | 我们选择左侧的”凭据” 并选择创建凭据,之后选择OAuth客户端ID。如果你是第一次使用,它会带你到OAuth同意屏幕,你需要设置一个应用名称并且保存即可
  5. Choose an application type of “other”, and click “Create”. (the default name is fine) | 我们选择应用类型为其它并且选择创建(默认名称是OK的)
  6. It will show you a client ID and client secret. Use these values in rclone config to add a new remote or edit an existing remote. | 之后它会显示你的client id和secret,这两个就是我们需要在rclone里使用的

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Create new project

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Create OAuth client ID

Continue Setup rclone | 继续配置rclone

After you get your client_id and secret, paste it in rclone. The choose scope 1 as requested.

当你得到你自己的client id和secret之后,粘贴到rclone对应的位置内,之后在scope选项,我们输入1回车,给与rclone所有操作文件的权限。

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

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Get Root folder ID | 获取根目录ID

ID of the root folder - leave blank normally. Fill in to access "Computers" folders. (see docs).
root_folder_id>

Since we will not using the default root folder, so we will need to set a root folder ID, you can find your desired root folder id by openning the relevant folder in the drive web interface.

因为我们在这里使用的是团队盘,不是默认的根目录,所以我们需要在rclone里设定好自己需要的根目录,我们可以通过在Google drive网页端打开我们相应的团队盘去获取我们的根目录ID

This will be the last segment of the URL when you open the relevant folder in the drive web interface.

我们的根目录ID即是我们最后一段的URL网址

So if the folder you want rclone to use has a URL which looks like https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh in the browser, then you use 1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh as the root_folder_id in the config.

比如说我们的团队盘在Google drive网页端的网址是 https://drive.google.com/drive/folders/1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh,那么我们的根目录ID就是最后这一段代码1XyfxxxxxxxxxxxxxxxxxxxxxxxxxKHCh

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

After you set up your root folder ID, use the default setting for the next two questions. Then choose Yes for the team drive and select your desired team drive to be indexed. After that, you are all set.

当我们设置好我们的根目录ID之后,接下来的两个问题我们保持默认直接回车即可。之后当rclone询问我们是否将这个配置成团队盘时,我们选择Y确认

Now copy the client_id, client_secret, root_folder_id and refresh_token for the next section.

到这里,我们复制保存好rclone显示的client id,client secret,root folder id和refresh token 这四样东西备用

Change Goindex Config | 更改Goindex设置

First, download index.js file HERE

首选我们在上面的网址中下载好我们的index.js文件

Use any editor you like to open index.js file, and change the client_id, client_secret, root_folder_id and refresh_token with one you just got from rclone.

用任意我们喜欢的编辑器打开我们的index.js文件,之后将client_id, client_secret, root_folder_id, refresh_token四样东西换成我们rclone里复制好的四样

You can also change the site name and root password if you want. (This will be your website name and the password)

你同样也可以更换你的网站名称和根目录密码,如果你需要的话

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Deploy to Cloudflare | 部署到Cloudflare

Open Cloudflare, Login and choose Workers (You need to set up your own subdomain if you use it for the first time, it can’t be changed once setted)

打开Cloudflare,登录并且选择右边的Workers (如果你是第一次使用,你需要设置一个自己想要的子域名,一旦设定不可更改)

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

After you have set up your subdomain, then select create a worker, copy and paste all the content in the index.js file to the workers and change the name if you want.

当你设置好你自己的子域名后,我们选择创建一个Worker,复制并且粘贴所有已经替换好内容的index.js文件内的内容,并且更改好部署名称

How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘

Once you finished, hit save and deploy and go check out your new unlimited storage drive index from the url you just defined.

当你完成后,点击保存并且部署,之后你就可以访问你自己设定好的网址去查看你新建的无线空间网盘了。

Video Tutorial | 视频教程

Youtube

Bilibili

https://www.bilibili.com/video/av92894985/

Demo Site | 演示站

https://pan.imz.workers.dev/

0 0 votes
Article Rating

xzの小站 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:How to Use Cloudflare and Google to Build a Unlimited Storage Drive Index for FREE | 利用Cloudflare和Google免费搭建无限空间网盘
喜欢 (10)
关于作者:
Is life always this hard, or is it just when you're a kid?——Mathilda:Léon: The Professional
Subscribe | 订阅
Notify of
guest

4 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
4
0
Would love your thoughts, please comment.x
()
x