Rclone error adding remote config
DanielZhang17 opened this issue · 3 comments
Describe the bug
I recently updated to the latest version of this docker image and i was trying to check out rclone. I successfully logged into the rclone panel and encountered error when trying to add a google drive remote config.
To Reproduce
Steps to reproduce the behavior:
- Go to 'http://your-ip/rclone' and login
- Click on 'Configs'
- Click on 'Create a New Config'
- Enter a name,select "Google Drive" and click on 'Next' 2 times
- It returns to dashboard without redirecting to authentication page
- Wait for a while
- Error creating config. Request failed http error 405 or 502
Expected behavior
Redirect to authentication page and complete adding remote config
@DanielZhang17 , due to Rclone is running within the docker, so basically you can't get authenticated via the web browser. Please use command-line tool(or you call it headless) mode to get those providers which require Oauth works. You can check the official doc at: https://rclone.org/remote_setup/
For me, I made it Rclone working with google drive, please try to follow the following steps:
- Create a Google credential with OAuth client ID type,
I chose the type of TV and limited input
: https://console.developers.google.com/apis/credentials - Enable Google Drive API for your project: https://console.developers.google.com/apis/api/drive.googleapis.com
- Run this docker image and attach to your docker image by
docker exec -it xxx bash
- Run
rclone config
to get authenticated. Last but not least, restart your container!!!
There are some commands I used:
➜ docker exec -it xxx bash
bash-5.0# rclone config
Current remotes:
Name Type
==== ====
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n
name> google
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
...
Storage> 13
** See help for drive backend at: https://rclone.org/drive/ **
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default ("").
client_id> xxxx
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> xxxx
Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / Full access all files, excluding Application Data Folder.
\ "drive"
2 / Read-only access to file metadata and file contents.
\ "drive.readonly"
/ Access to files created by rclone only.
3 | These are visible in the drive website.
| File authorization is revoked when the user deauthorizes the app.
\ "drive.file"
/ Allows read and write access to the Application Data folder.
4 | This is not visible in the drive website.
\ "drive.appfolder"
/ Allows read-only access to file metadata but
5 | does not allow any access to read or download file content.
\ "drive.metadata.readonly"
scope> 2
ID of the root folder
Leave blank normally.
Fill in to access "Computers" folders (see docs), or for rclone to use
a non root folder as its starting point.
Enter a string value. Press Enter for the default ("").
root_folder_id> // this must be empty
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
Enter a string value. Press Enter for the default ("").
service_account_file>
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> n
Please go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=xxxxx&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.readonly&state=xxxx
Log in and authorize rclone for access
Enter verification code> // paste the code you got from browser
\Configure this as a team drive?
y) Yes
n) No (default)
y/n> n
y/n> n
--------------------
[google]
type = drive
client_id = xxx
client_secret = xxx
scope = drive.readonly
root_folder_id =
token = {"access_token":"xxx","token_type":"Bearer","refresh_token":"xxx","expiry":"2020-09-15T07:55:28.0319526Z"}
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:
Name Type
==== ====
google drive