diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 98771e7f5..5e9fb218e 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -36,6 +36,7 @@ func Initialize() *singleton { _ = utils.EnsureDir(paths.GetConfigDirectory()) initConfig() initFlags() + initEnvs() instance = &singleton{ Status: Idle, Paths: paths.NewPaths(), @@ -91,6 +92,16 @@ func initFlags() { } } +func initEnvs() { + viper.SetEnvPrefix("stash") // will be uppercased automatically + viper.BindEnv("host") // STASH_HOST + viper.BindEnv("port") // STASH_PORT + viper.BindEnv("stash") // STASH_STASH + viper.BindEnv("generated") // STASH_GENERATED + viper.BindEnv("metadata") // STASH_METADATA + viper.BindEnv("cache") // STASH_CACHE +} + func initFFMPEG() { configDirectory := paths.GetConfigDirectory() ffmpegPath, ffprobePath := ffmpeg.GetPaths(configDirectory)