better default env values

This commit is contained in:
Jan 2025-02-24 21:50:58 +01:00
parent f93d7f2e7a
commit e4810bf1be

View File

@ -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")
}
}