## Features
- Activity timeline
-- SSH/HTTP(S) protocol support.
-- Register/delete/rename account.
-- Create/migrate/mirror/delete/watch/rename/transfer public/private repository.
-- Repository viewer/release/issue tracker/webhooks.
-- Add/remove repository collaborators.
-- Gravatar and cache support.
-- Mail service(register, issue).
-- Administration panel.
-- Supports MySQL, PostgreSQL and SQLite3.
+- SSH/HTTP(S) protocol support
+- SMTP authentication support
+- Register/delete/rename account
+- Create/migrate/mirror/delete/watch/rename/transfer public/private repository
+- Repository viewer/release/issue tracker/webhooks
+- Add/remove repository collaborators
+- Gravatar and cache support
+- Mail service(register, issue)
+- Administration panel
+- Supports MySQL, PostgreSQL and SQLite3
- Social account login(GitHub, Google, QQ, Weibo)
## System Requirements
"os/exec"
"path"
"path/filepath"
- "regexp"
"strings"
"github.com/Unknwon/com"
"github.com/gogits/cache"
"github.com/gogits/session"
- "github.com/gogits/gogs/modules/auth/ldap"
"github.com/gogits/gogs/modules/log"
)
}
}
-func newLdapService() {
- Service.LdapAuth = Cfg.MustBool("security", "LDAP_AUTH", false)
- if !Service.LdapAuth {
- return
- }
-
- nbsrc := 0
- for _, v := range Cfg.GetSectionList() {
- if matched, _ := regexp.MatchString("(?i)^LDAPSOURCE.*", v); matched {
- ldapname := Cfg.MustValue(v, "name", v)
- ldaphost := Cfg.MustValue(v, "host")
- ldapport := Cfg.MustInt(v, "port", 389)
- ldapusessl := Cfg.MustBool(v, "usessl", false)
- ldapbasedn := Cfg.MustValue(v, "basedn", "dc=*,dc=*")
- ldapattribute := Cfg.MustValue(v, "attribute", "mail")
- ldapfilter := Cfg.MustValue(v, "filter", "(*)")
- ldapmsadsaformat := Cfg.MustValue(v, "MSADSAFORMAT", "%s")
- ldap.AddSource(ldapname, ldaphost, ldapport, ldapusessl, ldapbasedn, ldapattribute, ldapfilter, ldapmsadsaformat)
- nbsrc++
- log.Debug("%s added as LDAP source", ldapname)
- }
- }
- if nbsrc == 0 {
- log.Warn("No valide LDAP found, LDAP Authentication NOT enabled")
- Service.LdapAuth = false
- return
- }
-
- log.Info("LDAP Authentication Enabled")
-}
-
func newCacheService() {
CacheAdapter = Cfg.MustValue("cache", "ADAPTER", "memory")
if EnableRedis {
func NewBaseServices() {
newService()
newLogService()
- newLdapService()
newCacheService()
newSessionService()
newMailService()