|
|
Welcome to the Google-Drive-Index wiki!
|
|
|
|
|
|
## This will include step by step use of every available feature...
|
|
|
|
|
|
### Step 1: Make Cloudflare Account
|
|
|
|
|
|
* [Cloudflare](https://dash.cloudflare.com/sign-up) or [Login to Cloudflare](https://dash.cloudflare.com/login)
|
|
|
* Make Cloudflare Workers Account inside Cloudflare or choose your workers name.
|
|
|
* Create a worker.
|
|
|
* Give it a name.
|
|
|
* Remove all code already present on editor.
|
|
|
* Workers Code can be edited only on Desktop and not on Mobiles (Desktop mode on mobile will not work)
|
|
|
|
|
|
### Step 2: Generate Code from gdi.js.org
|
|
|
|
|
|
* Open [Generator Site](https://generator.driveindex.ga)
|
|
|
* Click on Get Authentication Code and Allow gdi.js.org to read Drive Files
|
|
|
* Leave everything as it is, paste the code and click on Generate Code.
|
|
|
* Copy the Copy and Paste in Cloudflare Workers we created in Step 1 and click on Deploy.
|
|
|
* Check by opening your workers URL if site is working.
|
|
|
|
|
|
### Step 3: Editing the Workers Code as per needs
|
|
|
|
|
|
#### Service Accounts (Optional)
|
|
|
|
|
|
* Service accounts are used when we don't need to index the ROOT (main drive) and we want to overcome problem of download limits (doesn't completely overcomes download limits).
|
|
|
* To Generate Service Accounts go to [Google Drive API Library](https://console.cloud.google.com/apis/library/drive.googleapis.com) and enable it.
|
|
|
* You will need to make or select Project, do as per you needs.
|
|
|
* Go to [Cloud Credentials](https://console.cloud.google.com/apis/credentials) page and Click on Create Credentials and select Service Account.
|
|
|
* You'll get email id of service account, add that email to your Shared Drive as atleast viewer access.
|
|
|
* Go to keys and and add key and then download JSON file of key.
|
|
|
* Copy the JSON data and paste inside the workers code by replacing it with {}.
|
|
|
* You can add multiple service accounts by using `,` after each service account JSON.
|
|
|
|
|
|
#### Edit Auth Config
|
|
|
|
|
|
* You can set site name as per your needs.
|
|
|
* You can change Client ID and Client Secret if you want to use your own. (random doesn't works)
|
|
|
* Do not touch Refresh token if you're not using Service account or your own Client ID and Client Secret.
|
|
|
* Set `"service_account": false` to "service_account": true` if you're using service accounts.
|
|
|
* `files_list_page_size` and `search_result_list_page_size` are used to set the limit of number of files and folders with appear at one time. Keep this between 50-1000 for better performence. Less than 50 or more than 1000 may cause problems or slow down website.
|
|
|
* `enable_cors_file_down` file is used to avoid embedding of URLs if set to true. That means if someone wants to put your video file on another site with video player, it won't play. It doesn't stops downloading of files using links directly.
|
|
|
* `enable_password_file_verify` is used for Directory level encryption, you need to add `.password` file inside each directory you want to encrypt, it doesn't encrypts sub-directories automatically.
|
|
|
* You can create a `password.txt` file, add your password as simple text in one line, upload it to drive folder and then rename the file as `.password`.
|
|
|
* `roots` are the drives you'll be indexing. For optimal performace, we recommend to use maximum of 5 drives in each workers site.
|
|
|
* For `id` you can use `root` to index your main drive, that is 15 GB for normal drive accounts.
|
|
|
* For `id` if you use Shared Drives, open your shared drive and copy the end code in the URL (in browser, not in app), and paste here.
|
|
|
* For eg. `https://drive.google.com/drive/u/0/folders/0AH_a0IJZqLn7Uk` is your shared drive link, copy `0AH_a0IJZqLn7Uk` as its ID.
|
|
|
|
|
|
#### Edit uiConfig (Configuration of Style and Features of website)
|
|
|
|
|
|
* `theme` can selected from gdi.js.org theme section, you can also leave it as default theme already selected.
|
|
|
* `version` is gdi.js.org version of software, don't touch it if you don't know what you're doing.
|
|
|
* If you want to use image as logo then select `logo_image` to `true` otherwise do text only header do `false`.
|
|
|
* If you are using image then you can change its height and width in `logo_height` and `logo_width`.
|
|
|
* `logo_link_name` is two way street, Enter image link if you want to or just enter YOUR SITE NAME.
|
|
|
* `fixed_header` fixes the header and navigation bar to the top of the screen.
|
|
|
* `header_padding` is used to maintain the difference between header and the content. Its 60 by deafult for fixed header and 20 if header is not fixed, but some themes have bigger or smaller navigation headers. you may need to tweek it a little by changing its value for some themes.
|
|
|
![Header Padding](https://i.imgur.com/AoKxuyy.png)
|
|
|
* `fixed_footer` fixes the header to the bottom of the page. this is not recommened as it may color alot of space on mobile devices.
|
|
|
* `header_style_class` changes the color of header, select values from `navbar-dark bg-primary` or `navbar-dark bg-dark` or `navbar-light bg-light`. The header styling for each theme can be checked at [Bootswatch](https://bootswatch.com). Below is header styles of [slate](https://bootswatch.com/slate) theme.
|
|
|
![Header Style](https://i.imgur.com/cDwC16N.png)
|
|
|
* `footer_style_class` is same as header class, and changes the color of footer, select values from `bg-primary` or `bg-dark` or `bg-light`.
|
|
|
* `css_a_tag_color` is color for Links on the same. `a` tag is used for links in HTML and this may vary from dark and light themes or if you want can set custom colors. All standard css colors eg. red, white, black are supported. You can also use hex code of colors from [W3Schools](https://www.w3schools.com/colors/colors_picker.asp).
|
|
|
* `css_p_tag_color` is same as above and is the color for paragraphs. this can be used to color the `p` tag in footer or markdown files.
|
|
|
* `folder_text_color` is used to completely override the text color of footer as it contains more than one tag.
|
|
|
* `loading_spinner_class` is the loading spinner which is shown while the site fetches content, select values from `text-primary`, `text-secondary`, `text-success`, `text-danger`, `text-warning`, `text-info`, `text-light` and `text-dark`. Full details [here](https://getbootstrap.com/docs/5.0/components/spinners/#colors).
|
|
|
* `search_button_class` is used to select style of search button at the right top of the page. eg. `btn-outline-success` or `btn-success`. Full details [here](https://getbootstrap.com/docs/5.0/components/buttons/#examples). |
|
|
\ No newline at end of file |