mirror of
https://github.com/rclone/rclone
synced 2024-11-23 00:06:55 +01:00
rcserver: avoid generating default credentials with htpasswd - fixes #4839
This commit is contained in:
parent
0ac5795f8c
commit
efd3c6449b
@ -97,11 +97,11 @@ func newServer(ctx context.Context, opt *rc.Options, mux *http.ServeMux) *Server
|
|||||||
if opt.NoAuth {
|
if opt.NoAuth {
|
||||||
fs.Logf(nil, "It is recommended to use web gui with auth.")
|
fs.Logf(nil, "It is recommended to use web gui with auth.")
|
||||||
} else {
|
} else {
|
||||||
if opt.HTTPOptions.BasicUser == "" {
|
if opt.HTTPOptions.BasicUser == "" && opt.HTTPOptions.HtPasswd == "" {
|
||||||
opt.HTTPOptions.BasicUser = "gui"
|
opt.HTTPOptions.BasicUser = "gui"
|
||||||
fs.Infof(nil, "No username specified. Using default username: %s \n", rcflags.Opt.HTTPOptions.BasicUser)
|
fs.Infof(nil, "No username specified. Using default username: %s \n", rcflags.Opt.HTTPOptions.BasicUser)
|
||||||
}
|
}
|
||||||
if opt.HTTPOptions.BasicPass == "" {
|
if opt.HTTPOptions.BasicPass == "" && opt.HTTPOptions.HtPasswd == "" {
|
||||||
randomPass, err := random.Password(128)
|
randomPass, err := random.Password(128)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to make password: %v", err)
|
log.Fatalf("Failed to make password: %v", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user