![Demo](http://gogs.qiniudn.com/gogs_demo.gif)
-##### Current version: 0.5.12 Beta
+##### Current version: 0.5.13 Beta
### NOTICES
![Demo](http://gogs.qiniudn.com/gogs_demo.gif)
-##### 当前版本:0.5.12 Beta
+##### 当前版本:0.5.13 Beta
## 开发目的
func setup(logPath string) {
setting.NewConfigContext()
log.NewGitLogger(filepath.Join(setting.LogRootPath, logPath))
+
+ if setting.DisableSSH {
+ println("Gogs: SSH has been disabled")
+ os.Exit(1)
+ }
+
models.LoadModelsConfig()
if models.UseSQLite3 {
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
HTTP_ADDR =
HTTP_PORT = 3000
+; Disable SSH feature when not available
+DISABLE_SSH = false
SSH_PORT = 22
; Disable CDN even in "prod" mode
OFFLINE_MODE = false
"github.com/gogits/gogs/modules/setting"
)
-const APP_VER = "0.5.12.0206 Beta"
+const APP_VER = "0.5.13.0207 Beta"
func init() {
runtime.GOMAXPROCS(runtime.NumCPU())
func updateIssuesCommit(userId, repoId int64, repoUserName, repoName string, commits []*base.PushCommit) error {
for _, c := range commits {
- // FIXME: should not be a reference when it comes with action.
- // e.g. fixes #1 will not have duplicated reference message.
for _, ref := range IssueReferenceKeywordsPat.FindAllString(c.Message, -1) {
ref := ref[strings.IndexByte(ref, byte(' '))+1:]
ref = strings.TrimRightFunc(ref, func(c rune) bool {
if err = repo.GetOwner(); err != nil {
return cl, err
}
- if setting.SshPort != 22 {
- cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.Domain, setting.SshPort, repo.Owner.LowerName, repo.LowerName)
+ if setting.SSHPort != 22 {
+ cl.SSH = fmt.Sprintf("ssh://%s@%s:%d/%s/%s.git", setting.RunUser, setting.Domain, setting.SSHPort, repo.Owner.LowerName, repo.LowerName)
} else {
cl.SSH = fmt.Sprintf("%s@%s:%s/%s.git", setting.RunUser, setting.Domain, repo.Owner.LowerName, repo.LowerName)
}
ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner
ctx.Data["IsRepositoryTrueOwner"] = ctx.Repo.IsTrueOwner
+ ctx.Data["DisableSSH"] = setting.DisableSSH
ctx.Repo.CloneLink, err = repo.CloneLink()
if err != nil {
ctx.Handle(500, "CloneLink", err)
Protocol Scheme
Domain string
HttpAddr, HttpPort string
- SshPort int
+ DisableSSH bool
+ SSHPort int
OfflineMode bool
DisableRouterLog bool
CertFile, KeyFile string
Domain = sec.Key("DOMAIN").MustString("localhost")
HttpAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0")
HttpPort = sec.Key("HTTP_PORT").MustString("3000")
- SshPort = sec.Key("SSH_PORT").MustInt(22)
+ DisableSSH = sec.Key("DISABLE_SSH").MustBool()
+ SSHPort = sec.Key("SSH_PORT").MustInt(22)
OfflineMode = sec.Key("OFFLINE_MODE").MustBool()
DisableRouterLog = sec.Key("DISABLE_ROUTER_LOG").MustBool()
StaticRootPath = sec.Key("STATIC_ROOT_PATH").MustString(workDir)
-0.5.12.0206 Beta
\ No newline at end of file
+0.5.13.0207 Beta
\ No newline at end of file
</a>
<div id="repo-header-download-drop" class="drop-down">
<div id="repo-clone" class="clear">
- <button class="btn btn-blue left left btn-left-radius" id="repo-clone-ssh" data-link="{{$.CloneLink.SSH}}">SSH</button>
- <button class="btn btn-gray left" id="repo-clone-https" data-link="{{$.CloneLink.HTTPS}}">HTTPS</button>
- <input id="repo-clone-url" class="ipt ipt-disabled left" value="{{$.CloneLink.SSH}}" readonly />
+ {{if not $.DisableSSH}}
+ <button class="btn btn-blue left btn-left-radius" id="repo-clone-ssh" data-link="{{$.CloneLink.SSH}}">SSH</button>
+ {{end}}
+ <button class="btn {{if $.DisableSSH}}btn-blue{{else}}btn-gray{{end}} left" id="repo-clone-https" data-link="{{$.CloneLink.HTTPS}}">HTTPS</button>
+ <input id="repo-clone-url" class="ipt ipt-disabled left" value="{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}" readonly />
<button id="repo-clone-copy" class="btn btn-black left btn-right-radius" data-copy-val="val" data-copy-from="#repo-clone-url" original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-original-title="{{$.i18n.Tr "repo.click_to_copy"}}" data-after-title="{{$.i18n.Tr "repo.copied"}}">{{$.i18n.Tr "repo.copy_link"}}</button>
<p class="text-center" id="repo-clone-help">{{$.i18n.Tr "repo.clone_helper" "http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" | Str2html}}</p>
<hr/>