menukaonline / goindex-extended

A Google Drive Index, which has a lot of extra features, running on Cloudflare Workers.
https://demo.dudoo.workers.dev
MIT License
442 stars 252 forks source link

Google Colab Issue #80

Closed hexaaagon closed 1 year ago

hexaaagon commented 1 year ago

image

i got a error in the Google Colab GoIndex Extended Code generation.

i got the token in this oauth2 web, i dunno is the token is broke or the code.

menukaonline commented 1 year ago

I think this is because Google recently deprecated the authentication method used in this Colab notebook. Until I fix this, you can use the manual method. This may take a little time because I'm currently working on the documentation. After the documentation is completed, I will fix this.

hexaaagon commented 1 year ago

Thank you for your reply, but i still confused cause how to create that crypt secret. Can you help me creating that code?

menukaonline commented 1 year ago

Basically, crypt_secret is used as the secret key for the symmetric encryption implemented in this script. Hope you will understand what it is by having a look at the following uses.


crypt_secret was initially introduced to encrypt file ids (https://github.com/menukaonline/goindex-extended/issues/24#issuecomment-938866533).


Later, the search functionality for folder root type was added (which is not yet available in the Google Drive API). To make this operation possible, this function uses the file tree of the root folder generated from this Colab notebook: Folder_Id_List_Generator.ipynb. (due to the deprecated authentication method, I think this doesn't work at the moment)

If you have a huge file tree containing many directory levels and thousands of files under the root folder that you added to the goindex-extended script, the generated file tree could be very long. Because of this, it is instructed to host the file tree somewhere and add its URL to the goindex-extended script.

Since the file tree needs to be hosted publicly, the above Colab notebook encrypts the file tree using your crypt_secret before displaying the file tree to you for copying.


So this script can access the file tree by decrypting the ciphertext you hosted whenever the end users perform a search.

This is the 2nd use of crypt_secret.


In the upcoming updates(not in the next update but later ones), crypt_secret will be used to save cookies (encrypted strings) in users' browsers, so this script will be able to load files more quickly and reduce loading errors.


For better encryption, it needs a strong secret key. Therefore, several requirements were listed to make crypt_secret stronger and more complex.

In order to make crypt_secret stronger, it must

Note: Avoid using excluded symbols \ / " ' as they may conflict with the code.

The concept is the same as creating a password. Here are some examples:

You can also use your favourite password generator to create a strong crypt_secret.

A screenshot of password generator in Bitwarden ![image](https://user-images.githubusercontent.com/28010975/230144650-b1d064cf-d1e3-49e4-a28d-abc0a7d8f9d7.png)
hexaaagon commented 1 year ago

Okay, thank you for your help, i understand now. Thanks again for your support!