$ rclone config ... 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> gd Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or typein your own value 1 / 1Fichier \ "fichier" 2 / Alias for an existing remote \ "alias" 3 / Amazon Drive \ "amazon cloud drive" 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc) \ "s3" 5 / Backblaze B2 \ "b2" 6 / Box \ "box" 7 / Cache a remote \ "cache" 8 / Citrix Sharefile \ "sharefile" 9 / Dropbox \ "dropbox" 10 / Encrypt/Decrypt a remote \ "crypt" 11 / FTP Connection \ "ftp" 12 / Google Cloud Storage (this is not Google Drive) \ "google cloud storage" 13 / Google Drive \ "drive" 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" Storage> 13 # 选择 13 / Google Drive ** See helpfor drive backend at: https://rclone.org/drive/ **
Google Application Client Id Setting your own is recommended. See https://rclone.org/drive/#making-your-own-client-id for how to create your own. If you leave this blank, it will use an internal key which is low performance. Enter a string value. Press Enter for the default (""). client_id> # 输入 客户端ID Google Application Client Secret Setting your own is recommended. 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 typein 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), or for rclone to use a non root folder as its starting point.
Note that if this is blank, the first time rclone runs it will fill it in with the ID of the root folder.
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 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/XXXXXXX Log in and authorize rclone for access # 复制上面的链接到浏览器中打开进行授权。
在浏览器中你可能会遇到下图的提示,这是因为 API 是我们自己创建的,并没有通过 Google 的验证。
Enter verification code> # 在这里输入网页上显示的验证码 Configure this as a team drive? y) Yes n) No y/n> y # 如果是团队盘输入 y ,否则输入 n Fetching team drive list... Choose a number from below, or typein your own value 1 / P3TERX \ "0ADPHQ2hJ-6ZkUk9PVA" Enter a Team Drive ID> 1 # 检测到团队盘,这里输入 1 2019/11/06 21:44:27 ERROR : Failed saving config "team_drive" = "0ADPHQ2hJ-6ZkUk9PVA"in section "gd" of the config file: section 'gd' not found -------------------- [gd] type = drive client_id = 217429025371-pfu4k1ko34p4hku860kuj5k5v038f1u4.apps.googleusercontent.com client_secret = 2VxOZcsItLFB8htDXDn2zl_e scope = drive token = {"access_token":"XXXXX","token_type":"Bearer","refresh_token":"1//0eDO2FT","expiry":"2019-11-06T22:44:23.013869707+08:00"} # 保存其中的 refresh_token team_drive = 0ADPHQ2hJ-6ZkUk9PVA -------------------- y) Yes this is OK e) Edit this remote d) Delete this remote y/e/d> y # 输入 y 确认 Current remotes:
Name Type ==== ==== Onedrive onedrive gd 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 退出
获取根目录ID(root)
这里的根目录是指 GoIndex 显示的根目录,可以是你网盘中的任意目录。打开网盘定位到某个目录或共享目录,地址栏 URL 中最后面部分的代码就是目录 ID 了。如果是个人网盘参数留空则是网盘根目录。
创建 Workers
登录 Cloudflare,点击右侧的 Workers 。
新建一个 Workers 子域名
TIPS:后续无法更改,所以不要乱填。
点击Create a Worker新建一个 Worker
清空输入框中的内容,把修改好的 GoIndex 代码并粘贴进去,然后可以在左上角双击修改域名,再点击Save and Deploy即可。