A Google Drive Index built with Vue Running on CloudFlare Workers.
实例:https://gdindex-demo.maple3142.workers.dev/
GDIndex is similar to GOIndex. It allows you to deploy a "Google Drive Index" on CloudFlare Workers along with many extra features
By the way, instead of modify from GOIndex, this is a total rewrite
Difference between GOIndex and GDIndex
- Frontend is based on Vue.js
- Image viewer doesn't require opening new page
- Video player support subtitles(Currently only srt is supported)
- Online PDF, EPUB reader
- No directory-level password protection(.password)
- Support Http Basic Auth
- Support multiple drives(personal, team) without changing server's code
Usage
Simple and automatic way
Go https://gdindex-code-builder.maple3142.net/, and follow its instructions.
Manual way
- Install rclone
- Setup your Google Drive: https://rclone.org/drive/
- Run
rclone config fileto find yourrclone.conflocation - Find
refresh_tokenin yourrclone.conf, androot_folder_idtoo(optionally). - Copy the content of worker/dist/worker.js to CloudFlare Workers.
- Fill
refresh_token,root_folder_idand other options on the top of the script. - Deploy!
Using service accounts
- Create a service account, a corresponding service account key, and get the JSON from the Google Cloud Platform console
- In the props object, replace the
service_account_jsonvalue with the contents of the service account JSON file and setservice_accounttotrue. - Make sure that the service account in question has access to the folder specified in
root_folder_id - Deploy
Lite mode
This mode will serve a simple nginx-like directory listing, and it only work with one drive. upload will be ignored in this mode.
On the top of the script, change lite: false into lite: true, than thats all.
To enable on-the-fly lite mode, especially with command-line applications, you can include a HTTP header x-lite: true in your requests.
from https://github.com/maple3142/GDIndex
------
Google Drive Directory Index Running on CloudFlare Workers [Search + DarkMode] [ENGLISH]
https://g-d.rive.workers.dev/
Google Drive Index + Guide + Team Drive Maker [If you have G-suite Account]
SAMPLE
Search Implemented
- Features
ENGLISH LANGUAGE
- Video Player - | mp4 | webm | avi | mpg | mpeg | mkv | rm | rmvb | mov | wmv | asf | ts | flv
- Music Player - | mp3 | flac | wav | ogg | m4a
- Document Viewer - | html | php | css | go | java | js | json | txt | sh | md | pdf
- Image Viewer - | bmp | jpg | jpeg | png | gif
- Multi drive encryption
- Mobile Friendly
- Multi-level Search within the team drive
- Dark Theme
-
Main Color:
- red | pink | purple | deep-purple | indigo | blue | light-blue | cyan | teal | green | light-green | lime yellow | amber orange | deep-orange | brown | greyblue-grey
-
Accent Color:
- red | pink | purple | deep-purple | indigo | blue | light-blue | cyan | teal | green | light-green | lime | yellow | amber | orange | deep-orange
-
darkmode: true/false
-
How to use?
Deployment
1.Install rclone software locally
2.Follow https://rclone.org/drive/ bind a drive
3.Execute the commandrclone config file to find the file rclone.conf path
4.Open rclone.conf,find the configuration root_folder_id and refresh_token
5.Download index.js in https://github.com/LeeluPradhan/Search/ and fill in root and refresh_token
6.Deploy the code to Cloudflare Workers
Want to host to your repository?
- Simply fork this or
- Download this repo and upload files as per your choice
- Use https://www.jsdelivr.com/?docs=gh to use your own
app.jsand change path accordingly inindex.js - Copy your completed
index.jsto Cloudflare Workers - Enjoy :)
Credits
https://github.com/yanzai/goindex
Protect links
If you want main links to be protected and share direct links without password then use code from branch 2.0
Team Drive Maker
Get Required Data from
Note: You must have permissions to create shared
drive in your account. This doesn't work with GMAIL Accounts, Required
Gsuite Business+ Accounts. To check Open Google Drive and try to create
Shared Drive first.
- Open Google Cloud Console
- After creating project or if you already have one.
- Enable Drive API from Here
- Click create credentials.
- Select OAuth client ID.
- Select Web application.
- Give it a name. (anything for your own reference)
- In Authorized JavaScript origins add
https://developers.google.com - In Authorized redirect URIs add
https://developers.google.com/oauthplayground - Save and note down your Client ID and Secret
- Open Developers Playground
- On Right Top Side click on Setting Icon
- Click on Use your own OAuth credentials.
- Enter OAuth Client ID: and OAuth Client secret:
- Now back to same page Developers Playground left side Step 1 i.e. Select & authorize APIs
- Find Drive API v3
- Select First Option i.e. https://www.googleapis.com/auth/drive (Required)
- Click on Authorize API. and give permissions using your google account.
- It will turn to Step 2 Exchange authorization code for tokens at the end of authentication.
- Click on Exchange authorization code for tokens, if it goes to step 3, click on Step 2 yourself.
- Select the option Auto-refresh the token before it expires.
- Copy the refresh token and paste in maker.js along with your own Client ID and Secret, your own logo, icons etc as per your taste
- Copy the Code and paste it into https://workers.cloudflare.com Site.
Credits:
https://github.com/ParveenBhadooOfficial/Create-Google-Shared-Drive
from https://github.com/LeeluPradhan/G-Index


No comments:
Post a Comment