integration_google icon indicating copy to clipboard operation
integration_google copied to clipboard

added shared drives option

Open maxcalandrelli opened this issue 4 years ago • 10 comments

Signed-off-by: Massimiliano Calandrelli [email protected]

I needed to synchronize files in a shared drive and I discovered they were not supported. I added minimal support for this scenario to v1.0.2. Since I have too little experience with GDrive API, I preferred to introduce a separate option for that.

maxcalandrelli avatar Jul 06 '21 08:07 maxcalandrelli

Thanks a lot for this PR. Did you actually try it?

Code looks fine. I just need to make some real life testing and it's good to be merged!

julien-nc avatar Jul 06 '21 09:07 julien-nc

Well, it worked at least once :-)

Il Mar 6 Lug 2021, 11:39 Julien Veyssier @.***> ha scritto:

Thanks a lot for this PR. Did you actually try it?

Code looks fine. I just need to make some real life testing and it's good to be merged!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nextcloud/integration_google/pull/65#issuecomment-874615541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANSUOBROUZVPFB2WQSHYW3TWLFO7ANCNFSM474B5ZMA .

maxcalandrelli avatar Jul 06 '21 09:07 maxcalandrelli

How do you share a drive? Does it require to own a special google account with domain-specific management and other enterprise stuff?

For the moment I can't try your changes :grin:.

julien-nc avatar Jul 06 '21 14:07 julien-nc

Yes, you have to subscribe to google business services. In my personal account I have no such option, but in my company's one there is a "shared drives" menu entry just below "my drive".

Il giorno mar 6 lug 2021 alle ore 16:17 Julien Veyssier < @.***> ha scritto:

How do you share a drive? Does it require to own a special google account with domain-specific management and other enterprise stuff?

For the moment I can't try your changes 😁.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nextcloud/integration_google/pull/65#issuecomment-874800555, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANSUODGMM6RWG5TPQ474CTTWMF65ANCNFSM474B5ZMA .

maxcalandrelli avatar Jul 06 '21 14:07 maxcalandrelli

Would you be able to share a test drive to my test account? ([email protected])

julien-nc avatar Jul 06 '21 14:07 julien-nc

I shared a drive named "Test". Let me know when you've finished with it. Thanks.

Il giorno mar 6 lug 2021 alle ore 16:40 Julien Veyssier < @.***> ha scritto:

Would you be able to share a test drive to my test account? ( @.***)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nextcloud/integration_google/pull/65#issuecomment-874820269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANSUOGZACI63XZFGK4O76DTWMIVTANCNFSM474B5ZMA .

maxcalandrelli avatar Jul 06 '21 16:07 maxcalandrelli

Thanks for the shared drive. I've unchecked "Ignore shared Drives" and "Ignore shared files". I don't get the 2 pdf files in your drive when i import with the app. I'll investigate that soon.

julien-nc avatar Jul 07 '21 12:07 julien-nc

You are right, I think the code currently works only if you are a member of the organization: simply being allowed to access a shared drive is not enough. I will try a more complex setup and see if I can understand why.

Il giorno mer 7 lug 2021 alle ore 14:42 Julien Veyssier < @.***> ha scritto:

Thanks for the shared drive. I've unchecked "Ignore shared Drives" and "Ignore shared files". I don't get the 2 pdf files in your drive when i import with the app. I'll investigate that soon.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nextcloud/integration_google/pull/65#issuecomment-875570047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANSUOBJ3IKL2V4BJISSCBDTWRDSDANCNFSM474B5ZMA .

maxcalandrelli avatar Jul 08 '21 08:07 maxcalandrelli

I've attempted to rebase your change onto current master, then built on Ubuntu:21.10 with make in repository's root. Then I just replaced directory /var/www/html/custom_apps/integration_google with what I got after build.

After that I see a lot of exceptions like:

NOTICE: PHP message: [owncloud][PHP][3] {"Exception":"Error","Message":"Undefined array key \"ownedByMe\" at /var/www/html/custom_apps/integration_google/lib/Service/GoogleDriveAPIService.php#133","Code":0,"Trace":[{"file":"/var/www/html/custom_apps/integration_google/lib/Service/GoogleDriveAPIService.php","line":133,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"Undefined array key \"ownedByMe\"","/var/www/html/custom_apps/integration_google/lib/Service/GoogleDriveAPIService.php",133]},{"file":"/var/www/html/custom_apps/integration_google/lib/Controller/GoogleAPIController.php","line":169,"function":"getDriveSize","class":"OCA\\Google\\Service\\GoogleDriveAPIService","type":"->","args":["<REDACTED_some_long_7id-like_string>","<My_username_in_nextcloud>"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getDriveSize","class":"OCA\\Google\\Controller\\GoogleAPIController","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Google\\Controller\\GoogleAPIController"},"getDriveSize"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Google\\Controller\\GoogleAPIController"},"getDriveSize"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Google\\Controller\\GoogleAPIController","getDriveSize",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"integration_google.googleAPI.getDriveSize"}]},{"file":"/var/www/html/lib/base.php","line":1006,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/integration_google/drive-size"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}

The Google I account I've connected is corporate one. With latest integration_google files import works fine but I'd like to get shared drives imported too. What's the issue? Is the re a way to fix it? I might have built the extension incorrectly but there is no info about local building in README.

k-popov avatar Apr 26 '22 12:04 k-popov

Again I tried to rebase this pull request to master and to v1.0.6 and tried to run on my NextCloud (23.0.4) instance using S3 as user data storage. I'm getting the below exception:

[owncloud][core][3] {"Exception":"Exception","Message":"Bucket has to be configured.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/ObjectStore/S3.php","line":33,"function":"parseParams","class":"OC\\Files\\ObjectStore\\S3","type":"->","args":[{"bucket":false,"autocreate":false,"key":false,"secret":false,"hostname":"storage.yandexcloud.net","region":"ru-central1","use_ssl":true,"use_path_style":true}]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":128,"function":"__construct","class":"OC\\Files\\ObjectStore\\S3","type":"->","args":[{"bucket":false,"autocreate":false,"key":false,"secret":false,"hostname":"storage.yandexcloud.net","region":"ru-central1","use_ssl":true,"use_path_style":true}]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":290,"function":"initObjectStoreRootFS","class":"OC_Util","type":"::","args":[{"class":"\\OC\\Files\\ObjectStore\\S3","arguments":{"bucket":false,"autocreate":false,"key":false,"secret":false,"hostname":"storage.yandexcloud.net","region":"ru-central1","use_ssl":true,"use_path_style":true}}]},{"file":"/var/www/html/lib/private/legacy/OC_Util.php","line":320,"function":"setupRootFS","class":"OC_Util","type":"::","args":["popov.ks"]},{"file":"/var/www/html/custom_apps/integration_google/lib/Service/UserScopeService.php","line":66,"function":"setupFS","class":"OC_Util","type":"::","args":["popov.ks"]},{"file":"/var/www/html/custom_apps/integration_google/lib/Service/GoogleDriveAPIService.php","line":184,"function":"setFilesystemScope","class":"OCA\\Google\\Service\\UserScopeService","type":"->","args":["popov.ks"]},{"file":"/var/www/html/custom_apps/integration_google/lib/BackgroundJob/ImportDriveJob.php","line":38,"function":"importDriveJob","class":"OCA\\Google\\Service\\GoogleDriveAPIService","type":"->","args":["popov.ks"]},{"file":"/var/www/html/lib/public/BackgroundJob/Job.php","line":79,"function":"run","class":"OCA\\Google\\BackgroundJob\\ImportDriveJob","type":"->","args":[{"user_id":"popov.ks"}]},{"file":"/var/www/html/lib/public/BackgroundJob/QueuedJob.php","line":47,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"},{"__class__":"OC\\Log"}]},{"file":"/var/www/html/cron.php","line":150,"function":"execute","class":"OCP\\BackgroundJob\\QueuedJob","type":"->","args":[{"__class__":"OC\\BackgroundJob\\JobList"},{"__class__":"OC\\Log"}]}],"File":"/var/www/html/lib/private/Files/ObjectStore/S3ConnectionTrait.php","Line":70,"CustomMessage":"Error while running background job (class: OCA\\Google\\BackgroundJob\\ImportDriveJob, arguments: Array\n(\n    [user_id] => popov.ks\n)\n)"

UPD: Please ignore this issue - I have S3 backend configured via environment variables and the cronjob did not have these variables, tried to load config, and thus was receiving false as values.

k-popov avatar Apr 28 '22 20:04 k-popov

@maxcalandrelli Are you still insterested in working on this? I will close this for now as it is stale for quite some time.

marcelklehr avatar May 15 '24 09:05 marcelklehr