New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to service account? #242

Open
asmith20002 opened this Issue Jan 7, 2017 · 12 comments

Comments

Projects
None yet
10 participants
@asmith20002

asmith20002 commented Jan 7, 2017

Hello,

Is it possible setup gdrive with "Service account". Google gives you a json file to the service account info. The json has type, project_id, private_key_id etc etc

I want to setup daily cron to backup server and I don't want to manually authenticate.

@freddi301

This comment has been minimized.

freddi301 commented Feb 2, 2017

hi, nice feature but i cant make it work in any way, please write some error message like file not found or key not valid

@fab-io

This comment has been minimized.

Contributor

fab-io commented Feb 3, 2017

Hi,
there are already some error messages, for example if the service account file does not exists, I get this:

fdifabio$ ./gdrive -c /tmp --service-account foo.json about
Failed getting oauth client: Service account filename "/tmp/foo.json" not found

and others should be handled by the GDrive API directly, for example in case of invalid key:

fdifabio$ gdrive -c ~/tmp --service-account service_account.json about
Failed to get about: Get https://www.googleapis.com/drive/v3/about?alt=json&fields=maxImportSizes%2CmaxUploadSize%2CstorageQuota%2Cuser: private key should be a PEM or plain PKSC1 or PKCS8; parse error: asn1: structure error: tags don't match (16 vs {class:0 tag:13 length:45 isCompound:true}) {optional:false explicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2

Could you help me in reproducing you setup, so I can find what is missing?

@freddi301

This comment has been minimized.

freddi301 commented Feb 3, 2017

Downloaded from https://github.com/prasmussen/gdrive/tree/2.1.0

./gdrive-linux-x64 -c /tmp --service-account foo.json about
No valid arguments given, use 'gdrive help' to see available commands
./gdrive-linux-x64 -c ~/tmp --service-account service_account.json about
No valid arguments given, use 'gdrive help' to see available commands
@fab-io

This comment has been minimized.

Contributor

fab-io commented Feb 3, 2017

The build you are using does not have this new feature, since it is only available compiling sources from the master branch.
Please ask to @prasmussen when he plan to do a new binary release.

@asmith20002

This comment has been minimized.

asmith20002 commented Feb 4, 2017

@fab-io,

I thought this was totally abandoned. Thanks for taking time. I appreciate it :)
I use "gdrive-linux-386" version from the main page but I don't think it's been released for it yet.

@mintsoft

This comment has been minimized.

mintsoft commented Mar 8, 2017

This absolutely just tripped me up too; @prasmussen do you have any plans when new builds (especially windows!) will be available?

@hnykda

This comment has been minimized.

hnykda commented Mar 17, 2017

Wow, this is confusing! It seems that raspberry pi build doesn't work with --service-account as well. Why there is no warning in README?! I spent an hour trying to make it work to find out it is not present in the binary...

$ ./gdrive-linux-rpi -c /tmp --service-account "creds.json" about

throws:

No valid arguments given, use 'gdrive help' to see available commands
@AronNovak

This comment has been minimized.

AronNovak commented Mar 29, 2017

Actually it's not that complex to compile the binary, I compiled one for Linux x64 (to be able to download it to an older distro, without recent Go)
gdrive-linux-x64.zip

Otherwise +1 for the new release, it would be needed.

@mattharg

This comment has been minimized.

mattharg commented Dec 31, 2017

Thanks for the link to the linux-x64 build. The --service-account option seems to be working for me.
+1 for this to be in the next release. THX again.

@winni2k

This comment has been minimized.

winni2k commented Jan 18, 2018

Here is a darwin/amd64 build that I put together on my mac. I'm completely new to go, so no guarantees...
gdrive_darwin_amd64.tar.gz

@sim642

This comment has been minimized.

sim642 commented Apr 2, 2018

This is extremely confusing, I wasted too much time on it before I found this issue...

There hasn't been a release for a long time, fair enough, but why does the README then describe features that aren't even available in the suggested builds? There's nothing to even hint that what's described might not be in the build.

Also the No valid arguments given, use 'gdrive help' to see available commands error message is misleading because it occurs when at least some valid arguments are present. No indication of the --service-account flag being unknown.

@kagarlickij

This comment has been minimized.

kagarlickij commented Jun 27, 2018

@AronNovak it doesn't work with your binary as well as with binary from main page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment