@@ -15,21 +15,13 @@ import (
15
15
"github.com/Unknwon/com"
16
16
"github.com/go-xorm/xorm"
17
17
"gopkg.in/ini.v1"
18
- "gopkg.in/macaron.v1"
19
-
20
- "code.gitea.io/git"
21
18
22
19
"code.gitea.io/gitea/models"
23
20
"code.gitea.io/gitea/modules/auth"
24
21
"code.gitea.io/gitea/modules/base"
25
22
"code.gitea.io/gitea/modules/context"
26
- "code.gitea.io/gitea/modules/cron"
27
23
"code.gitea.io/gitea/modules/log"
28
- "code.gitea.io/gitea/modules/mailer"
29
- "code.gitea.io/gitea/modules/markdown"
30
24
"code.gitea.io/gitea/modules/setting"
31
- "code.gitea.io/gitea/modules/ssh"
32
- "code.gitea.io/gitea/modules/template/highlight"
33
25
"code.gitea.io/gitea/modules/user"
34
26
)
35
27
@@ -38,67 +30,6 @@ const (
38
30
tplInstall base.TplName = "install"
39
31
)
40
32
41
- func checkRunMode () {
42
- switch setting .Cfg .Section ("" ).Key ("RUN_MODE" ).String () {
43
- case "prod" :
44
- macaron .Env = macaron .PROD
45
- macaron .ColorLog = false
46
- setting .ProdMode = true
47
- default :
48
- git .Debug = true
49
- }
50
- log .Info ("Run Mode: %s" , strings .Title (macaron .Env ))
51
- }
52
-
53
- // NewServices init new services
54
- func NewServices () {
55
- setting .NewServices ()
56
- mailer .NewContext ()
57
- }
58
-
59
- // GlobalInit is for global configuration reload-able.
60
- func GlobalInit () {
61
- setting .NewContext ()
62
- log .Trace ("Custom path: %s" , setting .CustomPath )
63
- log .Trace ("Log path: %s" , setting .LogRootPath )
64
- models .LoadConfigs ()
65
- NewServices ()
66
-
67
- if setting .InstallLock {
68
- highlight .NewContext ()
69
- markdown .BuildSanitizer ()
70
- if err := models .NewEngine (); err != nil {
71
- log .Fatal (4 , "Fail to initialize ORM engine: %v" , err )
72
- }
73
- models .HasEngine = true
74
-
75
- models .LoadRepoConfig ()
76
- models .NewRepoContext ()
77
-
78
- // Booting long running goroutines.
79
- cron .NewContext ()
80
- models .InitSyncMirrors ()
81
- models .InitDeliverHooks ()
82
- models .InitTestPullRequests ()
83
- log .NewGitLogger (path .Join (setting .LogRootPath , "http.log" ))
84
- }
85
- if models .EnableSQLite3 {
86
- log .Info ("SQLite3 Supported" )
87
- }
88
- if models .EnableTiDB {
89
- log .Info ("TiDB Supported" )
90
- }
91
- if setting .SupportMiniWinService {
92
- log .Info ("Builtin Windows Service Supported" )
93
- }
94
- checkRunMode ()
95
-
96
- if setting .InstallLock && setting .SSH .StartBuiltinServer {
97
- ssh .Listen (setting .SSH .ListenPort )
98
- log .Info ("SSH server started on :%v" , setting .SSH .ListenPort )
99
- }
100
- }
101
-
102
33
// InstallInit prepare for rendering installation page
103
34
func InstallInit (ctx * context.Context ) {
104
35
if setting .InstallLock {
0 commit comments