mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 15:34:08 +01:00
#3495 only start builtin SSH server after user finish installation
This commit is contained in:
parent
bbca2916f7
commit
13a8823bd3
4 changed files with 9 additions and 10 deletions
|
@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
|
||||||
|
|
||||||
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
|
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
|
||||||
|
|
||||||
##### Current tip version: 0.9.87 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
|
##### Current tip version: 0.9.88 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
|
||||||
|
|
||||||
| Web | UI | Preview |
|
| Web | UI | Preview |
|
||||||
|:-------------:|:-------:|:-------:|
|
|:-------------:|:-------:|:-------:|
|
||||||
|
|
2
gogs.go
2
gogs.go
|
@ -17,7 +17,7 @@ import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.9.87.0826"
|
const APP_VER = "0.9.88.0827"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
|
|
@ -57,21 +57,23 @@ func NewServices() {
|
||||||
// GlobalInit is for global configuration reload-able.
|
// GlobalInit is for global configuration reload-able.
|
||||||
func GlobalInit() {
|
func GlobalInit() {
|
||||||
setting.NewContext()
|
setting.NewContext()
|
||||||
highlight.NewContext()
|
|
||||||
log.Trace("Custom path: %s", setting.CustomPath)
|
log.Trace("Custom path: %s", setting.CustomPath)
|
||||||
log.Trace("Log path: %s", setting.LogRootPath)
|
log.Trace("Log path: %s", setting.LogRootPath)
|
||||||
models.LoadConfigs()
|
models.LoadConfigs()
|
||||||
NewServices()
|
NewServices()
|
||||||
|
|
||||||
if setting.InstallLock {
|
if setting.InstallLock {
|
||||||
|
highlight.NewContext()
|
||||||
|
markdown.BuildSanitizer()
|
||||||
|
|
||||||
models.LoadRepoConfig()
|
models.LoadRepoConfig()
|
||||||
models.NewRepoContext()
|
models.NewRepoContext()
|
||||||
|
|
||||||
if err := models.NewEngine(); err != nil {
|
if err := models.NewEngine(); err != nil {
|
||||||
log.Fatal(4, "Fail to initialize ORM engine: %v", err)
|
log.Fatal(4, "Fail to initialize ORM engine: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
models.HasEngine = true
|
models.HasEngine = true
|
||||||
|
|
||||||
|
// Booting long running goroutines.
|
||||||
cron.NewContext()
|
cron.NewContext()
|
||||||
models.InitDeliverHooks()
|
models.InitDeliverHooks()
|
||||||
models.InitTestPullRequests()
|
models.InitTestPullRequests()
|
||||||
|
@ -88,13 +90,10 @@ func GlobalInit() {
|
||||||
}
|
}
|
||||||
checkRunMode()
|
checkRunMode()
|
||||||
|
|
||||||
if setting.SSH.StartBuiltinServer {
|
if setting.InstallLock && setting.SSH.StartBuiltinServer {
|
||||||
ssh.Listen(setting.SSH.ListenPort)
|
ssh.Listen(setting.SSH.ListenPort)
|
||||||
log.Info("SSH server started on :%v", setting.SSH.ListenPort)
|
log.Info("SSH server started on :%v", setting.SSH.ListenPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build Sanitizer
|
|
||||||
markdown.BuildSanitizer()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func InstallInit(ctx *context.Context) {
|
func InstallInit(ctx *context.Context) {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.9.87.0826
|
0.9.88.0827
|
Loading…
Reference in a new issue