diff --git a/config/env.go b/config/env.go index f9e4f03..195bbc3 100644 --- a/config/env.go +++ b/config/env.go @@ -54,9 +54,17 @@ func LoadEnv() error { } func setDefaultEnvs() { - os.Setenv(Prefix+"UploadDir", "uploads/") - os.Setenv(Prefix+"LOG_FILE", "auth_failures.log") + if _, ok := os.LookupEnv(Prefix + "UploadDir"); !ok { + os.Setenv(Prefix+"UploadDir", "uploads/") + } + if _, ok := os.LookupEnv(Prefix + "LOG_FILE"); !ok { + os.Setenv(Prefix+"LOG_FILE", "auth_failures.log") + } - os.Setenv(Prefix+"MaxFailedAttempts", "3") - os.Setenv(Prefix+"BanDuration", "5") + if _, ok := os.LookupEnv(Prefix + "MaxFailedAttempts"); !ok { + os.Setenv(Prefix+"MaxFailedAttempts", "3") + } + if _, ok := os.LookupEnv(Prefix + "BanDuration"); !ok { + os.Setenv(Prefix+"BanDuration", "5") + } }