Merge ce57103d460a9e885c9451d49f58748869c0e17c into 0b9671313b14ffe839ecbd7dd2ae5ac7f6f05db8

This commit is contained in:
n4n5 2025-04-11 19:29:46 +05:30 committed by GitHub
commit 58363c7e75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,37 @@ import (
"github.com/rclone/rclone/fs/rc"
)
func init() {
rc.Add(rc.Call{
Path: "config/unlock",
Fn: rcConfigPassword,
Title: "Unlock the config file.",
AuthRequired: true,
Help: `
Unlocks the config file if it is locked.
Parameters:
- 'config_password' - password to unlock the config file
A good idea is to disable AskPassword before making this call
`,
})
}
// Unlock the config file
// A good idea is to disable AskPassword before making this call
func rcConfigPassword(ctx context.Context, in rc.Params) (out rc.Params, err error) {
configPass, err := in.GetString("config_password")
if err != nil {
return nil, err
}
if SetConfigPassword(configPass) != nil {
return nil, errors.New("failed to set config password")
}
return DumpRcBlob(), nil
}
func init() {
rc.Add(rc.Call{
Path: "config/dump",