|
1 | | -The first time, you can run `google-drive-ocamlfuse` without parameters: |
| 1 | +First, you must [set up OAuth |
| 2 | +2.0](https://support.google.com/cloud/answer/6158849?hl=en): |
2 | 3 |
|
3 | | - google-drive-ocamlfuse |
| 4 | +1. [Activate](https://cloud.google.com/service-usage/docs/enable-disable) the |
| 5 | + `Google Drive API`. |
| 6 | +1. Create an OAuth client ID. |
| 7 | +1. Choose `Desktop` as `Application type`. |
| 8 | +1. Set the `Name` to anything you like. |
4 | 9 |
|
5 | | -This command will create the default application directory (`~/.gdfuse/default`), containing the configuration file `config` (see the [[Configuration]] page for more details about configuration). And it will start a web browser to obtain authorization to access your Google Drive. This will let you modify default configuration before mounting the filesystem. |
| 10 | +This way you will get a `Client ID` and `Client secret` that you can use to |
| 11 | +access your Drive. To authorize `google-drive-ocamlfuse`, pass the client ID |
| 12 | +and the client secret on the command line, e.g.: |
6 | 13 |
|
7 | | -Then you can choose a local directory to mount your Google Drive (e.g.: `~/GoogleDrive`). |
| 14 | + google-drive-ocamlfuse -id xxxxxxxxxx.apps.googleusercontent.com -secret XXX-YYY-ZZZ |
| 15 | + |
| 16 | +This command will create the default application directory |
| 17 | +(`~/.gdfuse/default`), containing the configuration file `config` (see the |
| 18 | +[wiki |
| 19 | +page](https://github.com/astrada/google-drive-ocamlfuse/wiki/Configuration) |
| 20 | +for more details about configuration). And it will start a web browser to |
| 21 | +obtain authorization to access your Google Drive. This way, you can modify the |
| 22 | +default configuration before mounting the filesystem. |
| 23 | + |
| 24 | +Then, you can choose a local directory to mount your Google Drive (e.g.: `~/GoogleDrive`). |
8 | 25 |
|
9 | 26 | Create the mount point, if it doesn't exists: |
10 | 27 |
|
11 | 28 | mkdir ~/GoogleDrive |
12 | 29 |
|
13 | | -Then you can mount the filesystem: |
| 30 | +Then, you can mount the filesystem: |
14 | 31 |
|
15 | 32 | google-drive-ocamlfuse ~/GoogleDrive |
16 | 33 |
|
17 | 34 | If you have more than one account, you can run: |
18 | 35 |
|
19 | | - google-drive-ocamlfuse -label label [mountpoint] |
| 36 | + google-drive-ocamlfuse -label [label] ~/GoogleDrive |
20 | 37 |
|
21 | | -Using `label` to distinguish between different accounts. The program will use the directory `~/.gdfuse/label` to host configuration, application state, and file cache. No file is shared among different accounts, so you can have a different configuration for each one. |
| 38 | +Using `label` to distinguish different accounts. The program will use the |
| 39 | +directory `~/.gdfuse/[label]` to host the configuration, the application |
| 40 | +state, and the file cache. No file is shared among different accounts, so you |
| 41 | +can have a different configuration for each one. |
22 | 42 |
|
23 | 43 | To unmount the filesystem, issue this command: |
24 | 44 |
|
@@ -68,4 +88,10 @@ Run `google-drive-ocamlfuse -help` to get all the command options available. To |
68 | 88 | * `-redirect_uri`: Specifies a custom `redirect_uri` for the OAuth2 [flow](https://developers.google.com/identity/protocols/OAuth2InstalledApp#step-2-send-a-request-to-googles-oauth-20-server) |
69 | 89 |
|
70 | 90 | #### Since 0.7.13 |
71 | | -* `-device`: Use [OAuth2 for Devices](https://github.com/astrada/google-drive-ocamlfuse/wiki/OAuth2-for-Devices) authorization flow |
| 91 | +* `-device`: Use [OAuth2 for Devices](https://github.com/astrada/google-drive-ocamlfuse/wiki/OAuth2-for-Devices) authorization flow |
| 92 | + |
| 93 | +#### Since 0.7.32 |
| 94 | +* `-port`: This option can be used to specify a port for the embedded HTTP |
| 95 | + server, that will receive the verification code from Google during |
| 96 | + authorization. The default is 8080. |
| 97 | + |
0 commit comments