-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ab59d0
commit f2db21b
Showing
25 changed files
with
8,296 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,13 +20,12 @@ | |
|
||
[![Screenshot](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index/-/raw/master/images/themes/darkly.png)](https://youtu.be/Ihk4Gm3DPvg) | ||
|
||
`Note: The Changes in your worker's config can affect late due to cache. Use incognito mode every time to open the worker URL to overcome that issue.` | ||
|
||
## How to | ||
|
||
* Stable Release `2.1.5` | ||
* Stable Release `2.1.8` | ||
* Latest Index is faster than before, but backup before making new, and report if I missed something in issues. :) | ||
* Beta Version (Latest) - [bdi-generator](https://bdi-generator.hashhackers.com) or [Temporary Link](https://temporary.ve.workers.dev/) (For Dark Theme use darkly) | ||
* Beta Version (Latest) - [bdi-generator](https://bdi-generator.hashhackers.com) (For Dark Theme use darkly) | ||
* If you want to deploy main drive leave the option ROOT as it is. | ||
* If you want to deploy your Team Drive/Shared Drive/Folder then copy the ID and replace it with ROOT. | ||
* Eg. if you open this shared drive `https://drive.google.com/drive/u/0/folders/0AOM2i7Mi3uWIUk9PVA` - `0AOM2i7Mi3uWIUk9PVA` is its ID. | ||
|
@@ -45,11 +44,18 @@ | |
|
||
## Use Case and Workers needs to be used | ||
|
||
* If you're new and noob, just use [this](https://bdi-generator.hashhackers.com). Doesn't support FOLDER Id anymore. | ||
* Simple Index with Normal or Service Account, use [this](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index/-/blob/master/worker/worker-super.js). (Can search all drives and display drive only links if enabled) Doesn't support FOLDER Id anymore. | ||
* If you enable Second Domain option, you need to make additional Cloudflare workers and account using [this](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index/-/blob/master/worker/worker-second-domain.js). Doesn't support FOLDER Id anymore. | ||
* Advanced Index to Search All Drives and Handle Search and Display Index Links, use [this](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index/-/blob/master/worker/worker-multiple-drives.js). (make sure you add Service Account to those drives, which you're adding inside Index Code) | ||
* [This](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index/-/blob/master/worker/worker-legacy.js) is old code, slower and with errors. Use this only if you want to use FOLDER Id. | ||
* If you're new and noob, just use [this](https://bdi-generator.hashhackers.com). Search doesn't support FOLDER ID, use root or Shared Drive ID. | ||
* worker-super.js is Current and Main Workers File, use this if you have one or more drives. This can also be used to display drive links while searching all drives your account is associated with (optional, recommended for closed index). | ||
|
||
#### More Options | ||
|
||
* workers-legacy.js is older version, less fast because of API requests it makes to check drive types, if you've too many drives, don't use this one. | ||
* worker-multiple-drives.js should be used when you have more than one shared drives and you want to search in all of them and get index links in search. | ||
* worker-second-domain-non-video.js is for using as second domain but doesn't support video files, instead it'll redirect to main index. Good to avoid video streaming ban by cloudflare. | ||
* worker-second-domain.js is for using in second domain worker. | ||
* worker-super-api.js is just API for Static Site. You can host API on Cloudflare as Backend, and serve Frontend on any platform, protects your workers account from being suspended as this one works in background and doesn't consume much resources. | ||
* worker-super-read-only.js is for making a read only Index site. This can be used to showcase your drive files, disabling download or streaming permanently. | ||
* worker-generator.js is the code used on our Index Generation Site mentioned above. | ||
|
||
## Drive ID Types | ||
|
||
|
@@ -59,30 +65,12 @@ | |
|
||
## Steps for Making Search All Drives Index | ||
|
||
1. Copy Code from [here](https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index/-/raw/master/worker/worker-multiple-drives.js). | ||
1. Copy Code from workers folder, choose multiple drives worker file. | ||
2. Make a Single Service Account (Fresh and New) | ||
3. Add that SA Email to drives, only to those, which you want to Index. and change "service_account": false, to "service_account": true, | ||
4. Add that Service Account to Index | ||
5. In domains_for_dl = ['']; enter your Index URL, that you're making now. eg. `https://example.com` | ||
6. Add your Drive IDs in Index Code | ||
7. Change `"second_domain_for_dl": false`, to `"second_domain_for_dl": true`, (don't forget to deploy second domains worker.) | ||
|
||
## authConfig | ||
|
||
```` | ||
"siteName": "Bhadoo Drive Index", // Website name | ||
"client_id": "746239575955-oao9hkv614p8glrqpvuh5i8mqfoq145b.apps.googleusercontent.com", // Client id from Google Cloud Console | ||
"client_secret": "u5a1CSY5pNjdD2tGTU93TTnI", // Client Secret from Google Cloud Console | ||
"refresh_token": "", // Authorize token | ||
"service_account": false, // true if you're using Service Account instead of user account | ||
"service_account_json": randomserviceaccount, // don't touch this one | ||
"files_list_page_size": 50, | ||
"search_result_list_page_size": 50, | ||
"enable_cors_file_down": false, | ||
"enable_password_file_verify": true, // support for .password file | ||
"enable_virus_infected_file_down": true, // support for downloading virus infected files | ||
"direct_link_protection": false, // protects direct links with Display UI | ||
```` | ||
|
||
## Basic Config | ||
|
||
|
@@ -155,67 +143,7 @@ | |
|
||
## Brand Customization | ||
|
||
* In Latest Release, you can rebrand the Index as per your needs. | ||
* Each line has its own custom feature. Edit as per your needs. | ||
* You can remove credit option but we request you not to. | ||
* See Below code to understand Customization. | ||
|
||
```` | ||
const uiConfig = { | ||
"theme": "slate", // switch between themes, default set to slate, select from https://gitlab.com/ParveenBhadooOfficial/Google-Drive-Index | ||
"version": "2.1.5", // don't touch this one. get latest code using generator at https://bdi-generator.hashhackers.com | ||
// If you're using Image then set to true, If you want text then set it to false | ||
"logo_image": true, // true if you're using image link in next option. | ||
"logo_height": "", // only if logo_image is true | ||
"logo_width": "100px", // only if logo_image is true | ||
"favicon": "https://cdn.jsdelivr.net/npm/@googledrive/[email protected]/images/favicon.ico", | ||
// if logo is true then link otherwise just text for name | ||
"logo_link_name": "https://cdn.jsdelivr.net/npm/@googledrive/[email protected]/images/bhadoo-cloud-logo-white.svg", | ||
"fixed_header": true, // If you want the footer to be flexible or fixed. | ||
"header_padding": "60", // Value 60 for fixed header, Value 20 for flexible header. Required to be changed accordingly in some themes. | ||
"nav_link_1": "Home", // change navigation link name | ||
"nav_link_3": "Current Path", // change navigation link name | ||
"nav_link_4": "Contact", // change navigation link name | ||
"show_logout_button": false, // shows logout button if auth0.com is active | ||
"fixed_footer": false, // If you want the footer to be flexible or fixed. | ||
"hide_footer": true, // hides the footer from site entirely. | ||
"header_style_class": "navbar-dark bg-primary", // navbar-dark bg-primary || navbar-dark bg-dark || navbar-light bg-light | ||
"footer_style_class": "bg-primary", // bg-primary || bg-dark || bg-light | ||
"css_a_tag_color": "white", // Color Name or Hex Code eg. #ffffff | ||
"css_p_tag_color": "white", // Color Name or Hex Code eg. #ffffff | ||
"folder_text_color": "white", // Color Name or Hex Code eg. #ffffff | ||
"loading_spinner_class": "text-light", // https://getbootstrap.com/docs/5.0/components/spinners/#colors | ||
"search_button_class": "btn btn-danger", // https://getbootstrap.com/docs/5.0/components/buttons/#examples | ||
"path_nav_alert_class": "alert alert-primary", // https://getbootstrap.com/docs/4.0/components/alerts/#examples | ||
"file_view_alert_class": "alert alert-danger", // https://getbootstrap.com/docs/4.0/components/alerts/#examples | ||
"file_count_alert_class": "alert alert-secondary", // https://getbootstrap.com/docs/4.0/components/alerts/#examples | ||
"contact_link": "https://telegram.dog/Telegram", // Link to Contact Button on Menu | ||
"copyright_year": "2050", // year of copyright, can be anything like 2015 - 2020 or just 2020 | ||
"company_name": "Bhadoo Cloud", // Name next to copyright | ||
"company_link": "https://telegram.dog/Telegram", // link of copyright name | ||
"credit": true, // Set this to true to give us credit | ||
"display_size": true, // Set this to false to hide display file size | ||
"display_time": false, // Set this to false to hide display modified time for folder and files | ||
"display_download": true, // Set this to false to hide download icon for folder and files on main index | ||
"disable_player": false, // Set this to true to hide audio and video players | ||
"custom_srt_lang": "", // Subtitle Language Code for Custom .vtt language. | ||
"disable_video_download": false, // Remove Download, Copy Button on Videos | ||
"second_domain_for_dl": false, // If you want to display other URL for Downloading to protect your main domain. | ||
"downloaddomain": domain_for_dl, // Ignore this and set domains at top of this page after service accounts. | ||
"poster": "https://cdn.jsdelivr.net/npm/@googledrive/[email protected]/images/poster.jpg", // Video poster URL or see Readme to how to load from Drive | ||
"audioposter": "https://cdn.jsdelivr.net/npm/@googledrive/[email protected]/images/music.jpg", // Video poster URL or see Readme to how to load from Drive | ||
"jsdelivr_cdn_src": "https://cdn.jsdelivr.net/npm/@googledrive/index", // If Project is Forked, then enter your GitHub repo | ||
"render_head_md": true, // Render Head.md | ||
"render_readme_md": true, // Render Readme.md | ||
"display_drive_link": false, // This will add a Link Button to Google Drive of that particular file. | ||
"plyr_io_version": "3.6.4", // Change plyr.io version in future when needed. | ||
"plyr_io_video_resolution": "16:9", // For reference, visit: https://github.com/sampotts/plyr#options | ||
"unauthorized_owner_link": "https://telegram.dog/Telegram", // Unauthorized Error Page Link to Owner | ||
"unauthorized_owner_email": "[email protected]", // Unauthorized Error Page Owner Email | ||
"arc_code": "jfoY2h19", // arc.io Integration Code, get yours from https://portal.arc.io | ||
"search_all_drives": false // gives gdrive links on search and searches all drives on that account, doesn't require adding | ||
}; | ||
```` | ||
* In Latest Release, you can rebrand the Index as per your needs. Read the workers file to change UI and config. | ||
|
||
## Auth0 Integration | ||
|
||
|
@@ -240,9 +168,9 @@ const uiConfig = { | |
|
||
## Second Domain Systems | ||
|
||
* set second_domain_for_dl to `true` first. | ||
* set downloaddomain to your new index you're going to make below. | ||
* then make separate index on different cloudflare account with worker-beta-second-domain.js code. | ||
* set second_domain_for_dl to `true` first in UI Config. | ||
* set domains_for_dl and video_domains_for_dl to your new index you're going to make below in top config near service accounts. | ||
* then make separate index on different Cloudflare account with second-domain workers code. | ||
* change only refresh_token or SA and Drive IDs, don't touch anything else. | ||
* It's done. | ||
|
||
|
@@ -251,7 +179,7 @@ const uiConfig = { | |
* arc.io is embedded in code to support gdi.js.org | ||
* if you have approved arc.io account, use your code. | ||
* incase you don't have arc account and want to support us, please keep our arc.io code in your index. | ||
* if anyone doesn't want to support us and want to remove arc, remove L140 line from the workers code. | ||
* if anyone doesn't want to support us and want to remove arc, remove the arc code from the workers code. | ||
|
||
## Themes | ||
|
||
|
@@ -275,7 +203,7 @@ const uiConfig = { | |
## Search Limitations | ||
|
||
* Search only works if you use Shared Drive ID or root. | ||
* Search won't work or the bar won't appear if you're using Folder ID inside from root or Shared Drive. | ||
* Search won't work or the bar won't appear if you're using Folder ID inside from root or Shared Drive. In Newer versions bar will appear but search won't work. | ||
|
||
## Sorting by Name or Modified Time | ||
|
||
|
@@ -284,14 +212,6 @@ const uiConfig = { | |
* use `params.orderBy = 'folder,modifiedTime desc,name';` to sort by Modified Time. | ||
* A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. | ||
|
||
## Making your own repo, editing and making changes | ||
|
||
* Fork this Repo or Import. | ||
* Make your changes in `app.js` and `workers-beta.js` files. | ||
* Make a new release in GitHub. | ||
* Change jsDelivr CDN URL and version code in `workers-beta.js`. | ||
* Deploy in Cloud flare Workers. | ||
|
||
## Get Google_Client_ID and Secret and Generate Token | ||
|
||
* Open [Google Dev Credentials Site](https://console.developers.google.com/apis/credentials). | ||
|
@@ -330,13 +250,13 @@ const uiConfig = { | |
* PDF Viewer: [pdf.js](https://github.com/mozilla/pdf.js) | ||
* Audio and Video Player: [plyr.io](https://github.com/sampotts/plyr) | ||
* CDN: [jsDelivr](https://www.jsdelivr.com) | ||
* Minified JS: [Toptal](https://www.toptal.com/developers/javascript-minifier) | ||
* Minified JS: [Toptal](https://www.toptal.com/developers/javascript-minifier) and [JavaScript Minify Tool]() | ||
* Obfuscator: [JavaScript Obfuscator Tool](https://obfuscator.io) | ||
* Hosting: [Gitlab](https://gitlab.com) and [npm](https://www.npmjs.com) | ||
* Website Hosting: [js.org](https://js.org) and [GitHub](https://github.com) | ||
* Dev Editor Used: [ATOM](https://atom.io) | ||
* Made for: [Cloudflare Workers](https://workers.cloudflare.com) | ||
* Several Different Fixes by [SpEcHiDe](https://github.com/SpEcHiDe), [Adnan Ahmad](https://gitlab.com/viperadnan), [Prashanth C A](https://github.com/Achrou/goindex-theme-acrou/pull/176), [cheems](https://github.com/cheems/goindex-extended/blob/master/index.js#L553) and Unmentioned Forgotten Contributors. | ||
* Several Different Fixes by [SpEcHiDe](https://github.com/SpEcHiDe), [Adnan Ahmad](https://gitlab.com/viperadnan), [Prashanth C A](https://github.com/Achrou/goindex-theme-acrou/pull/176), [cheems](https://github.com/cheems/goindex-extended/blob/master/index.js#L553), [iSumitBot](https://t.me/isumitbot) and Unmentioned Forgotten Contributors. | ||
|
||
## Disclaimer | ||
|
||
|
Oops, something went wrong.