aboutsummaryrefslogtreecommitdiff
path: root/conf/conf.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2024-07-09 11:31:08 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2024-07-09 11:31:08 +0530
commitc3821df233523ab715fdf06d54c142394411c968 (patch)
tree4f19352740fc5e38b5a8bd98244bafa30e037b1c /conf/conf.go
parentd0a44ff5cfad5d063929426e2420f6f0d55b1dbe (diff)
added logo/signature upload routesv0.10.0
Diffstat (limited to 'conf/conf.go')
-rw-r--r--conf/conf.go6
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())
}