Clean old LDAP code
This commit is contained in:
parent
4744996f9a
commit
be82716b66
5 changed files with 14 additions and 46 deletions
19
README.md
19
README.md
|
@ -32,15 +32,16 @@ More importantly, Gogs only needs one binary to setup your own project hosting o
|
|||
## 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
|
||||
|
|
|
@ -23,7 +23,8 @@ Gogs 完全使用 Go 语言来实现对 Git 数据的操作,实现 **零** 依
|
|||
## 功能特性
|
||||
|
||||
- 活动时间线
|
||||
- SSH/HTTP(S) 协议支持
|
||||
- 支持 SSH/HTTP(S) 协议
|
||||
- 支持 SMTP 用户认证
|
||||
- 注册/删除/重命名用户
|
||||
- 创建/迁移/镜像/删除/关注/重命名/转移 公开/私有 仓库
|
||||
- 仓库 浏览器/发布/缺陷管理/Web 钩子
|
||||
|
|
2
gogs.go
2
gogs.go
|
@ -17,7 +17,7 @@ import (
|
|||
"github.com/gogits/gogs/modules/base"
|
||||
)
|
||||
|
||||
const APP_VER = "0.3.4.0514 Alpha"
|
||||
const APP_VER = "0.3.4.0515 Alpha"
|
||||
|
||||
func init() {
|
||||
base.AppVer = APP_VER
|
||||
|
|
|
@ -312,7 +312,7 @@ func SmtpAuth(host string, port int, a smtp.Auth, useTls bool) error {
|
|||
return err
|
||||
}
|
||||
} else {
|
||||
return errors.New("SMTP server unsupported TLS")
|
||||
return errors.New("SMTP server unsupports TLS")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import (
|
|||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
|
@ -20,7 +19,6 @@ import (
|
|||
"github.com/gogits/cache"
|
||||
"github.com/gogits/session"
|
||||
|
||||
"github.com/gogits/gogs/modules/auth/ldap"
|
||||
"github.com/gogits/gogs/modules/log"
|
||||
)
|
||||
|
||||
|
@ -188,37 +186,6 @@ func newLogService() {
|
|||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
|
@ -376,7 +343,6 @@ func NewConfigContext() {
|
|||
func NewBaseServices() {
|
||||
newService()
|
||||
newLogService()
|
||||
newLdapService()
|
||||
newCacheService()
|
||||
newSessionService()
|
||||
newMailService()
|
||||
|
|
Reference in a new issue