diff options
author | Justin Nuß <nuss.justin@gmail.com> | 2014-07-23 21:15:47 +0200 |
---|---|---|
committer | Justin Nuß <nuss.justin@gmail.com> | 2014-07-23 21:15:47 +0200 |
commit | 4617bef8954deeef5bd2ba36d84aba3b05a4dd83 (patch) | |
tree | a3583597828726617cfcf0b4d945e7bf6fb3471c /modules/setting | |
parent | 6e9f1c52b18f112eecd5c72e295cfea1809f07fa (diff) | |
download | gitea-4617bef8954deeef5bd2ba36d84aba3b05a4dd83.tar.gz gitea-4617bef8954deeef5bd2ba36d84aba3b05a4dd83.zip |
WIP: Allow attachments for comments
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f03aa8aeae..ba9e86dc8f 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -71,6 +71,10 @@ var ( LogModes []string LogConfigs []string + // Attachment settings. + AttachmentPath string + AttachmentAllowedTypes string + // Cache settings. Cache cache.Cache CacheAdapter string @@ -166,6 +170,13 @@ 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", "*/*") + + 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 { |