// GlobalInit is for global configuration reload-able. func GlobalInit() { setting.NewConfigContext() log.Trace("Custom path: %s", setting.CustomPath) log.Trace("Log path: %s", setting.LogRootPath) mailer.NewMailerContext() models.LoadModelsConfig() NewServices() if setting.InstallLock { models.LoadRepoConfig() models.NewRepoContext() if err := models.NewEngine(); err != nil { log.Fatal(4, "Fail to initialize ORM engine: %v", err) } models.HasEngine = true cron.NewCronContext() models.InitDeliverHooks() log.NewGitLogger(path.Join(setting.LogRootPath, "http.log")) } if models.EnableSQLite3 { log.Info("SQLite3 Supported") } checkRunMode() }
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 setting.UseSQLite3 { workDir, _ := setting.WorkDir() os.Chdir(workDir) } models.SetEngine() }