adds config to default settings

This commit is contained in:
bergquist
2019-03-11 10:49:09 +01:00
parent f9f2d9fcf3
commit 196cdf9710
10 changed files with 97 additions and 37 deletions
+16
View File
@@ -240,6 +240,9 @@ type Cfg struct {
// User
EditorsCanOwn bool
// DistributedCache
CacheOptions *CacheOpts
}
type CommandLineArgs struct {
@@ -779,9 +782,22 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
enterprise := iniFile.Section("enterprise")
cfg.EnterpriseLicensePath = enterprise.Key("license_path").MustString(filepath.Join(cfg.DataPath, "license.jwt"))
cacheServer := iniFile.Section("cache_server")
//cfg.DistCacheType = cacheServer.Key("type").MustString("database")
//cfg.DistCacheConnStr = cacheServer.Key("connstr").MustString("")
cfg.CacheOptions = &CacheOpts{
Name: cacheServer.Key("type").MustString("database"),
ConnStr: cacheServer.Key("connstr").MustString(""),
}
return nil
}
type CacheOpts struct {
Name string
ConnStr string
}
func (cfg *Cfg) readSessionConfig() {
sec := cfg.Raw.Section("session")
SessionOptions = session.Options{}