Skip to content

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.

  1. Get an RClone Client ID and Secret following these instructions.

  2. Get a token following these instructions:

    • On your server, run rclone config

    rclone config

    • Enter n for n) New remote

    • Enter a name for the new remote

    New Remote

    • You will be presented with a list of storage options. Enter the number corresponding to "Google Drive"

    Storage Options

    Enter Option 18

    • Enter your Client ID from Step 1

    Client ID

    • Enter your Client Secret from Step 1

    Client Secret

    • 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

    Option Scope

    • 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.

    Service Account File

    • You will be presented with an option to edit the advanced config. Select 'n' for No.

    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.

    Automatically authenticate rclone with remote - 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.

    Authorization String

    • Open a terminal or command prompt software on your different machine with rclone installed and paste the string from the last step.

    Paste Authorization String

    • A browser window will open and you will be presented with a screen to select your Google Account to authenticate with.

    Google Login

    • It is likely you will be presented with the following screen, where you will be required to select 'Advanced'.

    Select Advanced

    • Next, click 'Go to daps (unsafe)'

    Select Go to daps (unsafe)

    • You will be presented with a screen saying 'daps wants access to your Google Account'. Select 'Continue'

    Select Continue

    • Now you will be presented with a message of 'Success! All done.

    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.

    Copy this string

    • Now paste the string into your server where you created the rclone config.

    Paste your string here

    • You will be presented with the option to configure this as a Shared Drive. Select n for No.

    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.

    Copy the Access Token string

    • Finally select y, followed by q to exit out of rclone.

    Select y followed by q

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

  1. To create a service account and obtain its credentials, go to the Google Developer Console.
  2. You must have a project—create one if you don't.
  3. Then go to "IAM & admin" -> "Service Accounts."
  4. Use the "Create Service Account" button. Fill in "Service account name" and "Service account ID" with something that identifies your client.
  5. Select "Create And Continue." Step 2 and 3 are optional.
  6. 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.
  7. These credentials are what rclone will use for authentication. If you ever need to remove access, press the "Delete service account key" button.
Clone this wiki locally