Browse Source

#3495 only start builtin SSH server after user finish installation

Unknwon 3 years ago
parent
commit
13a8823bd3
4 changed files with 9 additions and 10 deletions
  1. 1 1
      README.md
  2. 1 1
      gogs.go
  3. 6 7
      routers/install.go
  4. 1 1
      templates/.VERSION

+ 1 - 1
README.md

@@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
3 3
 
4 4
 ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
5 5
 
6
-##### Current tip version: 0.9.87 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
6
+##### Current tip version: 0.9.88 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
7 7
 
8 8
 | Web | UI  | Preview  |
9 9
 |:-------------:|:-------:|:-------:|

+ 1 - 1
gogs.go

@@ -17,7 +17,7 @@ import (
17 17
 	"github.com/gogits/gogs/modules/setting"
18 18
 )
19 19
 
20
-const APP_VER = "0.9.87.0826"
20
+const APP_VER = "0.9.88.0827"
21 21
 
22 22
 func init() {
23 23
 	runtime.GOMAXPROCS(runtime.NumCPU())

+ 6 - 7
routers/install.go

@@ -57,21 +57,23 @@ func NewServices() {
57 57
 // GlobalInit is for global configuration reload-able.
58 58
 func GlobalInit() {
59 59
 	setting.NewContext()
60
-	highlight.NewContext()
61 60
 	log.Trace("Custom path: %s", setting.CustomPath)
62 61
 	log.Trace("Log path: %s", setting.LogRootPath)
63 62
 	models.LoadConfigs()
64 63
 	NewServices()
65 64
 
66 65
 	if setting.InstallLock {
66
+		highlight.NewContext()
67
+		markdown.BuildSanitizer()
68
+
67 69
 		models.LoadRepoConfig()
68 70
 		models.NewRepoContext()
69
-
70 71
 		if err := models.NewEngine(); err != nil {
71 72
 			log.Fatal(4, "Fail to initialize ORM engine: %v", err)
72 73
 		}
73
-
74 74
 		models.HasEngine = true
75
+
76
+		// Booting long running goroutines.
75 77
 		cron.NewContext()
76 78
 		models.InitDeliverHooks()
77 79
 		models.InitTestPullRequests()
@@ -88,13 +90,10 @@ func GlobalInit() {
88 90
 	}
89 91
 	checkRunMode()
90 92
 
91
-	if setting.SSH.StartBuiltinServer {
93
+	if setting.InstallLock && setting.SSH.StartBuiltinServer {
92 94
 		ssh.Listen(setting.SSH.ListenPort)
93 95
 		log.Info("SSH server started on :%v", setting.SSH.ListenPort)
94 96
 	}
95
-
96
-	// Build Sanitizer
97
-	markdown.BuildSanitizer()
98 97
 }
99 98
 
100 99
 func InstallInit(ctx *context.Context) {

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
1
-0.9.87.0826
1
+0.9.88.0827