Google-drive Filemanager

Browsers, email, chat, etc.
Message
Author
User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

Google-drive Filemanager

#1 Post by fredx181 »

*** Google-drive Filemanager ***

==============================================================
EDIT 2018-01-03: For a completely new version (v2, not compatible with earlier versions), see here:
http://murga-linux.com/puppy/viewtopic. ... 148#979148
2018-01-11, update of v2, multiple file section supported from main GUI, see:
http://murga-linux.com/puppy/viewtopic. ... 902#979902
2019-03-16, update of v2, see:
http://murga-linux.com/puppy/viewtopic. ... 85#1022085
2019-03-24, update of v1, see (and below links to portable v1 updated to v0.3.3):
http://murga-linux.com/puppy/viewtopic. ... 51#1023051
==============================================================

Very, very similar to: Dropbox Filemanager from mikeb, I took his GUI concept of a dual pane filemanager (thanks mikeb !!), but then made it for google-drive.

It makes use of the "drive" command line program (it's included in the packages for download below), see here:
https://github.com/odeke-em/drive
(it has tons of options, just basic options are used in Google-drive Filemanager)

Same as for Dropbox Filemanager, this has limitation also that only one file or folder can be selected for upload/download/delete (gtkdialog limitation)
One significant difference is that the 'profile' should be an existing directory (rather than just a name), e.g. /root or /mnt/sda2 (see also info by clicking Help button).
Also: downloading is restricted to that directory (or a subfolder of that directory)

First thing you need to do is to select an existing directory, then click 'New Profile'. A terminal will open and follow the instructions by pasting the URL in your browser, log in at your Google account, click 'Allow', copy the authorization code and paste in the terminal.
EDIT: To explain better: Select the (long) URL in the terminal, fire up your browser and 'paste' it in the address bar by doing mouse middle-click, login if required, click 'Allow', then just select the authorization code, go to the earlier opened terminal and 'paste' it in by mouse middle-click (and press ENTER).
(not sure, this can be hard to do when using touchpad, I always use mouse)

Note: 'Share Url' will give a link for direct download of a file , but the parent folder needs to be marked as 'Shared', otherwise it won't work
(this program can't do that at the moment, so it should be done from google-drive in browser)
(EDIT: changed that in v0.2.0, see below)

Update: v0.2.0
- 'Share Url' will automatically mark file or folder as shared (anyone with the link can view or download
- Added button 'Unshare' to undo that (NOT anyone with the link can view or download, login is required)
- Added tooltips for some buttons and changed Help text (according to above changes)

Update: Version 0.3.2, changes (compared to v0.3.1):
- No absolute dependency anymore for 'yad', if yad is installed there will be option for multiple file selection, if not, the program still runs, but supports single file selection only (thanks mikeb !)
- Fix for 'Add all', uploads folders also now (previously only files)
- Also 'Add all' will be processed in one terminal now (previously was spawning terminal for every file)
- If yad installed (and nothing selected in main GUI), the 'Add' button will give "file-selection" (previously was list) which is better IMO, to be able to browse files or folders for upload from everywhere

Download: googledrivegui pet packages v0.3.2: (from google-drive URL links of course, where else :) )
32-bit: https://drive.google.com/uc?export=down ... hFb0KWTlHb
64-bit: https://drive.google.com/uc?export=down ... gQp1yem8BH

Deb packages v0.3.2 (for e.g. DebianDog, Stretchdog, Xenialdog): :
32-bit: https://fredx181.github.io/StretchDog/i ... 2_i386.deb
64-bit: https://fredx181.github.io/StretchDog/a ... _amd64.deb

Here's also a portable version, recommended to extract at the top dir level of a partition, e.g. /mnt/sda2 (to have that partition as 'profile' and have download access to all that (including it's subfolders)
This contains the files 'gdrive_gui' (the executable script to launch the program) and 'drive' (a hidden directory '.gd' and hidden config file '.gdriverc' will be created in (same) profile dir after initiated profile dir).
Updated portable to v0.3.3: see info: http://murga-linux.com/puppy/viewtopic. ... 51#1023051
Portable v0.3.3:
32-bit .tar.gz: https://drive.google.com/uc?export=down ... 4bohZFIPNw
64-bit .tar.gz: https://drive.google.com/uc?export=down ... ty6wJPUAuG

See here for experimental version 0.3.0, with support for selecting multiple items (continued with v0.3.1. and higher)

Tested on Tahrpup (x-tahr) and Stretchdog, (and D-pup Stretch), not sure it works on other (older) puppies
It pops up rxvt or xterm for upload/download/delete, about the parameters, I'm not sure, please tell me if there's no terminal showing in case of download, upload, delete, and I'll try to fix it.
Update: Mike Walsh tested v0.2.0 on many puppies (see further in this thread): Tahr64 6.0.5, Tahr 6.0.6 (uefi), Xenialpup 7081, Upup Raring, Slacko 570, Racy 5.5, Lucid.
Works on all, but there can be a problem with authentication, (as is on Upup Raring), all that's required then is to update ca-certificates, Mike provided a pet for it, download:
http://www.mediafire.com/file/rc2e6drbf ... update.pet
EDIT: Also he provided mirrors for googledrivegui , see here: http://murga-linux.com/puppy/viewtopic. ... 447#977447

Fred
Attachments
googledrive_gui_0.2.0.png
v0.2.0
(135.67 KiB) Downloaded 2105 times
Last edited by fredx181 on Sun 24 Mar 2019, 13:02, edited 29 times in total.

dancytron
Posts: 1519
Joined: Wed 18 Jul 2012, 19:20

#2 Post by dancytron »

Works nicely.

Some instructions on the profile page on how copy/paste works in Xterm might help some people. It took me a few tries to remember.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#3 Post by fredx181 »

dancytron wrote:Works nicely.

Some instructions on the profile page on how copy/paste works in Xterm might help some people. It took me a few tries to remember.
Thanks Dan !
Yeah, I assume you mean the select <> middle-click thing, for now I edited first post (see EDIT:) to make that more clear.

Fred

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#4 Post by mikeb »

Excellent...spread the love :)

mike

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#5 Post by fredx181 »

Updated to v0.2.0, (mostly change for share options) see for changes info and download at first post.

Fred

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#6 Post by Mike Walsh »

Fred, this is excellent. Thank you.

I never thought I'd see it, TBH. It's the Puppy version of the old Ubuntu 'Grive' client. And it's working extremely well in Tahr 64.

(Make sure you give Mike the credit he deserves, too!)

Well done, both of you. Thanks are due all round. Oh, one question while I think of it... Is there a minimum glibc requirement for this, or owt like that? This would be a good addition to the rest of the kennels.....which are all 32-bit.


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#7 Post by fredx181 »

Thank you Mike !
(Make sure you give Mike the credit he deserves, too!)
Yes, I thanked him much too many times, he deserves only one... :lol: :lol:
No... seriously, look in his Dropbox GUI topic and you'll see.
Great concept by mikeb indeed !
Oh, one question while I think of it... Is there a minimum glibc requirement for this, or owt like that? This would be a good addition to the rest of the kennels.....which are all 32-bit.
I tested on Debian Wheezy, which has glibc 2.13 and works fine (pleasantly surprised about that, to be honest I didn't expect that), don't know about in case of older glibc than 2.13.

Fred

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#8 Post by Mike Walsh »

Hi again, Fred.

Perhaps my exuberance was premature...

As I said, the 64-bit version is working fine. Upon trying to install to one of the 32-bit Pups (in this case, Upup Raring (glibc 2.17)), I can't get the profile to set up correctly.

I follow the set-up procedure; get the authorization code from Google, paste it into the terminal, and hit 'Enter'. In Tahr64, I then had another terminal window, while it was doing something (possibly corroborating that code?), and then the GUI came back, with my Drive folders in the right-hand pane. As you would expect.

All that happens in the 32-bit version is that it immediately returns to the GUI, with nothing showing in the right-hand pane. Upon trying 'Rescan', it pops-up a window telling me no profile has been initiated, and to go back and start again.

I tried this half-a-dozen times, with identical results. I then tried, in succession, Slacko 570, Precise 571, and Slacko 560 (all glibc 2.15). Still no go. Same thing in all of them.

I guess feedback is what you're after, yes? I know it always helps me with packages I produce.

[Tried the 'portable' version, too. Same results.]

Thoughts? Or am I doing summat wrong.....and 'can't see the wood for the trees'..?? :lol:

(EDIT:- Of course, it's always possible Google won't permit access to your Drive from multiple apps using the same IP address. What d'you reckon?)

My eventual intention is to have the 32-bit version running in as many Pups as possible, sym-linked from my remote 'Data' partition, and all utilising the same, common profile. It works fine for many other apps; no reason it shouldn't work for this.



Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#9 Post by fredx181 »

Hi Mike,

Sure, feedback appreciated, I'd like it to work for everyone on all Linux systems.
As said, I tested earlier only on Tahrpup and Stretchdog, but just now I made a testing round in different OS's
On Slacko, Xenialpup, D-pup Stretch, Linux Mint (full install), (Debian) Wheezy, XenialDog and Raringpup
On all it worked fine for me, except on... Raring :(
I have no clue, why not on raring, the authorization just doesn't work, tried without using the GUI (just with the 'drive' command), also no go.

When running from terminal on raring, the error messages are:
Trying to initiate new profile dir, authentication fails

Code: Select all

Get https://www.googleapis.com/drive/v2/files/root?alt=json: oauth2: token expired and refresh token is not set: '/'
Trying to use an already initated profile (I had made already for /mnt/sda5, works fine in all systems except for raring)

Code: Select all

Get https://www.googleapis.com/drive/v2/files/root?alt=json: Post https://accounts.google.com/o/oauth2/token: x509: failed to load system roots and no roots provided: '/'
Anyone has idea what can be wrong here ?
(EDIT:- Of course, it's always possible Google won't permit access to your Drive from multiple apps using the same IP address. What d'you reckon?)
I think my tests are proving that can't be a problem.
Also I guess that the glibc version has nothing to do with the problem on raring. (but I may be wrong)

Can you test on other (older) puppies maybe ?

EDIT: After some googling, found a fix for raring, ca-certificates missing (well, works for me), in terminal:

Code: Select all

mkdir -p /etc/ssl/certs/
curl -k -o /etc/ssl/certs/ca-certificates.crt https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt
And try initiating profile again, maybe best to remove first the hidden folder: ".gd"

Fred
Last edited by fredx181 on Sat 16 Dec 2017, 11:18, edited 1 time in total.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#10 Post by Mike Walsh »

Morning, Fred!

Curiouser and curiouser.

The 32-bit version runs fine in Tahr 6.0.6 (uefi) and Xenialpup 7081. Both of these use the newer urxvt terminal, with which you can visit the Google page for authorization simply by clicking on the link itself. By using this, it appears to set itself up correctly.

Older Pups, using rxvt, seem to be the ones with the problem here. I need to follow your instructions in post #1, and copy'n'paste the address directly into the browser bar.....and for older Pups (on my system at least), this seems to be where the setup process breaks.

I know this is outside the scope of this thread, but is there a way to install the newer version of the terminal in older Pups? It might fix this.....and I prefer the newer version anyway, since appearance is customizable. In rxvt, although I've tried, changes don't seem to 'stick'.

Food for thought, perhaps?


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#11 Post by fredx181 »

Hi Mike, edited my previous post (found a fix for raring) at the same time you just posted.

Fred

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#12 Post by Mike Walsh »

Hmm. Yeah. Certificates. Now why didn't I think of that?

Google are, as we all know, almost paranoid about insisting everything be as up-to-date as possible.

Do we have a way to update certificates for Pup.....or might it just be as simple as making sure you use a newer browser? I tend to use Chrome 48 (the final 32-bit version) as default in all my 32-bitzers, although I do have much newer versions of SlimJet and Iron installed in all of them.

What d'you think? Worth trying? Are certificates contained within the browser itself.....or do they get read from some other location?

EDIT:- Just read your update above. I'm going to try copying over the contents of Tahr or Xenial's /etc/ssl/certs to one or two older Pups; I'll get back to you in a little while. Bear with me.

EDIT2:- Nope, they're all symlinks to somewhere else that I can't find..! I'll run your script, and get the (newest?) bundle, and take it from there...

Back soon.


Mike. :wink:
Last edited by Mike Walsh on Sat 16 Dec 2017, 12:51, edited 2 times in total.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#13 Post by fredx181 »

Mike Walsh wrote:What d'you think? Worth trying? Are certificates contained within the browser itself.....or do they get read from some other location?
Don't know much about it but I don't think they are contained in the browser.
On Debian and Ubuntu there's package "ca-certificates" and part of that package installs in /etc/ssl/certs/
And apparently the commands in my earlier post do a similar job.

Fred

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#14 Post by Mike Walsh »

Hi again, Fred.

We have (wait for it, wait for it)..... Success!!

I ran your curl script in VoxPup (this is greengeek's 'spin' on Upup Raring), and installed the certs package to /etc/ssl/certs. Ran the 'New Profile' script again, and.....it's all working beautifully.

I then moved/symlinked back /root/.gd & /root/.gdriverc to my remote data partition. While I was in Raring, I made up a 'sym-links' .pet for GDrive_gui (basically, this just installs all necessary sym-links to the remote partition, so that Pup sees it as installed locally. Davids45 and I have been experimenting with this in recent days, since we both run a lot of stuff 'remotely' like this, and it speeds up 'installation' when we try out new Pups.)

Re-booted into Slacko 570, installed the sym-links .pet, and.....initially, it wasn't behaving itself. I had a look in /root, and realized that /root/.gd was still there from last night's failed attempt.....so I deleted it, and re-established the sym-link (because a sym-link doesn't 'overwrite' an existing file, does it?) Fired up GDrive_gui again, and.....

Bingo. Working sweetly.

Re-booted into Racy 5.5 this time. I deleted the contents of /etc/ssl/certs, 'cos I know this is all old stuff, and I've been meaning to update it for a while. Installed the sym-links .pet again, and, once again, success.

Working fine in Racy!

So, to re-cap:-

Currently works fine in

Tahr64 6.0.5
Tahr 6.0.6 (uefi)
Xenialpup 7081
Upup Raring
Slacko 570
Racy 5.5

This bodes well for this project, Fred. From all this, I conclude that it should work in pretty much all 5-series Pups, at least.

Once again, excellent work, mate. A very neat addition to Pup's arsenal. Cheers!


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#15 Post by fredx181 »

Haha.., that's good news, thanks Mike !!

Fred

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#16 Post by Mike Walsh »

Well, it never hurts to keep your certificates up-to-date, anyway.....and it'll help with whatever browsers folks are running.

I'm betting the 'problem kiddies' are like as not either Verisign or Google's own relatively new Root Certificate Authority. They seem have to have a finger in almost every pie between them, these days.

Might be an idea to also provide the updated certificates as a .pet package, perhaps? With the proviso to delete the existing contents of /etc/ssl/certs (if necessary) first, before installing. (This latter step for those Pups where GDrive_gui apparently doesn't want to work, since this is almost certainly the solution.)

I'll be trying it out in Lucid after lunch. Will report back.


Mike. :wink:

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#17 Post by Mike Walsh »

Hi, Fred.

Well, it's working a treat in Lucid, too!

I've made up a .pet for the updated certificates, for easier install for those who don't like using the terminal. Together with mirrored .pets, .debs, and portables, they can all be found here:-

http://www.mediafire.com/folder/ct3foc5 ... GDrive_gui

I don't think there's a 5-series Puppy this won't work in. I can't comment on the 4-series, and older; for one thing, I've never tried them.....and for another, I know quite a number of things changed during the transition from one to t'other.

Be nice to get some feedback from users of 4-series Pups, no?


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#18 Post by fredx181 »

Mike Walsh wrote:Well, it's working a treat in Lucid, too!
....
....
OK, nice !
I compiled the "drive" binaries in Debian Stretch and I'm a bit surprised that it seems to work everywhere, maybe it has to do with the fact that it's "go" language based (just guessing, don't know anything about it, I must admit)

Added in short your test results and link to your CA-certs-update .pet at the end of first post, thanks again :)

Fred

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#19 Post by watchdog »

It works in puppy 4.31, too. Thanks!

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#20 Post by Mike Walsh »

Mike Walsh wrote:I can't comment on the 4-series, and older; for one thing, I've never tried them.....and for another, I know quite a number of things changed during the transition from one to t'other.

Be nice to get some feedback from users of 4-series Pups, no?
-----***-----
watchdog wrote:It works in puppy 4.31, too. Thanks!
>>>>> There you go..... :)


Mike. :wink:

Post Reply