mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Enviroment Variables (#45)
* testing env version * added STASH_CACHE env * Remove debug prints used for testing * Update manager.go
This commit is contained in:
@@ -36,6 +36,7 @@ func Initialize() *singleton {
|
|||||||
_ = utils.EnsureDir(paths.GetConfigDirectory())
|
_ = utils.EnsureDir(paths.GetConfigDirectory())
|
||||||
initConfig()
|
initConfig()
|
||||||
initFlags()
|
initFlags()
|
||||||
|
initEnvs()
|
||||||
instance = &singleton{
|
instance = &singleton{
|
||||||
Status: Idle,
|
Status: Idle,
|
||||||
Paths: paths.NewPaths(),
|
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() {
|
func initFFMPEG() {
|
||||||
configDirectory := paths.GetConfigDirectory()
|
configDirectory := paths.GetConfigDirectory()
|
||||||
ffmpegPath, ffprobePath := ffmpeg.GetPaths(configDirectory)
|
ffmpegPath, ffprobePath := ffmpeg.GetPaths(configDirectory)
|
||||||
|
|||||||
Reference in New Issue
Block a user