summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-18 01:33:53 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-18 01:33:53 -0400
commita3a93aef11f9ff6eca38e9147b022a0649b73bdf (patch)
treeb669aadf733d04b5f2661ee1c7014760f0a6ac6c /modules
parentd886f4df9734ccf69647dfb5564effaca85fed50 (diff)
downloadgitea-a3a93aef11f9ff6eca38e9147b022a0649b73bdf.tar.gz
gitea-a3a93aef11f9ff6eca38e9147b022a0649b73bdf.zip
Add some config options
Diffstat (limited to 'modules')
-rw-r--r--modules/base/conf.go31
1 files changed, 26 insertions, 5 deletions
diff --git a/modules/base/conf.go b/modules/base/conf.go
index 9ed5545e8a..83c7f8872d 100644
--- a/modules/base/conf.go
+++ b/modules/base/conf.go
@@ -13,13 +13,23 @@ import (
"github.com/Unknwon/com"
"github.com/Unknwon/goconfig"
+
+ "github.com/gogits/gogs/modules/log"
)
+// Mailer represents a mail service.
+type Mailer struct {
+ Name string
+ Host string
+ User, Passwd string
+}
+
var (
- AppVer string
- AppName string
- Domain string
- Cfg *goconfig.ConfigFile
+ AppVer string
+ AppName string
+ Domain string
+ Cfg *goconfig.ConfigFile
+ MailService *Mailer
)
func exeDir() (string, error) {
@@ -59,6 +69,17 @@ func init() {
}
Cfg.BlockMode = false
- AppName = Cfg.MustValue("", "APP_NAME")
+ AppName = Cfg.MustValue("", "APP_NAME", "Gogs: Go Git Service")
Domain = Cfg.MustValue("server", "DOMAIN")
+
+ // Check mailer setting.
+ if Cfg.MustBool("mailer", "ENABLED") {
+ MailService = &Mailer{
+ Name: Cfg.MustValue("mailer", "NAME", AppName),
+ Host: Cfg.MustValue("mailer", "HOST", "127.0.0.1:25"),
+ User: Cfg.MustValue("mailer", "USER", "example@example.com"),
+ Passwd: Cfg.MustValue("mailer", "PASSWD", "******"),
+ }
+ log.Info("Mail Service Enabled")
+ }
}