From 7f8d74e903d5577c50b030de8b7d712f3a8c0258 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 4 May 2020 10:40:26 +0100 Subject: [PATCH] docs: refresh `rclone authorize` help --- docs/content/remote_setup.md | 20 ++++++++++++++------ lib/oauthutil/oauthutil.go | 13 ++++++++++--- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/docs/content/remote_setup.md b/docs/content/remote_setup.md index 09f2a083f..f45e50912 100644 --- a/docs/content/remote_setup.md +++ b/docs/content/remote_setup.md @@ -1,7 +1,7 @@ --- title: "Remote Setup" description: "Configuring rclone up on a remote / headless machine" -date: "2016-01-07" +date: "2020-05-04" --- # Configuring rclone on a remote / headless machine # @@ -16,7 +16,8 @@ two ways of doing it, described below. ## Configuring using rclone authorize ## -On the headless box +On the headless box run `rclone` config but answer `N` to the `Use +auto config?` question. ``` ... @@ -24,12 +25,19 @@ Remote config Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine -y) Yes +y) Yes (default) n) No y/n> n -For this to work, you will need rclone available on a machine that has a web browser available. -Execute the following on your machine: +For this to work, you will need rclone available on a machine that has +a web browser available. + +For more help and alternate methods see: https://rclone.org/remote_setup/ + +Execute the following on the machine with the web browser (same rclone +version recommended): + rclone authorize "amazon cloud drive" + Then paste the result below: result> ``` @@ -68,7 +76,7 @@ y/e/d> Rclone stores all of its config in a single configuration file. This can easily be copied to configure a remote rclone. -So first configure rclone on your desktop machine +So first configure rclone on your desktop machine with rclone config diff --git a/lib/oauthutil/oauthutil.go b/lib/oauthutil/oauthutil.go index 74761e9ba..df6ad31f4 100644 --- a/lib/oauthutil/oauthutil.go +++ b/lib/oauthutil/oauthutil.go @@ -429,14 +429,21 @@ func doConfig(id, name string, m configmap.Mapper, oauthConfig *oauth2.Config, o break } if !isLocal() { - fmt.Printf("For this to work, you will need rclone available on a machine that has a web browser available.\n") - fmt.Printf("Execute the following on your machine (same rclone version recommended) :\n") + fmt.Printf(`For this to work, you will need rclone available on a machine that has +a web browser available. + +For more help and alternate methods see: https://rclone.org/remote_setup/ + +Execute the following on the machine with the web browser (same rclone +version recommended): + +`) if changed { fmt.Printf("\trclone authorize %q -- %q %q\n", id, oauthConfig.ClientID, oauthConfig.ClientSecret) } else { fmt.Printf("\trclone authorize %q\n", id) } - fmt.Println("Then paste the result below:") + fmt.Println("\nThen paste the result below:") code := config.ReadNonEmptyLine("result> ") token := &oauth2.Token{} err := json.Unmarshal([]byte(code), token)