![Demo](http://gowalker.org/public/gogs_demo.gif)
-##### Current version: 0.1.6 Alpha
+##### Current version: 0.1.7 Alpha
#### Other language version
## Features
- Activity timeline
-- SSH protocol support.
+- SSH/HTTPS protocol support.
- Register/delete account.
- Create/delete/watch public repository.
- User profile page.
![Demo](http://gowalker.org/public/gogs_demo.gif)
-##### 当前版本:0.1.6 Alpha
+##### 当前版本:0.1.7 Alpha
## 开发目的
## 功能特性
- 活动时间线
-- SSH 协议支持
+- SSH/HTTPS 协议支持
- 注册/删除用户
- 创建/删除/关注公开仓库
- 用户个人信息页面
[admin]
[security]
+; Use HTTPS to clone repository, otherwise use HTTP.
+ENABLE_HTTPS_CLONE = false
; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
SECRET_KEY = !#@FDEWREWR&*(
; Auto-login remember days
// Test that go1.2 tag above is included in builds. main.go refers to this definition.
const go12tag = true
-const APP_VER = "0.1.6.0323.1"
+const APP_VER = "0.1.7.0323.1"
func init() {
base.AppVer = APP_VER
user.Website = user.Website[:255]
}
- _, err = orm.Id(user.Id).UseBool().Cols("website", "location").Update(user)
+ _, err = orm.Id(user.Id).UseBool().Cols("website", "location", "is_active", "is_admin").Update(user)
return err
}
RunUser string
RepoRootPath string
+ EnableHttpsClone bool
+
LogInRememberDays int
CookieUserName string
CookieRememberName string
SecretKey = Cfg.MustValue("security", "SECRET_KEY")
RunUser = Cfg.MustValue("", "RUN_USER")
+ EnableHttpsClone = Cfg.MustBool("security", "ENABLE_HTTPS_CLONE", false)
+
LogInRememberDays = Cfg.MustInt("security", "LOGIN_REMEMBER_DAYS")
CookieUserName = Cfg.MustValue("security", "COOKIE_USERNAME")
CookieRememberName = Cfg.MustValue("security", "COOKIE_REMEMBER_NAME")
buf.WriteString(fmt.Sprintf(TPL_COMMIT_REPO_LI, avatarLink, actUserName, repoName, commit[0], commit[0][:7], commit[1]) + "\n")
}
if push.Len > 3 {
- buf.WriteString(fmt.Sprintf(`<div><a href="/%s/%s/commits">%d other commits >></a></div>`, actUserName, repoName, push.Len))
+ buf.WriteString(fmt.Sprintf(`<div><a href="/%s/%s/commits/%s">%d other commits >></a></div>`, actUserName, repoName, branch, push.Len))
}
return fmt.Sprintf(TPL_COMMIT_REPO, actUserName, actUserName, actUserName, repoName, branch, branch, actUserName, repoName, actUserName, repoName,
buf.String())
ctx.Repo.IsWatching = models.IsWatching(ctx.User.Id, repo.Id)
}
ctx.Repo.Repository = repo
+ scheme := "http"
+ if base.EnableHttpsClone {
+ scheme = "https"
+ }
ctx.Repo.CloneLink.SSH = fmt.Sprintf("git@%s:%s/%s.git", base.Domain, user.LowerName, repo.LowerName)
- ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("https://%s/%s/%s.git", base.Domain, user.LowerName, repo.LowerName)
+ ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s://%s/%s/%s.git", scheme, base.Domain, user.LowerName, repo.LowerName)
ctx.Data["IsRepositoryValid"] = true
ctx.Data["Repository"] = repo
ctx.Data["Domain"] = base.Domain
ctx.Data["RunUser"] = base.RunUser
ctx.Data["RunMode"] = strings.Title(martini.Env)
+ ctx.Data["EnableHttpsClone"] = base.EnableHttpsClone
ctx.Data["RepoRootPath"] = base.RepoRootPath
ctx.Data["Service"] = base.Service
func NotFound(ctx *middleware.Context) {
ctx.Data["PageIsNotFound"] = true
- ctx.Data["Title"] = 404
+ ctx.Data["Title"] = "Page Not Found"
ctx.Handle(404, "home.NotFound", nil)
}
<div><b>Run User:</b> {{.RunUser}}</div>
<div><b>Run Mode:</b> {{.RunMode}}</div>
<hr/>
+ <div><b>Enable HTTPS Clone</b> <i class="fa fa{{if .EnableHttpsClone}}-check{{end}}-square-o"></i></div>
<div><b>Repository Root Path:</b> {{.RepoRootPath}}</div>
</div>
</div>
<p style="margin-top: 80px"><img src="/img/404.png" alt="404"/></p>
<hr/>
<p>Application Version: {{AppVer}}</p>
+ <p>If you think it is an error, please open an issue on <a href="https://github.com/gogits/gogs/issues/new">GitHub</a>.</p>
</div>
{{template "base/footer" .}}
\ No newline at end of file