diff options
author | Justin Nuß <nuss.justin@gmail.com> | 2014-07-24 19:15:35 +0200 |
---|---|---|
committer | Justin Nuß <nuss.justin@gmail.com> | 2014-07-24 19:15:35 +0200 |
commit | 620c0ef297ceca370f8e2946a72a2a1c40c16347 (patch) | |
tree | 8f9d0911db7d2920b6cf6d0de18ad61b1042b543 /modules/setting/setting.go | |
parent | cbcd08aa17e95a72dcb294da836aa7f2b966d5c0 (diff) | |
parent | c20f5dc2ea1b27e80c28e00831278c7451ba6cce (diff) |
Merge branch 'dev' of https://github.com/gogits/Gogs into trello/244
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r-- | modules/setting/setting.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f03aa8ae..48b17f95 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -71,6 +71,13 @@ var ( LogModes []string LogConfigs []string + // Attachment settings. + AttachmentPath string + AttachmentAllowedTypes string + AttachmentMaxSize int64 + AttachmentMaxFiles int + AttachmentEnabled bool + // Cache settings. Cache cache.Cache CacheAdapter string @@ -166,6 +173,16 @@ func NewConfigContext() { CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME") ReverseProxyAuthUser = Cfg.MustValue("security", "REVERSE_PROXY_AUTHENTICATION_USER", "X-WEBAUTH-USER") + AttachmentPath = Cfg.MustValue("attachment", "PATH", "files/attachments") + AttachmentAllowedTypes = Cfg.MustValue("attachment", "ALLOWED_TYPES", "*/*") + AttachmentMaxSize = Cfg.MustInt64("attachment", "MAX_SIZE", 32) + AttachmentMaxFiles = Cfg.MustInt("attachment", "MAX_FILES", 10) + AttachmentEnabled = Cfg.MustBool("attachment", "ENABLE", true) + + if err = os.MkdirAll(AttachmentPath, os.ModePerm); err != nil { + log.Fatal("Could not create directory %s: %s", AttachmentPath, err) + } + RunUser = Cfg.MustValue("", "RUN_USER") curUser := os.Getenv("USER") if len(curUser) == 0 { @@ -341,6 +358,7 @@ func newSessionService() { log.Fatal("Init session system failed, provider: %s, %v", SessionProvider, err) } + go SessionManager.GC() log.Info("Session Service Enabled") } |