summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-19 14:40:49 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-19 14:40:49 +0800
commit9e8e910bd64e3fd6526ead90f7211fcc1a81964d (patch)
tree709f40d26a56325abfca42024bd28f0843feeca9 /modules
parent3da325591b5d8578f575f5fad59595f3c5efe4d6 (diff)
parent38776a0dd5762b2efbf70ebe98eeecdcd395c185 (diff)
downloadgitea-9e8e910bd64e3fd6526ead90f7211fcc1a81964d.tar.gz
gitea-9e8e910bd64e3fd6526ead90f7211fcc1a81964d.zip
merge
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")
+ }
}