Skip to content

Commit 866fb49

Browse files
committed
Updated documentation for recent changes.
1 parent 602c4c2 commit 866fb49

File tree

1 file changed

+54
-56
lines changed

1 file changed

+54
-56
lines changed

gdrivefs/resources/README.rst

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,15 @@
55
GDriveFS is an innovative *FUSE* wrapper for *Google Drive*.
66

77

8-
------------
9-
Design goals
10-
------------
8+
--------------
9+
Latest Changes
10+
--------------
11+
12+
- Though you can still use the previous authorization flow, there is now a very simple authorization flow that may be used instead by using the 'auth_automatic' subcommand on the 'gdfstool'. Whe you run this command, the browser will automatically be opened, you may or may not be prompted for authorization by Google, a redirection will occur, and we will then automatically record the authorization code. GDFS will temporarily open a small webserver on a random port in order to receive the response. **This effectively makes authorization a one-step process for the user.** See below for more details.
1113

12-
+-------------------------------------------------------------------+-------+
13-
| Goal | Done |
14-
+===================================================================+=======+
15-
| Thread for monitoring changes via "changes" functionality of API. | X |
16-
+-------------------------------------------------------------------+-------+
17-
| Complete stat() implementation. | X |
18-
+-------------------------------------------------------------------+-------+
19-
| Seamlessly work around duplicate-file allowances in *Google | X |
20-
| Drive*. | |
21-
+-------------------------------------------------------------------+-------+
22-
| Seamlessly manage file-type versatility in *Google Drive* | X |
23-
| (*Google Doc* files do not have a particular format). | |
24-
+-------------------------------------------------------------------+-------+
25-
| Allow for the same file at multiple paths. | X |
26-
+-------------------------------------------------------------------+-------+
27-
28-
Also, a design choice of other implementations is to make the user get API keys
29-
for *Google Drive*, and this doesn't make sense. Our implementation is built
30-
against *OAuth 2.0* as a native application. You should just have to visit the
31-
authorization URL once, plug-in the auth-code, and be done with it.
14+
- There is now a default file-path for the credentials ("auth storage file"). Just use "default" and "$HOME/.gdfs/creds" will be the file-path used. See below for more details.
15+
16+
- The 'auth' subcommand on the 'gdfstool' command is now obsolete. Though you may continue to use this subcommand, please start using the 'auth_get_url' and 'auth_write' subcommands as this subcommand will be removed in the future.
3217

3318

3419
---------
@@ -79,58 +64,74 @@ The versions of a couple of dependencies are relaxed during a normal installatio
7964
Usage
8065
-----
8166

67+
Overview
68+
========
69+
8270
Before you can mount the account, you must authorize *GDriveFS* to access it.
8371
*GDriveFS* works by producing a URL that you must visit in a browser. Google
8472
will ask for your log-in information and authorization, and then give you an
8573
authorization code. You then pass this code back to the *GDriveFS* utility
8674
along with a file-path of where you want it to store the authorization
87-
information ("auth storage file"). Then, you can mount it whenever you'd like.
75+
information ("auth storage file" or "credentials file"). Then, you can mount it
76+
whenever you'd like.
8877

8978
Since this is *FUSE*, you must be running as root to mount.
9079

91-
1. To get an authorization URL::
9280

93-
$ gdfstool auth -u
94-
To authorize FUSE to use your Google Drive account, visit the following URL to produce an authorization code:
81+
Credentials File
82+
================
9583

96-
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=626378760250.apps.googleusercontent.com&access_type=offline
84+
Also referred to as the "auth storage" file.
9785

98-
2. To set the authorization-code, you must also provide the auth-storage file
99-
that you would like to save it as. The name and location of this file is
100-
arbitrary::
86+
In previous versions, you were required to provide a file-path to write and read the authorization code to. There is now a default ($HOME/.gdfs/creds). Just literally use the string "default" whereever the credentials file-path is required in order to use this default file-path.
10187

102-
$ gdfstool auth -a /var/cache/gdfs.creds "4/WUsOa-Sm2RhgQtf9_NFAMMbRC.cj4LQYdXfshQV0ieZDAqA-C7ecwI"
88+
89+
Automatic Authorization Flow
90+
----------------------------
91+
92+
There is now a simplified flow that will automatically open the system Web browser, do any authentication necessary, and automatically write the authorization-code to disk::
93+
94+
$ gdfstool auth_automatic
10395
Authorization code recorded.
10496

105-
3. There are three ways to mount the account:
97+
$ gdfs default /mnt/gdrivefs
10698

107-
- Via script::
99+
This automatic flow will require GDFS to temporarily start a small, internal webserver on the first available port.
108100

109-
Mount::
110101

111-
$ gdfs -o allow_other /var/cache/gdfs.creds /mnt/gdrivefs
102+
Manual Authorization Flow
103+
-------------------------
112104

113-
Unmount::
114105

115-
$ umount /mnt/gdrivefs
106+
If you need to manually get the URL, browse to it, get the authorization code, and then call the 'auth_write' subcommand to store it:
116107

117-
- Via */etc/fstab*::
108+
1. To get an authorization URL::
109+
110+
$ gdfstool auth_get_url
111+
To authorize FUSE to use your Google Drive account, visit the following URL to produce an authorization code:
118112

119-
Make the symlink::
113+
https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&client_id=626378760250.apps.googleusercontent.com&access_type=offline
114+
115+
2. To set the authorization-code, you must also provide the auth-storage file
116+
that you would like to save it as. The name and location of this file is
117+
arbitrary::
120118

121-
$ sudo ln -s `which gdfs` /sbin/mount.gdfs
119+
$ gdfstool auth_write "4/WUsOa-Sm2RhgQtf9_NFAMMbRC.cj4LQYdXfshQV0ieZDAqA-C7ecwI"
120+
Authorization code recorded.
122121

123-
Add the entry to /etc/fstab::
124122

125-
/var/cache/gdfs.creds /mnt/gdrivefs gdfs allow_other 0 0
123+
Mounting
124+
========
126125

127-
Mount::
126+
Once you're ready to mount::
128127

129-
$ mount /mnt/gdrivefs
128+
$ gdfs -o allow_other default /mnt/gdrivefs
130129

131-
Unmount::
130+
Or, if you would like to register it in /etc/fstab::
132131

133-
$ umount /mnt/gdrivefs
132+
$ ln -s `which gdfs` /sbin/mount.gdfs
133+
$ echo "default /mnt/gdrivefs gdfs allow_other 0 0" >> /etc/fstab
134+
$ mount /mnt/gdrivefs
134135

135136

136137
Optimization
@@ -140,13 +141,13 @@ By default, FUSE uses a very conservative block-size. On systems that support it
140141

141142
To use this, pass "big_writes" in the "-o" option-string::
142143

143-
$ sudo gdfs -o big_writes /var/cache/gdfs.creds /mnt/gd
144+
$ sudo gdfs -o big_writes /home/user/.gdfs/creds /mnt/gdrivefs
144145

145146

146147
Vagrant
147148
=======
148149

149-
A Vagrantfile has been made available in the event that you'd like to mount your account from a system that isn't FUSE compatible (like Mac), or you're having issues installing GDriveFS somewhere else and would like to debug.
150+
A Vagrantfile has been made available in the event that you would like to mount your account from a system that isn't FUSE compatible (like a Mac) or you are having issues installing GDriveFS somewhere else and would like to debug.
150151

151152
To install Vagrant::
152153

@@ -177,7 +178,7 @@ To start and provision the instance::
177178
==> default:
178179
==> default: Once you have retrieved your authorization string, run:
179180
==> default:
180-
==> default: sudo gdfstool auth -a /var/cache/gdfs.creds <auth string>
181+
==> default: sudo gdfstool auth_write <authcode>
181182
==> default:
182183

183184
This may take a few more minutes the first time, as it might need to acquire the Ubuntu 14.04 image if not already available.
@@ -198,10 +199,10 @@ Mounting GDFS in debugging-mode will run GDFS in the foreground, and enable debu
198199

199200
Just set the `GD_DEBUG` environment variable to "1"::
200201

201-
root@vagrant-ubuntu-trusty-64:/home/vagrant# GD_DEBUG=1 gdfs /var/cache/gdfs.creds /mnt/g
202+
root@vagrant-ubuntu-trusty-64:/home/vagrant# GD_DEBUG=1 gdfs /home/user/.gdfs/creds /mnt/g
202203
2014-12-09 04:09:17,204 [gdrivefs.utility INFO] No mime-mapping was found.
203204
2014-12-09 04:09:17,204 [gdrivefs.utility INFO] No extension-mapping was found.
204-
2014-12-09 04:09:17,258 [__main__ DEBUG] Mounting GD with creds at [/var/cache/gdfs.creds]: /mnt/g
205+
2014-12-09 04:09:17,258 [__main__ DEBUG] Mounting GD with creds at [/home/user/.gdfs/creds]: /mnt/g
205206
2014-12-09 04:09:17,259 [root DEBUG] Debug: True
206207
2014-12-09 04:09:17,260 [root DEBUG] PERMS: F=777 E=666 NE=444
207208
2014-12-09 04:09:17,262 [gdrivefs.drive DEBUG] Getting authorized HTTP tunnel.
@@ -481,10 +482,7 @@ own quotes/etc.., it was more difficult to make sense of the values.
481482
Misc Notes
482483
----------
483484

484-
- A file will be marked as hidden on *Google Drive* if it has a prefixing dot.
485-
However, Linux/Unix doesn't care about the "hidden" attribute. If you create a
486-
file on *Google Drive*, somewhere else, and want it to truly be hidden via this
487-
software, make sure you add the prefixing dot.
485+
- A file will be marked as hidden on *Google Drive* if it has a prefixing dot. However, Linux/Unix doesn't care about the "hidden" attribute. If you create a file on *Google Drive*, somewhere else, and want it to truly be hidden via this software, make sure you add the prefixing dot.
488486

489487
- If you have a need to do a developer install, use "pip install -e" rather than "python setup.py develop". The latter will [now] break because of the dependencies that are eggs.
490488

0 commit comments

Comments
 (0)