mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 10:33:34 +00:00
config: delay load config file (#5258)
Restructuring of config code in v1.55 resulted in config file being loaded early at process startup. If configuration file is encrypted this means user will need to supply the password, even when running commands that does not use config. This also lead to an issue where mount with --deamon failed to decrypt the config file when it had to prompt user for passord. Fixes #5236 Fixes #5228
This commit is contained in:
@@ -3,7 +3,6 @@ package configfile
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -15,10 +14,9 @@ import (
|
||||
"github.com/rclone/rclone/fs/config"
|
||||
)
|
||||
|
||||
// LoadConfig installs the config file handler and calls config.LoadConfig
|
||||
func LoadConfig(ctx context.Context) {
|
||||
config.Data = &Storage{}
|
||||
config.LoadConfig(ctx)
|
||||
// Install installs the config file handler
|
||||
func Install() {
|
||||
config.SetData(&Storage{})
|
||||
}
|
||||
|
||||
// Storage implements config.Storage for saving and loading config
|
||||
|
||||
Reference in New Issue
Block a user