ulozto: make password config item be obscured
This commit is contained in:
parent
7c828ffe09
commit
679f4fdfa9
2 changed files with 48 additions and 19 deletions
|
@ -22,6 +22,7 @@ import (
|
||||||
"github.com/rclone/rclone/fs/config"
|
"github.com/rclone/rclone/fs/config"
|
||||||
"github.com/rclone/rclone/fs/config/configmap"
|
"github.com/rclone/rclone/fs/config/configmap"
|
||||||
"github.com/rclone/rclone/fs/config/configstruct"
|
"github.com/rclone/rclone/fs/config/configstruct"
|
||||||
|
"github.com/rclone/rclone/fs/config/obscure"
|
||||||
"github.com/rclone/rclone/fs/fserrors"
|
"github.com/rclone/rclone/fs/fserrors"
|
||||||
"github.com/rclone/rclone/fs/fshttp"
|
"github.com/rclone/rclone/fs/fshttp"
|
||||||
"github.com/rclone/rclone/fs/hash"
|
"github.com/rclone/rclone/fs/hash"
|
||||||
|
@ -59,8 +60,8 @@ func init() {
|
||||||
{
|
{
|
||||||
Name: "app_token",
|
Name: "app_token",
|
||||||
Default: "",
|
Default: "",
|
||||||
Help: "The application token identifying the app. An app API key can be either found in the API " +
|
Help: `The application token identifying the app. An app API key can be either found in the API
|
||||||
"doc https://uloz.to/upload-resumable-api-beta or obtained from customer service.",
|
doc https://uloz.to/upload-resumable-api-beta or obtained from customer service.`,
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -70,16 +71,16 @@ func init() {
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "password",
|
Name: "password",
|
||||||
Default: "",
|
Default: "",
|
||||||
Help: "The password for the user.",
|
Help: "The password for the user.",
|
||||||
Sensitive: true,
|
IsPassword: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "root_folder_slug",
|
Name: "root_folder_slug",
|
||||||
Help: "If set, rclone will use this folder as the root folder for all operations. For example, " +
|
Help: `If set, rclone will use this folder as the root folder for all operations. For example,
|
||||||
"if the slug identifies 'foo/bar/', 'ulozto:baz' is equivalent to 'ulozto:foo/bar/baz' without " +
|
if the slug identifies 'foo/bar/', 'ulozto:baz' is equivalent to 'ulozto:foo/bar/baz' without
|
||||||
"any root slug set.",
|
any root slug set.`,
|
||||||
Default: "",
|
Default: "",
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
Sensitive: true,
|
Sensitive: true,
|
||||||
|
@ -237,9 +238,13 @@ func (f *Fs) authenticate(ctx context.Context) (response *api.AuthenticateRespon
|
||||||
Path: "/v6/session",
|
Path: "/v6/session",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearPassword, err := obscure.Reveal(f.opt.Password)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
authRequest := api.AuthenticateRequest{
|
authRequest := api.AuthenticateRequest{
|
||||||
Login: f.opt.Username,
|
Login: f.opt.Username,
|
||||||
Password: f.opt.Password,
|
Password: clearPassword,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = f.pacer.Call(func() (bool, error) {
|
err = f.pacer.Call(func() (bool, error) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ Paths are specified as `remote:path`
|
||||||
|
|
||||||
Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
|
Paths may be as deep as required, e.g. `remote:directory/subdirectory`.
|
||||||
|
|
||||||
The initial setup for Box involves filling in the user credentials.
|
The initial setup for Uloz.to involves filling in the user credentials.
|
||||||
`rclone config` walks you through it.
|
`rclone config` walks you through it.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
@ -49,8 +49,15 @@ username> user
|
||||||
|
|
||||||
Option password.
|
Option password.
|
||||||
The password for the user.
|
The password for the user.
|
||||||
Enter a value. Press Enter to leave empty.
|
Choose an alternative below. Press Enter for the default (n).
|
||||||
password> secretPassword
|
y) Yes, type in my own password
|
||||||
|
g) Generate random password
|
||||||
|
n) No, leave this optional password blank (default)
|
||||||
|
y/g/n> y
|
||||||
|
Enter the password:
|
||||||
|
password:
|
||||||
|
Confirm the password:
|
||||||
|
password:
|
||||||
|
|
||||||
Edit advanced config?
|
Edit advanced config?
|
||||||
y) Yes
|
y) Yes
|
||||||
|
@ -79,8 +86,9 @@ To copy a local folder to a Uloz.to folder called backup:
|
||||||
rclone copy /home/source remote:backup
|
rclone copy /home/source remote:backup
|
||||||
|
|
||||||
### User credentials
|
### User credentials
|
||||||
|
|
||||||
The only reliable method is to authenticate the user using
|
The only reliable method is to authenticate the user using
|
||||||
username and password. Uloz.to offers anb API key as well, but
|
username and password. Uloz.to offers an API key as well, but
|
||||||
it's reserved for the use of Uloz.to's in-house application
|
it's reserved for the use of Uloz.to's in-house application
|
||||||
and using it in different circumstances is unreliable.
|
and using it in different circumstances is unreliable.
|
||||||
|
|
||||||
|
@ -114,7 +122,7 @@ as they can't be used in JSON strings.
|
||||||
All files are currently uploaded using a single HTTP request, so
|
All files are currently uploaded using a single HTTP request, so
|
||||||
for uploading large files a stable connection is necessary. Rclone will
|
for uploading large files a stable connection is necessary. Rclone will
|
||||||
upload up to `--transfers` chunks at the same time (shared among all
|
upload up to `--transfers` chunks at the same time (shared among all
|
||||||
uploads).
|
uploads).
|
||||||
|
|
||||||
### Deleting files
|
### Deleting files
|
||||||
|
|
||||||
|
@ -136,7 +144,7 @@ to a specific folder hierarchy.
|
||||||
|
|
||||||
In order to do this you will have to find the `Folder slug` of the
|
In order to do this you will have to find the `Folder slug` of the
|
||||||
folder you wish to use as root. This will be the last segment
|
folder you wish to use as root. This will be the last segment
|
||||||
of the URL when you open the relevant folder in the Box web
|
of the URL when you open the relevant folder in the Uloz.to web
|
||||||
interface.
|
interface.
|
||||||
|
|
||||||
For example, for exploring a folder with URL
|
For example, for exploring a folder with URL
|
||||||
|
@ -154,7 +162,8 @@ Here are the Standard options specific to ulozto (Uloz.to).
|
||||||
|
|
||||||
#### --ulozto-app-token
|
#### --ulozto-app-token
|
||||||
|
|
||||||
The application token identifying the app. An app API key can be either found in the API doc https://uloz.to/upload-resumable-api-beta or obtained from customer service.
|
The application token identifying the app. An app API key can be either found in the API
|
||||||
|
doc https://uloz.to/upload-resumable-api-beta or obtained from customer service.
|
||||||
|
|
||||||
Properties:
|
Properties:
|
||||||
|
|
||||||
|
@ -178,6 +187,8 @@ Properties:
|
||||||
|
|
||||||
The password for the user.
|
The password for the user.
|
||||||
|
|
||||||
|
**NB** Input to this must be obscured - see [rclone obscure](/commands/rclone_obscure/).
|
||||||
|
|
||||||
Properties:
|
Properties:
|
||||||
|
|
||||||
- Config: password
|
- Config: password
|
||||||
|
@ -191,7 +202,9 @@ Here are the Advanced options specific to ulozto (Uloz.to).
|
||||||
|
|
||||||
#### --ulozto-root-folder-slug
|
#### --ulozto-root-folder-slug
|
||||||
|
|
||||||
If set, rclone will use this folder as the root folder for all operations. For example, if the slug identifies 'foo/bar/', 'ulozto:baz' is equivalent to 'ulozto:foo/bar/baz' without any root slug set.
|
If set, rclone will use this folder as the root folder for all operations. For example,
|
||||||
|
if the slug identifies 'foo/bar/', 'ulozto:baz' is equivalent to 'ulozto:foo/bar/baz' without
|
||||||
|
any root slug set.
|
||||||
|
|
||||||
Properties:
|
Properties:
|
||||||
|
|
||||||
|
@ -224,6 +237,17 @@ Properties:
|
||||||
- Type: Encoding
|
- Type: Encoding
|
||||||
- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
|
- Default: Slash,BackSlash,Del,Ctl,InvalidUtf8,Dot
|
||||||
|
|
||||||
|
#### --ulozto-description
|
||||||
|
|
||||||
|
Description of the remote
|
||||||
|
|
||||||
|
Properties:
|
||||||
|
|
||||||
|
- Config: description
|
||||||
|
- Env Var: RCLONE_ULOZTO_DESCRIPTION
|
||||||
|
- Type: string
|
||||||
|
- Required: false
|
||||||
|
|
||||||
{{< rem autogenerated options stop >}}
|
{{< rem autogenerated options stop >}}
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
@ -245,4 +269,4 @@ exposed in the API. Backends without this capability cannot determine
|
||||||
free space for an rclone mount or use policy `mfs` (most free space)
|
free space for an rclone mount or use policy `mfs` (most free space)
|
||||||
as a member of an rclone union remote.
|
as a member of an rclone union remote.
|
||||||
|
|
||||||
See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
|
See [List of backends that do not support rclone about](https://rclone.org/overview/#optional-features) and [rclone about](https://rclone.org/commands/rclone_about/)
|
||||||
|
|
Loading…
Reference in a new issue