summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/config.go')
-rw-r--r--utils/config.go26
1 files changed, 14 insertions, 12 deletions
diff --git a/utils/config.go b/utils/config.go
index 13b7b6b64..0789c101d 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -24,10 +24,10 @@ const (
)
var Cfg *model.Config = &model.Config{}
+var CfgDiagnosticId = ""
var CfgLastModified int64 = 0
var CfgFileName string = ""
var ClientCfg map[string]string = map[string]string{}
-var SanitizeOptions map[string]bool = map[string]bool{}
func FindConfigFile(fileName string) string {
if _, err := os.Stat("/tmp/" + fileName); err == nil {
@@ -59,8 +59,7 @@ func FindDir(dir string) string {
func ConfigureCmdLineLog() {
ls := model.LogSettings{}
ls.EnableConsole = true
- ls.ConsoleLevel = "ERROR"
- ls.EnableFile = false
+ ls.ConsoleLevel = "WARN"
configureLog(&ls)
}
@@ -72,6 +71,8 @@ func configureLog(s *model.LogSettings) {
level := l4g.DEBUG
if s.ConsoleLevel == "INFO" {
level = l4g.INFO
+ } else if s.ConsoleLevel == "WARN" {
+ level = l4g.WARNING
} else if s.ConsoleLevel == "ERROR" {
level = l4g.ERROR
}
@@ -90,6 +91,8 @@ func configureLog(s *model.LogSettings) {
level := l4g.DEBUG
if s.FileLevel == "INFO" {
level = l4g.INFO
+ } else if s.FileLevel == "WARN" {
+ level = l4g.WARNING
} else if s.FileLevel == "ERROR" {
level = l4g.ERROR
}
@@ -167,18 +170,9 @@ func LoadConfig(fileName string) {
}
Cfg = &config
- SanitizeOptions = getSanitizeOptions(Cfg)
ClientCfg = getClientConfig(Cfg)
}
-func getSanitizeOptions(c *model.Config) map[string]bool {
- options := map[string]bool{}
- options["fullname"] = c.PrivacySettings.ShowFullName
- options["email"] = c.PrivacySettings.ShowEmailAddress
-
- return options
-}
-
func getClientConfig(c *model.Config) map[string]string {
props := make(map[string]string)
@@ -189,6 +183,7 @@ func getClientConfig(c *model.Config) map[string]string {
props["SiteName"] = c.TeamSettings.SiteName
props["EnableTeamCreation"] = strconv.FormatBool(c.TeamSettings.EnableTeamCreation)
+ props["EnableUserCreation"] = strconv.FormatBool(c.TeamSettings.EnableUserCreation)
props["RestrictTeamNames"] = strconv.FormatBool(*c.TeamSettings.RestrictTeamNames)
props["EnableTeamListing"] = strconv.FormatBool(*c.TeamSettings.EnableTeamListing)
@@ -210,6 +205,13 @@ func getClientConfig(c *model.Config) map[string]string {
props["ShowEmailAddress"] = strconv.FormatBool(c.PrivacySettings.ShowEmailAddress)
+ props["TermsOfServiceLink"] = *c.SupportSettings.TermsOfServiceLink
+ props["PrivacyPolicyLink"] = *c.SupportSettings.PrivacyPolicyLink
+ props["AboutLink"] = *c.SupportSettings.AboutLink
+ props["HelpLink"] = *c.SupportSettings.HelpLink
+ props["ReportAProblemLink"] = *c.SupportSettings.ReportAProblemLink
+ props["SupportEmail"] = *c.SupportSettings.SupportEmail
+
props["EnablePublicLink"] = strconv.FormatBool(c.FileSettings.EnablePublicLink)
props["ProfileHeight"] = fmt.Sprintf("%v", c.FileSettings.ProfileHeight)
props["ProfileWidth"] = fmt.Sprintf("%v", c.FileSettings.ProfileWidth)