Skip to content
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

Access Team Drives? #28

Open
mforbes opened this issue Jan 15, 2019 · 9 comments
Open

Access Team Drives? #28

mforbes opened this issue Jan 15, 2019 · 9 comments

Comments

@mforbes
Copy link

mforbes commented Jan 15, 2019

I am trying to setup a remote with a folder in a Google Team Drive by specifying the root_id but this does not seem to work. (I get a 404 "File not found error".) I am getting the root id from the URL of the folder when I connect via the web interface, which works for folders in My Drive.

Is there a limitation in the current implementation, or should I be looking into possible security options with my Team Drive setting?

References:

@Lykos153
Copy link
Owner

There is no limitation regarding Team Drives that I'm aware of. The Google Drive API replies with 404 when the user has no access to the specified folder id. Please check the security settings of your Team Drive. If that doesn't help, could you provide a test folder for me?

@Lykos153
Copy link
Owner

Lykos153 commented Jan 15, 2019

Apparently we need some additional code to access folders within a Team Drive by prefix (googlearchive/PyDrive#149). But I'd think it should work by root_id without modification:

Once you get the ID, the process for uploading is as usual

@Lykos153
Copy link
Owner

Please try the version from this branch: https://github.com/Lykos153/git-annex-remote-googledrive/tree/team-drives
It's a test version only and it's not supposed for productive use. It's just to check if initremote works without errors.

Use it like this:
git annex initremote test_remote type=external externaltype=googledrive prefix=testfolder team_drive_id=<your_team_drive_id>

@mforbes
Copy link
Author

mforbes commented Jan 15, 2019

Yes: running initremote off that branch succeeds without errors.

@Lykos153
Copy link
Owner

Lykos153 commented Feb 1, 2019

I pushed a new version to this branch. Could you please run "git annex testremote --fast" with it using a team_drive_id?

@mforbes
Copy link
Author

mforbes commented Mar 10, 2019

Sorry for the protracted delay. Yes, this work (see below) but the files are not stored in "Team Drive/testfolder", they are stored in "My Drive/testfolder". (Not sure if this is intended as part of the "do not use for production work" or not...)

$ git annex testremote test_remote --fast
testremote test_remote (generating test keys...) Remote Tests
  unavailable remote
    removeKey:                       git-annex: Cannot run git-annex-remote-!dne! -- It is not installed in PATH (...)
OK
    storeKey:                          Cannot run git-annex-remote-!dne! -- It is not installed in PATH (...)
OK (0.11s)
    checkPresent:                    OK
    retrieveKeyFile:                 OK
    retrieveKeyFileCheap:            OK
  key size Just 1048576; NoChunks; encryption none
    removeKey when not present:      OK (2.35s)
    present False:                   OK (0.58s)
    storeKey:                        OK (5.52s)
    present True:                    OK (0.42s)
    storeKey when already present:   OK
    present True:                    OK (0.48s)
    retrieveKeyFile:                 OK (1.60s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 33%: OK (1.42s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 0:   OK (1.37s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from end: OK (1.39s)
    fsck downloaded object:          OK
    removeKey when present:          OK (1.26s)
    present False:                   OK (0.42s)
  key size Just 1048576; NoChunks; encryption shared
    removeKey when not present:      OK (2.19s)
    present False:                   OK (0.42s)
    storeKey:                        OK (9.36s)
    present True:                    OK (0.44s)
    storeKey when already present:   OK (0.10s)
    present True:                    OK (0.45s)
    retrieveKeyFile:                 OK (1.53s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 33%: OK (1.54s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 0:   OK (1.44s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from end: OK (1.40s)
    fsck downloaded object:          OK
    removeKey when present:          OK (1.19s)
    present False:                   OK (0.49s)
  key size Just 1048575; NoChunks; encryption none
    removeKey when not present:      OK (0.44s)
    present False:                   OK (0.46s)
    storeKey:                        OK (5.53s)
    present True:                    OK (0.42s)
    storeKey when already present:   OK
    present True:                    OK (0.47s)
    retrieveKeyFile:                 OK (1.40s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 33%: OK (1.34s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 0:   OK (1.35s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from end: OK (1.33s)
    fsck downloaded object:          OK
    removeKey when present:          OK (1.18s)
    present False:                   OK (0.47s)
  key size Just 1048575; NoChunks; encryption shared
    removeKey when not present:      OK (0.40s)
    present False:                   OK (0.46s)
    storeKey:                        OK (5.89s)
    present True:                    OK (0.47s)
    storeKey when already present:   OK (0.10s)
    present True:                    OK (0.46s)
    retrieveKeyFile:                 OK (1.59s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 33%: OK (1.56s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from 0:   OK (1.35s)
    fsck downloaded object:          OK
    retrieveKeyFile resume from end: OK (1.40s)
    fsck downloaded object:          OK
    removeKey when present:          OK (1.15s)
    present False:                   OK (0.46s)

All 69 tests passed (67.18s)
ok
(recording state in git...)

@emanuele
Copy link

Any update on this issue? I am trying to set up a special remote on Google Drive that can be used (even read-only) by multiple users. As far as I understand Team Drive is the way to go but I suspect the support is still not ready...?

Nevertheless, thanks a lot for creating this piece of software!

@Lykos153
Copy link
Owner

No, it's not yet ready. I'm going to need to rewrite the way to select folders in response to the API lockdown (see #29). In this process, I'm going to implement full support for Team Drives.

@emanuele
Copy link

OK, thanks for your answer.
Looking forward to seeing the new feature!

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

No branches or pull requests

3 participants