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

Connect to service account? #242

Open
asmith20002 opened this issue Jan 7, 2017 · 14 comments
Open

Connect to service account? #242

asmith20002 opened this issue Jan 7, 2017 · 14 comments

Comments

@asmith20002
Copy link

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
Copy link

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
Copy link
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
Copy link

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
Copy link
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
Copy link
Author

@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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@billythemusical
Copy link

+1 for getting a Raspberry Pi version of --service-account going. Spent an hour at least wrangling the Google service account, got the JSON file, but keep getting No valid arguments given...

@happiness9721
Copy link

Still not release in homebrew yet

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

No branches or pull requests