ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
HTTP_ADDR =
HTTP_PORT = 3000
+SSH_PORT = 22
; Disable CDN even in "prod" mode
OFFLINE_MODE = false
DISABLE_ROUTER_LOG = false
AppName string
AppLogo string
AppUrl string
+ SshPort int
OfflineMode bool
DisableRouterLog bool
ProdMode bool
AppLogo = Cfg.MustValue("", "APP_LOGO", "img/favicon.png")
AppUrl = Cfg.MustValue("server", "ROOT_URL")
Domain = Cfg.MustValue("server", "DOMAIN")
+ SshPort = Cfg.MustInt("server", "SSH_PORT", 22)
OfflineMode = Cfg.MustBool("server", "OFFLINE_MODE", false)
DisableRouterLog = Cfg.MustBool("server", "DISABLE_ROUTER_LOG", false)
SecretKey = Cfg.MustValue("security", "SECRET_KEY")
ctx.Data["IsRepositoryOwner"] = ctx.Repo.IsOwner
ctx.Data["BranchName"] = ""
- ctx.Repo.CloneLink.SSH = fmt.Sprintf("%s@%s:%s/%s.git", base.RunUser, base.Domain, user.LowerName, repo.LowerName)
+ sshPrefix := ""
+ if base.SshPort != 22 {
+ sshPrefix = "ssh://"
+ }
+ ctx.Repo.CloneLink.SSH = fmt.Sprintf("%s%s@%s:%s/%s.git", sshPrefix, base.RunUser, base.Domain, user.LowerName, repo.LowerName)
ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s%s/%s.git", base.AppUrl, user.LowerName, repo.LowerName)
ctx.Data["CloneLink"] = ctx.Repo.CloneLink