-
Notifications
You must be signed in to change notification settings - Fork 29
rclone configuration
zhdenny edited this page Sep 11, 2024
·
3 revisions
The Sync Google Drive process uses RClone to sync the posters stored on a contributors Google Drive to your server. This is achieved by the following steps.
-
Get an RClone Client ID and Secret following these instructions.
-
Get a token following these instructions:
- On your server, run
rclone config
-
Enter
n
forn) New remote
-
Enter a name for the new remote
- You will be presented with a list of storage options. Enter the number corresponding to "Google Drive"
- Enter your Client ID from Step 1
- Enter your Client Secret from Step 1
- You will be presented with a list of scopes that rclone should use when requesting access from the drive. Choose either option 1 or 2
- You will be presented with an option to enter a filepath for a Service Account JSON file. It is recommended to not use this, however the process in creating a JSON file are listed at the end of these instructions. If you have elected to not use this, leave the field blank and Press Enter.
- You will be presented with an option to edit the advanced config. Select 'n' for No.
- You will be presented with an option to use a web browser to automatically authenticate rclone with remote. This is necessary if you are using a headless server, and is recommended even if you are not. To proceed with the recommended process, select
n
for No.
- You will be provided with an an rclone authorization string which needs to be copied and pasted into the terminal of a different machine with rclone installed that also has a web browser available.
- Open a terminal or command prompt software on your different machine with rclone installed and paste the string from the last step.
- A browser window will open and you will be presented with a screen to select your Google Account to authenticate with.
- It is likely you will be presented with the following screen, where you will be required to select 'Advanced'.
- Next, click 'Go to daps (unsafe)'
- You will be presented with a screen saying 'daps wants access to your Google Account'. Select 'Continue'
- Now you will be presented with a message of 'Success! All done.
- Go back to rclone.' Now go back to the terminal or command prompt you had on your second machine and you will be provided with a long string of code. This needs to be copied between the arrows.
- Now paste the string into your server where you created the rclone config.
- You will be presented with the option to configure this as a Shared Drive. Select
n
for No.
- Congratulations! Your configuration is now complete. You now have to copy the
access_token
that has been provided which you need to paste into your Sync Google Drive section of the DAPS config.yaml file. All text between and including the{}
is required.
- Finally select
y
, followed byq
to exit out of rclone.
- On your server, run
Alternatively, use Google Cloud Service Account instead of token:
- Creating and using this option will make it, so you don't need to create the token manually, but I will still strongly recommend to still add the Client ID and Client Secret and just change the token to SA, otherwise you might reach some limits.
Instructions for creating a Google Cloud Service Account
- To create a service account and obtain its credentials, go to the Google Developer Console.
- You must have a project—create one if you don't.
- Then go to "IAM & admin" -> "Service Accounts."
- Use the "Create Service Account" button. Fill in "Service account name" and "Service account ID" with something that identifies your client.
- Select "Create And Continue." Step 2 and 3 are optional.
- Once created, you will need to go to the Actions of the SA -> Manage Keys and create a JSON key and save it as a file.
- These credentials are what rclone will use for authentication. If you ever need to remove access, press the "Delete service account key" button.