maple3142 / GDIndex

A Google Drive Index built with Vue Running on CloudFlare Workers
https://gdindex-demo.maple3142.workers.dev/
MIT License
1.85k stars 1.13k forks source link

Implementation for Service accounts #170

Closed prashanthca closed 3 years ago

prashanthca commented 3 years ago

This code change will allow the usage of service accounts with GDIndex. This will mainly benefit the end-users

maple3142 commented 3 years ago

Looks good, but I don't really what this is for. Also, add a brief documentation to README.md might be necessary, or users will not know this feature.

As for code addition, please fix some coding style using prettier with this config. Also, prefer const over let, var if not necessary.

catthehacker commented 3 years ago

Service Accounts can be used instead of standard Google/GSuite accounts with rclone setup. The same way rclone can use Service Accounts - https://rclone.org/drive/#service-account-support.

prashanthca commented 3 years ago

Thanks for looking into this @maple3142! And yes, as @CatTheHacker said, it's basically a way to use service accounts to access GDrive. This eliminates the standard upload/download quota that usually applies to normal accounts

catthehacker commented 3 years ago

This eliminates the standard upload/download quota that usually applies to normal accounts

Service accounts are still subject to upload/download quota just like the normal user accounts, it's just easier and faster to manage/use as they don't require manual authentication via web browser.

prashanthca commented 3 years ago

@CatTheHacker Yes, it seems that I was mistaken about the quota. Nevertheless, as you mentioned, it's a easier way to setup GDIndex, without having to get the refresh token via rclone or the web method. Maybe I can look into modifying the props to contain multiple service account credentials, so the client can cycle through them randomly, distributing the usage across the accounts.

prashanthca commented 3 years ago

@maple3142, I've made the changes you suggested and I've added a section in README for this feature. I've made changes in the Chinese README (both traditional and simplified versions) files as well.