Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Import wiki pages * Update README (including upgrade instructions)
- Loading branch information
Showing
4 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
### Standard authorization mode | ||
|
||
Authorization is provided by a Google App Engine service (the source code of | ||
the service is [here](https://github.com/astrada/gd-ocaml-auth)). When you | ||
start the program without specifying a mountpoint, | ||
|
||
$ google-drive-ocamlfuse | ||
|
||
the executable opens a web browser (using `xdg-open`, or, if `xdg-open` is not | ||
available, launching `firefox` or `google-chrome`), showing a page that will | ||
ask you to authorize access to your Google Drive. If you allow it, the Google | ||
authorization endpoint will connect to the GAE service, providing a | ||
verification code, that will be exchanged for an access token and a refresh | ||
token (for offline access). Meanwhile, `google-drive-ocamlfuse` polls the GAE | ||
service, asking for tokens, until it gets them, or there is an error, or a | ||
timeout triggers. If anything goes wrong, you can safely restart the | ||
application, and it will try to recover. If it cannot recover, you should | ||
clean the content of `~/.gdfuse/default` to start from scratch. Otherwise, if | ||
the application can retrieve the tokens, the program will exit and you may | ||
then mount the Google Drive filesystem. `google-drive-ocamlfuse` will also use | ||
the GAE service when it needs to refresh the access token (access tokens | ||
usually are valid for 60 minutes). The GAE service has two purposes: to make | ||
the authorization process simpler (removing all manual steps), and to avoid | ||
exposing the OAuth2 client secret of the application (otherwise anyone can | ||
impersonate it). | ||
|
||
### Alternative authorization mode | ||
|
||
If you don't trust the GAE service, there is an alternative way to authorize | ||
the application, that doesn't involve external services. If you have your own | ||
OAuth2 client ID and client secret, you may pass them on the command line (the | ||
first time you issue the application), e.g.: | ||
|
||
$ google-drive-ocamlfuse -client_id 12345678.apps.googleusercontent.com -client_secret abcde12345 | ||
|
||
This way, the application will use your credentials, and will not connect to | ||
the GAE service. A browser will be started pointing to an authorization page, | ||
and when you allow access to Google Drive, a verification code will be | ||
generated. You have to copy this verification code, and paste it in the | ||
console where the application is running. | ||
|
||
Please enter the verification code: 1/12309afhaskfhlskhfklsfslkhfskhfskskdfh | ||
|
||
If everything goes fine, the application will notify you that it has retrieved | ||
the tokens from Google. | ||
|
||
Access token retrieved correctly. | ||
|
||
You can create OAuth2 credentials from the Google APIs Console. | ||
[Here](https://developers.google.com/console/help/#creatingdeletingprojects) | ||
you can find how to create a new application and how to set up OAuth 2.0 | ||
credentials. When creating a new client ID, you must select "Installed | ||
applications" as Application type and "Other" as Installed application type | ||
(Redirect URI should be `urn:ietf:wg:oauth:2.0:oob`). | ||
|
||
### Revoking access | ||
|
||
Anyway, you can always revoke access to Google Drive from | ||
[here](https://accounts.google.com/b/0/IssuedAuthSubTokens). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
The configuration file is saved in `~/.gdfuse/default/config` (or `~/.gdfuse/label/config` if a label was specified on the command line). The parser is very simple and only accepts lines in the form `key=value`, without spaces, comments, or anything else. | ||
|
||
### Content | ||
|
||
Specifies if debug mode is turned on: if `true`, logs verbose output to `~/.gdfuse/default/gdfuse.log`, and logs every curl request to `~/.gdfuse/default/curl.log`: | ||
|
||
debug=true | ||
|
||
Specifies the interval in seconds between queries to detect server-side changes: | ||
|
||
metadata_cache_time=60 | ||
|
||
Specifies if the filesystem is to be mounted read-only (at this moment, write support is not yet implemented): | ||
|
||
read_only=true | ||
|
||
Specifies the umask (i.e. the bitmask of the permissions that are not present) mount option: | ||
|
||
umask=0o002 | ||
|
||
Specifies the Sqlite3 busy handler timeout in milliseconds: | ||
|
||
sqlite3_busy_timeout=500 | ||
|
||
Specifies whether to download Google Docs (these files are read-only, even if `read_only=false`): | ||
|
||
download_docs=true | ||
|
||
Text document [export format](https://developers.google.com/google-apps/documents-list/#valid_download_formats_for_text_documents): | ||
|
||
document_format=odt | ||
|
||
Drawings [export format](https://developers.google.com/google-apps/documents-list/#valid_download_formats_for_drawings): | ||
|
||
drawing_format=png | ||
|
||
Forms [export format](https://developers.google.com/google-apps/documents-list/#valid_formats_for_spreadsheets): | ||
|
||
form_format=ods | ||
|
||
Presentations [export format](https://developers.google.com/google-apps/documents-list/#valid_formats_for_presentations): | ||
|
||
presentation_format=pdf | ||
|
||
Spreadsheets [export format](https://developers.google.com/google-apps/documents-list/#valid_formats_for_spreadsheets): | ||
|
||
spreadsheet_format=ods | ||
|
||
OAuth2 client ID (optional) | ||
|
||
client_id= | ||
|
||
OAuth2 client secret (optional) | ||
|
||
client_secret= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Welcome to the google-drive-ocamlfuse wiki! | ||
|
||
* [[Authorization]] | ||
* [[Configuration]] |