astrada / google-drive-ocamlfuse

FUSE filesystem over Google Drive
https://astrada.github.io/google-drive-ocamlfuse/
MIT License
5.55k stars 353 forks source link

Support Team Drives #288

Closed ddrozdov closed 6 years ago

ddrozdov commented 7 years ago

A new business feature has been announced some time ago - Team Drives.

Please add an option to specify a team drive name on mount operation.

See the API docs.

robindirksen1 commented 7 years ago

When will this become available?

astrada commented 7 years ago

The problem is that this feature it's only available as part of G Suite, and I don't have a G Suite account.

CzechJiri commented 7 years ago

@astrada I can give you temporary access to our G Suite account if this helps

astrada commented 7 years ago

@CzechJiri: Thanks! That would be great! Ping me at alessandro.strada@gmail.com

Kosudo commented 6 years ago

Perhaps this may help (2nd November):

"You’ve told us that you want more tools to see and manage all of the Team Drives in your domain in one location. Today, we’re making that easier by providing new methods in the Google Drive API that enable developers to build tools for Team Drive membership management, cybersecurity solutions, and more."

View and modify all of your Team Drives using the Google Drive API https://gsuiteupdates.googleblog.com/2017/11/view-and-modify-all-of-your-team-drives.html

revoluzzer commented 6 years ago

If you integrate the team drive functionality, we would pay you for this feature. It's a very important point for my company. Thank you very much. Regards Volker Holthaus

astrada commented 6 years ago

If you integrate the team drive functionality, we would pay you for this feature.

No need, thanks. I need only a temporary G Suite account. Please contact me at alessandro.strada@gmail.com

dbosso commented 6 years ago

Team drives can be shared with non g-suite accounts, perhaps you just need a drive shared? I can do this if it will expedite the feature.

HelgeS commented 6 years ago

@astrada I have invited you as a member to a team drive at my organization.

astrada commented 6 years ago

@HelgeS, thank you very much! I'll let you know if I need something to test the implementation.

astrada commented 6 years ago

@HelgeS, I think I have an experimental version that you can test. Let me know if you installed google-drive-ocamlfuse via opam or ppa, so that I can give you instructions on how to install the test version. Thanks!

revoluzzer commented 6 years ago

If you have a ppa version, i could test the team drive functionality. Regards Volker

HelgeS commented 6 years ago

I'm on arch linux, but it seems the install scripts there are stuck on 0.6.21 and still require a setup.ml, which no longer exists.

But using the release sources for version 0.6.23, I get a compile error:

$ cd google-drive-ocamlfuse-0.6.23
$ ocaml --version
The OCaml toplevel, version 4.05.0                                                                                       
$ jbuilder build @install
    ocamldep bin/gdfuse.depends.ocamldep-output
    ocamldep src/google_drive_ocamlfuse.dependsi.ocamldep-output
    ocamldep src/google_drive_ocamlfuse.depends.ocamldep-output
      ocamlc src/bufferPool.{cmi,cmti}
      ocamlc src/threadPool.{cmi,cmti}
      ocamlc src/keyValueStore.{cmi,cmo,cmt}
      ocamlc src/buffering.{cmi,cmti}
    ocamlopt src/bufferPool.{cmx,o}
      ocamlc src/utils.{cmi,cmo,cmt}
    ocamlopt src/keyValueStore.{cmx,o}
      ocamlc src/concurrentGlobal.{cmi,cmo,cmt}
      ocamlc src/state.{cmi,cmo,cmt}
    ocamlopt src/utils.{cmx,o}
      ocamlc src/config.{cmi,cmo,cmt}
    ocamlopt src/concurrentGlobal.{cmx,o}
    ocamlopt src/state.{cmx,o}
    ocamlopt src/threadPool.{cmx,o}
      ocamlc src/appDir.{cmi,cmo,cmt}
      ocamlc src/mime.{cmi,cmo,cmt}
File "src/mime.ml", line 6, characters 50-66:
Warning 3: deprecated: String.lowercase
Use String.lowercase_ascii instead.
    ocamlopt src/buffering.{cmx,o}
      ocamlc src/cache.{cmi,cmo,cmt}
      ocamlc src/context.{cmi,cmo,cmt}
      ocamlc src/gaeProxy.{cmi,cmo,cmt}
      ocamlc src/oauth2.{cmi,cmo,cmt}
    ocamlopt src/config.{cmx,o}
    ocamlopt src/appDir.{cmx,o}
      ocamlc src/drive.{cmi,cmo,cmt} (exit 2)
(cd _build/default && /usr/bin/ocamlc.opt -w -40 -g -bin-annot -I /usr/lib/ocaml -I /usr/lib/ocaml/Fuse -I /usr/lib/ocaml/biniou -I /usr/lib/ocaml/bytes -I /usr/lib/ocaml/cryptokit -I /usr/lib/ocaml/curl -I /usr/lib/ocaml/easy-format -I /usr/lib/ocaml/extlib -I /usr/lib/ocaml/gapi-ocaml -I /usr/lib/ocaml/netstring -I /usr/lib/ocaml/netsys -I /usr/lib/ocaml/sqlite3 -I /usr/lib/ocaml/threads -I /usr/lib/ocaml/yojson -I /usr/lib/ocaml/zarith -no-alias-deps -I src -o src/drive.cmo -c -impl src/drive.ml)
File "src/drive.ml", line 593, characters 24-28:
Error: The function applied to this argument has type
         ?base_url:string ->
         ?corpus:GapiDriveV3Service.FilesResource.Corpus.t ->
         ?spaces:string ->
         ?orderBy:string ->
         ?pageToken:string ->
         GapiConversation.Session.t ->
         GapiDriveV3Model.FileList.t * GapiConversation.Session.t
This argument cannot be applied with label ~supportsTeamDrives
d235j commented 6 years ago

@HelgeS you need a newer version of gapi-ocaml.

@astrada how does one use the new team drive functionality? I'd like to test it and got everything built.

astrada commented 6 years ago

@d235j I added team_drive_id= in config where you can put the id of the root folder of your team drive. You can get the id from the web interface, clicking on your team drive and copying the id you can find in the url (after https://drive.google.com/drive/folders/). I didn't implement a search by name because it requires admin privileges.

astrada commented 6 years ago

To install the new test version via opam, you can use the following commands:

opam pin -n add gapi-ocaml https://github.com/astrada/gapi-ocaml#master
opam pin -n add google-drive-ocamlfuse https://github.com/astrada/google-drive-ocamlfuse#beta
opam update
opam upgrade

to restore the stable version:

opam pin -n remove gapi-ocaml
opam pin -n remove google-drive-ocamlfuse
opam update
opam upgrade
astrada commented 6 years ago

I've managed to upload updated packages (google-drive-ocamlfuse v0.6.23/gapi-ocaml v0.3.6) for zesty and xenial. Unfortunately I wasn't able to update artful because the OCaml packages I depend on are broken and trusty because the OCaml compiler is too old and doesn't support the last changes I had to make for compatibility with the new OCaml compiler (4.06.0).

Tigerhacker commented 6 years ago

@astrada just trying to test this out, installed via the beta ppa repo and have put into the config file ~/.gdfuse/\<myLabelName>/config team_drive_id=0AF3...

for my team drive however I am not seeing a new folder appear. Where should the team drive appear, would it just appear as another folder under the mount point? Or am I missing some steps?

Thanks.

Tigerhacker commented 6 years ago

Ah, never mind, figured it out, for anyone else wondering, it appears you need to

So if you want to mount both your drive and a team drive, you will need to create separate labels for each

astrada commented 6 years ago

Thanks @Tigerhacker. I added a new wiki page with your instructions.

HelgeS commented 6 years ago

I managed to get it to work on my machine, too.

Great job, thank you so much!

Stepulin commented 6 years ago

Hi,

I would like to confirm that with version 0.6.23 adding team drive works. With version 0.6.21 the line team_drive_id= was always deleted after remounting the drive.

Nicely done! PS: I took the liberty and put steps for Debian Stretch that worked for me.

astrada commented 6 years ago

@Stepulin thanks!

h-evers commented 6 years ago

Confirm what @Stepulin said for 0.6.21 removing the "team_drive_id" at startup. Sadly building 0.6.23/24 on Ubuntu 17.10 (Artful) via "opam" is not possible due to "libselinux-dev" dependency error. Any idea?

rbroderi commented 6 years ago

I was able to manually download 0.6.24 package from https://launchpad.net/~alessandro-strada/+archive/ubuntu/ppa/+packages and install it on artful