mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
allow to restrict the env vars passed to plugins
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1046,6 +1046,18 @@ func getPluginsFromEnv(idx int) {
|
||||
isSet = true
|
||||
}
|
||||
|
||||
envPrefix, ok := os.LookupEnv(fmt.Sprintf("SFTPGO_PLUGINS__%v__ENV_PREFIX", idx))
|
||||
if ok {
|
||||
pluginConfig.EnvPrefix = envPrefix
|
||||
isSet = true
|
||||
}
|
||||
|
||||
envVars, ok := lookupStringListFromEnv(fmt.Sprintf("SFTPGO_PLUGINS__%v__ENV_VARS", idx))
|
||||
if ok {
|
||||
pluginConfig.EnvVars = envVars
|
||||
isSet = true
|
||||
}
|
||||
|
||||
if isSet {
|
||||
if len(globalConf.PluginsConfig) > idx {
|
||||
globalConf.PluginsConfig[idx] = pluginConfig
|
||||
|
||||
Reference in New Issue
Block a user