mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
commands: initialize plugins if we have a KMS
this is necessary to be able to read KMS secrets stored within the data provider Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"github.com/drakkan/sftpgo/v2/internal/config"
|
||||
"github.com/drakkan/sftpgo/v2/internal/dataprovider"
|
||||
"github.com/drakkan/sftpgo/v2/internal/logger"
|
||||
"github.com/drakkan/sftpgo/v2/internal/plugin"
|
||||
"github.com/drakkan/sftpgo/v2/internal/util"
|
||||
)
|
||||
|
||||
@@ -58,6 +59,15 @@ Please take a look at the usage below to customize the options.`,
|
||||
logger.ErrorToConsole("unable to initialize KMS: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if config.HasKMSPlugin() {
|
||||
if err := plugin.Initialize(config.GetPluginsConfig(), "debug"); err != nil {
|
||||
logger.ErrorToConsole("unable to initialize plugin system: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
registerSignals()
|
||||
defer plugin.Handler.Cleanup()
|
||||
}
|
||||
|
||||
mfaConfig := config.GetMFAConfig()
|
||||
err = mfaConfig.Initialize()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user