diff options
Diffstat (limited to 'conf')
-rw-r--r-- | conf/conf.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/conf/conf.go b/conf/conf.go index 7531e4f..843bbea 100644 --- a/conf/conf.go +++ b/conf/conf.go @@ -1,5 +1,5 @@ /* openbills - Server for web based Libre Billing Software - * Copyright (C) 2023 Vidhu Kant Sharma <vidhukant@vidhukant.com> + * Copyright (C) 2023-2024 Vidhu Kant Sharma <vidhukant@vidhukant.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,8 @@ import ( "log" ) +// TODO: check if openbills has read/write access to uploads dir +// TODO: data.upload_dir must have a trailing / func validateConf() { ok := true log.Println("\x1b[46m\x1b[30m[info]\x1b[0m Checking errors in config file...") @@ -99,6 +101,8 @@ func init() { viper.SetDefault("cryptography.password_hashing_cost", bcrypt.DefaultCost) + viper.SetDefault("data.upload_dir", "./data/") + validateConf() log.Printf("\x1b[46m\x1b[30m[info]\x1b[0m Loaded Config \"%s\"\n", viper.ConfigFileUsed()) } |