Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Added support for external Google API OAuth2 client credentials #428

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rohfle
Copy link

@rohfle rohfle commented Jan 31, 2019

WHY
By default, gdrive uses OAuth2 client credentials (client id and secret) in
order to allow it to use Google's Drive APIs on behalf of the user. The credentials
are set inside gdrive by default. Unfortunately this means that the rate limit of
API usage is shared amongst all gdrive users globally. It has become common for
the rate limit to be exceeded, causing gdrive to stop stop working.

This pull request makes it possible to load external OAuth2 client credentials. Rate limits are credential specific, so changing to your own generated client credentials avoids the shared rate limit problem.

HOW TO USE
Generate your new credentials in the Google API Console (see steps 3-14 here), name the credentials
file client_id.json and move it to the gdrive config directory (default on linux ~/.gdrive/).
Then delete token_v2.json to reauthenticate using the new credentials.

SIDE EFFECTS

  • You need to delete the old token in order for the new credentials to be used.

  • Existing sync directories will not work after the credentials change. This is because sync sets appProperties on files and folders it uploads as well as the root sync folder. When the credentials change, the appProperties are no longer visible, and gdrive sees the sync directory as a non-empty folder not set up for sync.

@tripLr
Copy link

tripLr commented Feb 9, 2019

since this is not being maintained, i forked this repo, github.com/tripLr your welcome to post there

@dmgk
Copy link

dmgk commented Feb 15, 2019

@rohfle golang.org/x/oauth2 wants cloud.google.com/go/compute/metadata, can you please update your PR to vendor it too?

@rohfle
Copy link
Author

rohfle commented Feb 21, 2019

@dmgk I have updated vendor with godep (learning golang as we go)

@dmgk
Copy link

dmgk commented Feb 21, 2019

@rohfle Thanks!

uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Feb 23, 2019
- Pull in patches from prasmussen/gdrive#428
  enabling support for external Google API OAuth2 client credentials
- Add pkg-message with reference to workaround for "Rate Limit
  Exceeded" errors
- Pet portlint while here

PR:		235497
Submitted by:	Dmitri Goutnik <[email protected]> (maintainer)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@493640 35697150-7ecd-e111-bb59-0022644237b5
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Feb 23, 2019
- Pull in patches from prasmussen/gdrive#428
  enabling support for external Google API OAuth2 client credentials
- Add pkg-message with reference to workaround for "Rate Limit
  Exceeded" errors
- Pet portlint while here

PR:		235497
Submitted by:	Dmitri Goutnik <[email protected]> (maintainer)
Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this pull request Feb 23, 2019
- Pull in patches from prasmussen/gdrive#428
  enabling support for external Google API OAuth2 client credentials
- Add pkg-message with reference to workaround for "Rate Limit
  Exceeded" errors
- Pet portlint while here

PR:		235497
Submitted by:	Dmitri Goutnik <[email protected]> (maintainer)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@493640 35697150-7ecd-e111-bb59-0022644237b5
swills pushed a commit to swills/freebsd-ports that referenced this pull request Mar 4, 2019
- Pull in patches from prasmussen/gdrive#428
  enabling support for external Google API OAuth2 client credentials
- Add pkg-message with reference to workaround for "Rate Limit
  Exceeded" errors
- Pet portlint while here

PR:		235497
Submitted by:	Dmitri Goutnik <[email protected]> (maintainer)


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@493640 35697150-7ecd-e111-bb59-0022644237b5
@rohfle
Copy link
Author

rohfle commented Jul 13, 2019

#476 is preferred as it is much simpler than this PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants